43 using value_type = value_type_new;
45 DCA_INLINE unbounded_message_block(){};
47 DCA_INLINE unbounded_message_block& operator=(unbounded_message_block&& other)
noexcept {
49 std::swap(queue, other.queue);
54 DCA_INLINE unbounded_message_block& operator=(
const unbounded_message_block&) =
delete;
55 DCA_INLINE unbounded_message_block(
const unbounded_message_block&) =
delete;
57 template<copyable_or_movable value_type_newer> DCA_INLINE
void send(value_type_newer&&
object) {
58 std::unique_lock lock{ accessMutex };
59 queue.emplace_back(std::forward<value_type_newer>(
object));
62 DCA_INLINE
void clearContents() {
63 std::unique_lock lock{ accessMutex };
67 DCA_INLINE
bool tryReceive(value_type&
object) {
68 std::unique_lock lock{ accessMutex };
69 if (queue.size() > 0) {
70 object = std::move(queue.front());
78 DCA_INLINE uint64_t size() {
79 std::unique_lock lock{ accessMutex };
83 DCA_INLINE ~unbounded_message_block() =
default;
86 std::deque<value_type> queue{};
87 std::mutex accessMutex{};