36 template<
typename value_type>
37 concept copyable_or_movable = std::copyable<std::unwrap_ref_decay_t<value_type>> || std::movable<std::unwrap_ref_decay_t<value_type>>;
43 using value_type = value_type_new;
49 std::swap(queue, other.queue);
57 template<copyable_or_movable value_type_newer>
inline void send(value_type_newer&&
object) {
58 std::unique_lock lock{ accessMutex };
59 queue.emplace_back(std::forward<value_type_newer>(
object));
62 inline void clearContents() {
63 std::unique_lock lock{ accessMutex };
67 inline bool tryReceive(value_type&
object) {
68 std::unique_lock lock{ accessMutex };
69 if (queue.size() > 0) {
70 object = std::move(queue.front());
78 inline uint64_t size() {
79 std::unique_lock lock{ accessMutex };
86 std::deque<value_type> queue{};
87 std::mutex accessMutex{};
90 template<
typename value_type>
inline bool waitForTimeToPass(
unbounded_message_block<std::unwrap_ref_decay_t<value_type>>& outBuffer, value_type& argOne, uint64_t timeInMsNew) {
91 stop_watch<milliseconds> stopWatch{ milliseconds{ timeInMsNew } };
93 while (!outBuffer.tryReceive(argOne)) {
94 std::this_thread::sleep_for(1ms);
95 if (stopWatch.hasTimeElapsed()) {
A thread-safe messaging block for data-structures.
The main namespace for the forward-facing interfaces.