TAO::Incoming_Message_Stack Class Reference

Implements stack for TAO_Queued_Data. More...

#include <Incoming_Message_Stack.h>

Collaboration diagram for TAO::Incoming_Message_Stack:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Incoming_Message_Stack ()
 default constructor, initiliazes empty stack.
 ~Incoming_Message_Stack ()
 destructor, releases all elements on stack
void push (TAO_Queued_Data *data)
int pop (TAO_Queued_Data *&data)
int top (TAO_Queued_Data *&data) const

Private Member Functions

 Incoming_Message_Stack (const Incoming_Message_Stack &)
 Default Copy-Constructor - not for public usage.
Incoming_Message_Stackoperator= (Incoming_Message_Stack &other)
 Assignment operator - not for public usage.

Private Attributes

TAO_Queued_Datatop_
 top element of stack

Detailed Description

Implements stack for TAO_Queued_Data.

Internal class, providing stack functionality for TAO_Queued_Data objects. Stack operations don't require memory allocation.

Definition at line 47 of file Incoming_Message_Stack.h.


Constructor & Destructor Documentation

ACE_INLINE TAO::Incoming_Message_Stack::Incoming_Message_Stack (  ) 

default constructor, initiliazes empty stack.

Definition at line 13 of file Incoming_Message_Stack.inl.

00014 : top_(0)
00015 {
00016 }

ACE_INLINE TAO::Incoming_Message_Stack::~Incoming_Message_Stack (  ) 

destructor, releases all elements on stack

Definition at line 19 of file Incoming_Message_Stack.inl.

References TAO_Queued_Data::release().

00020 {
00021   // Delete all the nodes left behind
00022   TAO_Queued_Data *del = 0;
00023 
00024   while (this->pop (del) != -1)
00025     {
00026       TAO_Queued_Data::release (del);
00027     }
00028 }

TAO::Incoming_Message_Stack::Incoming_Message_Stack ( const Incoming_Message_Stack  )  [private]

Default Copy-Constructor - not for public usage.


Member Function Documentation

Incoming_Message_Stack& TAO::Incoming_Message_Stack::operator= ( Incoming_Message_Stack other  )  [private]

Assignment operator - not for public usage.

ACE_INLINE int TAO::Incoming_Message_Stack::pop ( TAO_Queued_Data *&  data  ) 

removing top element of stack,

Returns:
0 for Ok and data is defined, -1 for error

Definition at line 40 of file Incoming_Message_Stack.inl.

References TAO_Queued_Data::next(), and top_.

00041 {
00042   if (this->top_ == 0)
00043     return -1;
00044 
00045   data = this->top_;
00046   this->top_ = data->next ();
00047 
00048   return 0;
00049 }

ACE_INLINE void TAO::Incoming_Message_Stack::push ( TAO_Queued_Data data  ) 

pushing a new element onto stack, data must be a valid pointer, not NULL

Definition at line 31 of file Incoming_Message_Stack.inl.

References TAO_Queued_Data::next(), and top_.

00032 {
00033   data->next (this->top_);
00034   this->top_ = data;
00035 }

ACE_INLINE int TAO::Incoming_Message_Stack::top ( TAO_Queued_Data *&  data  )  const

peeking top element of stack

Returns:
0 for Ok, -1 for error

Definition at line 52 of file Incoming_Message_Stack.inl.

References top_.

00053 {
00054   if (this->top_ == 0)
00055     return -1;
00056 
00057   data = this->top_;
00058 
00059   return 0;
00060 }


Member Data Documentation

TAO_Queued_Data* TAO::Incoming_Message_Stack::top_ [private]

top element of stack

Definition at line 71 of file Incoming_Message_Stack.h.

Referenced by pop(), push(), and top().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:39:13 2010 for TAO by  doxygen 1.4.7