Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / Incoming_Message_Stack.inl
blob3f785c36c71a4f37cf0050dddf8fa04aaa0646cc
1 // -*- C++ -*-
2 //
3 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
5 /************************************************************************/
6 // Methods  for TAO_Incoming_Message_Stack
7 /************************************************************************/
8 namespace TAO
10 ACE_INLINE
11 Incoming_Message_Stack::Incoming_Message_Stack()
12 : top_(0)
16 ACE_INLINE
17 Incoming_Message_Stack::~Incoming_Message_Stack()
19   // Delete all the nodes left behind
20   TAO_Queued_Data *del = 0;
22   while (this->pop (del) != -1)
23     {
24       TAO_Queued_Data::release (del);
25     }
28 ACE_INLINE void
29 Incoming_Message_Stack::push(TAO_Queued_Data *data)
31   data->next (this->top_);
32   this->top_ = data;
36 /* @return 0 for Ok, -1 for error */
37 ACE_INLINE int
38 Incoming_Message_Stack::pop (TAO_Queued_Data* &data)
40   if (this->top_ == 0)
41     return -1;
43   data = this->top_;
44   this->top_ = data->next ();
46   return 0;
49 ACE_INLINE int
50 Incoming_Message_Stack::top (TAO_Queued_Data* &data) const
52   if (this->top_ == 0)
53     return -1;
55   data = this->top_;
57   return 0;
60 } /* namespace TAO */
61 TAO_END_VERSIONED_NAMESPACE_DECL