2 #include "../acl_cpp_define.hpp" 42 for (
typename std::vector<T*>::iterator it = objs_.begin();
43 it != objs_.end(); ++it) {
47 return (
int) objs_.size();
63 std::vector<T*> objs_;
112 template <
typename T>
128 int ttl = o->get_ttl();
133 if (it == items_.end()) {
149 long long key = o->get_key();
152 if (it == items_.end())
154 if (it->second->del(o) == 0) {
158 return (
int) items_.size();
169 std::vector<trigger_item<T>*> items;
171 for (iter = items_.begin(); iter != items_.end();) {
172 if (iter->first > key)
175 items.push_back(iter->second);
176 items_.erase(iter++);
180 it = items.begin(); it != items.end(); ++it) {
186 iter = items_.begin();
187 if (iter == items_.end())
201 std::vector<T*>& objs = item->
get_objs();
202 for (
typename std::vector<T*>::iterator it = objs.begin();
203 it != objs.end(); ++it) {
205 if (!(*it)->on_trigger())
208 int ttl = (*it)->get_ttl();
212 if (iter == items_.end()) {
228 template <
typename T>
256 timer_del_.push_back(o);
270 T* o = mbox_.pop(delay_);
274 long long next = timer_.trigger();
279 delay_ = next - curr;
285 typename std::vector<T*>::iterator it;
286 for (it = timer_del_.begin();
287 it != timer_del_.end(); ++it) {
301 timer_trigger<T> timer_;
304 std::vector<T*> timer_del_;
trigger_items_t::iterator trigger_iter_t
virtual ~thread_trigger(void)
std::map< long long, trigger_item< T > * > trigger_items_t
timer_trigger< T > & get_trigger(void)
trigger_item(trigger_items_t &items)
std::vector< T * > & get_objs(void)
std::map< long long, trigger_item< T > * > trigger_items_t
ACL_CPP_API long long get_curr_stamp(void)