1 #ifndef ACE_INTRUSIVE_LIST_CPP
2 #define ACE_INTRUSIVE_LIST_CPP
4 #include "ace/Intrusive_List.h"
6 #if !defined (ACE_LACKS_PRAGMA_ONCE)
8 #endif /* ACE_LACKS_PRAGMA_ONCE */
10 #if !defined (__ACE_INLINE__)
11 #include "ace/Intrusive_List.inl"
12 #endif /* __ACE_INLINE__ */
14 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
16 template<class T
> void
17 ACE_Intrusive_List
<T
>::push_back (T
*node
)
28 this->tail_
->next (node
);
29 node
->prev (this->tail_
);
35 template<class T
> void
36 ACE_Intrusive_List
<T
>::push_front (T
*node
)
47 this->head_
->prev (node
);
48 node
->next (this->head_
);
55 ACE_Intrusive_List
<T
>::pop_front ()
57 T
*node
= this->head_
;
60 this->unsafe_remove (node
);
66 ACE_Intrusive_List
<T
>::pop_back ()
68 T
*node
= this->tail_
;
71 this->unsafe_remove (node
);
76 template<class T
> void
77 ACE_Intrusive_List
<T
>::remove (T
*node
)
79 for (T
*i
= this->head_
; i
!= 0; i
= i
->next ())
83 this->unsafe_remove (node
);
89 template<class T
> void
90 ACE_Intrusive_List
<T
>::unsafe_remove (T
*node
)
92 if (node
->prev () != 0)
93 node
->prev ()->next (node
->next ());
95 this->head_
= node
->next ();
97 if (node
->next () != 0)
98 node
->next ()->prev (node
->prev ());
100 this->tail_
= node
->prev ();
106 ACE_END_VERSIONED_NAMESPACE_DECL
108 #endif /* ACE_INTRUSIVE_LIST_CPP */