00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Incoming_Message_Stack.h 00006 * 00007 * $Id: Incoming_Message_Stack.h 88333 2009-12-24 10:21:16Z johnnyw $ 00008 * 00009 * @author Frank Rehberger <frehberg@prismtech.com> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_INCOMING_MESSAGE_STACK_H 00014 #define TAO_INCOMING_MESSAGE_STACK_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/Queued_Data.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #if defined (__BORLANDC__) && (__BORLANDC__ < 0x630) 00025 #include /**/ "tao/TAO_Export.h" 00026 #endif 00027 00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00029 class ACE_Allocator; 00030 ACE_END_VERSIONED_NAMESPACE_DECL 00031 00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00033 00034 namespace TAO 00035 { 00036 /** 00037 * @class Incoming_Message_Stack 00038 * 00039 * @brief Implements stack for TAO_Queued_Data. 00040 * 00041 * Internal class, providing stack functionality for TAO_Queued_Data 00042 * objects. Stack operations don't require memory allocation. 00043 */ 00044 #if defined (__BORLANDC__) && (__BORLANDC__ < 0x630) 00045 class TAO_Export Incoming_Message_Stack 00046 #else 00047 class Incoming_Message_Stack 00048 #endif 00049 { 00050 public: 00051 /// default constructor, initiliazes empty stack. 00052 Incoming_Message_Stack(); 00053 00054 /// destructor, releases all elements on stack 00055 ~Incoming_Message_Stack() ; 00056 00057 /// pushing a new element onto stack, 00058 /// @a data must be a valid pointer, not NULL 00059 void push(TAO_Queued_Data *data); 00060 00061 /// removing top element of stack, 00062 /// @return 0 for Ok and @a data is defined, -1 for error 00063 int pop (TAO_Queued_Data* &data); 00064 00065 /// peeking top element of stack 00066 /// @return 0 for Ok, -1 for error 00067 int top (TAO_Queued_Data* &data) const; 00068 00069 private: 00070 /// Top element of stack 00071 TAO_Queued_Data *top_; 00072 00073 private: 00074 /// Default Copy-Constructor - not for public usage. 00075 Incoming_Message_Stack (const Incoming_Message_Stack&); 00076 00077 /// Assignment operator - not for public usage 00078 Incoming_Message_Stack& operator= (Incoming_Message_Stack& other); 00079 }; 00080 } 00081 00082 TAO_END_VERSIONED_NAMESPACE_DECL 00083 00084 #if defined (__ACE_INLINE__) 00085 # include "tao/Incoming_Message_Stack.inl" 00086 #endif /* __ACE_INLINE__ */ 00087 00088 #include /**/ "ace/post.h" 00089 #endif /*TAO_INCOMING_MESSAGE_STACK_H*/