- Timestamp:
- 06/16/09 12:50:21 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/objective-cplusplus/i3/trunk/src/mil/include/mil/gui-cocoa/GuiModule.h
r33968 r33996 17 17 Tls tls; 18 18 private: 19 class EventBase : public boost:: intrusive::slist_base_hook<>, public boost::noncopyable19 class EventBase : public boost::noncopyable 20 20 { 21 21 public: 22 22 void (*execute)(void* event, void* target); 23 23 intptr_t owner_id; 24 EventBase* next; 24 25 }; 25 26 26 27 class EventList : public boost::noncopyable 27 28 { 28 boost::intrusive::slist<EventBase, boost::intrusive::constant_time_size<false>, boost::intrusive::cache_last<true> > l; 29 EventBase* head; 30 EventBase* tail; 29 31 boost::details::pool::default_mutex m; 30 32 typedef boost::details::pool::guard<boost::details::pool::default_mutex> guard; 31 33 public: 34 EventList() 35 { 36 head = NULL; 37 tail = NULL; 38 } 39 32 40 void push(EventBase& e) 33 41 { 34 42 guard g(m); 35 l.push_back(e); 43 e.next = NULL; 44 if (head == NULL) { // tail == NULL 45 head = &e; 46 tail = &e; 47 return; 48 } 49 tail->next = &e; 50 tail = &e; 36 51 } 37 52 … … 39 54 { 40 55 guard g(m); 41 l.pop_front(); 56 if (!head) { 57 return; 58 } 59 head = head->next; 42 60 } 43 61 … … 45 63 { 46 64 guard g(m); 47 if (l.size() == 0) 48 { 49 return NULL; 50 } 51 return &l.front(); 65 return head; 66 } 67 68 void clear() 69 { 70 guard g(m); 71 head = NULL; 72 tail = NULL; 52 73 } 53 74 }; 75 54 76 55 77 template <typename T>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)