MCPcopy Create free account
hub / github.com/acl-dev/acl / push

Method push

lib_acl_cpp/include/acl_cpp/stdlib/tbox.hpp:80–94  ·  view source on GitHub ↗

* Send message object * @param t {T*} Non-empty message object * @param notify_first {bool} If true, notify first then unlock, otherwise * unlock first * then notify. Note the difference between the two * @return {bool} * @override */

Source from the content-addressed store, hash-verified

78 * @override
79 */
80 bool push(T* t, bool notify_first = true) {
81 if (! lock_.lock()) { abort(); }
82 tbox_.push_back(t);
83 size_++;
84
85 if (notify_first) {
86 if (! cond_.notify()) { abort(); }
87 if (! lock_.unlock()) { abort(); }
88 } else {
89 if (! lock_.unlock()) { abort(); }
90 if (! cond_.notify()) { abort(); }
91 }
92
93 return true;
94 }
95
96 /**
97 * Receive message object

Callers

nothing calls this directly

Calls 4

lockMethod · 0.45
push_backMethod · 0.45
notifyMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected