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

Method push

lib_acl_cpp/include/acl_cpp.cn/stdlib/tbox2.hpp:64–83  ·  view source on GitHub ↗

* ������Ϣ���� * @param t {T} ��Ϣ���� * @param notify_first {bool} ���Ϊ true������֪ͨ������������Ƚ��� * ��֪ͨ��ע����ߵ����� * @return {bool} * @override */

Source from the content-addressed store, hash-verified

62 * @override
63 */
64 bool push(T t, bool notify_first = true) {
65 if (! lock_.lock()) { abort(); }
66
67#if __cplusplus >= 201103L || defined(USE_CPP11) // Support c++11 ?
68 box_.emplace_back(t);
69#else
70 box_.push_back(t);
71#endif
72 size_++;
73
74 if (notify_first) {
75 if (!cond_.notify()) { abort(); }
76 if (!lock_.unlock()) { abort(); }
77 } else {
78 if (!lock_.unlock()) { abort(); }
79 if (!cond_.notify()) { abort(); }
80 }
81
82 return true;
83 }
84
85 /**
86 * ������Ϣ����

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