Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / tao / Queued_Message.cpp
blob74e2dd273d01d99adbb928b8b2ab41182f9fd997
1 #include "tao/Queued_Message.h"
3 #if !defined (__ACE_INLINE__)
4 # include "tao/Queued_Message.inl"
5 #endif /* __ACE_INLINE__ */
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 TAO_Queued_Message::TAO_Queued_Message (TAO_ORB_Core *oc,
10 ACE_Allocator *alloc,
11 bool is_heap_allocated)
12 : allocator_ (alloc)
13 , is_heap_created_ (is_heap_allocated)
14 , orb_core_ (oc)
15 , next_ (nullptr)
16 , prev_ (nullptr)
20 TAO_Queued_Message::~TAO_Queued_Message ()
24 void
25 TAO_Queued_Message::remove_from_list (TAO_Queued_Message *&head,
26 TAO_Queued_Message *&tail)
28 if (this->prev_ != nullptr)
30 this->prev_->next_ = this->next_;
32 else if(head == this)
34 head = this->next_;
37 if (this->next_ != nullptr)
39 this->next_->prev_ = this->prev_;
41 else if(tail == this)
43 tail = this->prev_;
46 this->next_ = nullptr;
47 this->prev_ = nullptr;
50 void
51 TAO_Queued_Message::push_back (TAO_Queued_Message *&head,
52 TAO_Queued_Message *&tail)
54 if (tail == nullptr)
56 tail = this;
57 head = this;
58 this->next_ = nullptr;
59 this->prev_ = nullptr;
61 else
63 tail->next_ = this;
64 this->prev_ = tail;
65 this->next_ = nullptr;
66 tail = this;
70 void
71 TAO_Queued_Message::push_front (TAO_Queued_Message *&head,
72 TAO_Queued_Message *&tail)
74 if (head == nullptr)
76 tail = this;
77 head = this;
78 this->next_ = nullptr;
79 this->prev_ = nullptr;
81 else
83 head->prev_ = this;
84 this->next_ = head;
85 this->prev_ = nullptr;
86 head = this;
90 bool
91 TAO_Queued_Message::is_expired (const ACE_Time_Value &) const
93 return false;
96 TAO_END_VERSIONED_NAMESPACE_DECL