summaryrefslogtreecommitdiff
path: root/TAO/tao/Incoming_Message_Stack.h
blob: 81f268aa2cb2d72797eb5699057b1bb49e87d47c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// -*- C++ -*-

//=============================================================================
/**
 *  @file Incoming_Message_Stack.h
 *
 *  $Id$
 *
 *  @author Frank Rehberger <frehberg@prismtech.com>
 */
//=============================================================================

#ifndef TAO_INCOMING_MESSAGE_STACK_H
#define TAO_INCOMING_MESSAGE_STACK_H

#include /**/ "ace/pre.h"

#include "tao/Incoming_Message_Queue.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582)
#include "tao/TAO_Export.h"
#endif

ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Allocator;
ACE_END_VERSIONED_NAMESPACE_DECL

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

namespace TAO
{
/**
 * @class Incoming_Message_Stack
 *
 * @brief Implements stack for TAO_Queued_Data.
 *
 * Internal class, providing stack functionality for TAO_Queued_Data
 * objects.  Stack operations don't require memory allocation.
*/
#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x582)
class TAO_Export Incoming_Message_Stack
#else
class Incoming_Message_Stack
#endif
{
public:
  /// default constructor, intiliazes empty stack.
  Incoming_Message_Stack();

  /// destructor, releases all elements on stack
  ~Incoming_Message_Stack() ;

  /// pushing a new element onto stack,
  /// @a data must be a valid pointer, not NULL
  void push(TAO_Queued_Data *data);

  /// removing top element of stack,
  /// @return 0 for Ok and @a data is defined, -1 for error
  int pop (TAO_Queued_Data* &data);

  /// peeking top element of stack
  /// @return 0 for Ok, -1 for error
  int top (TAO_Queued_Data* &data);

private:
  /// top element of stack
  TAO_Queued_Data *top_;

private:
  /// Default Copy-Constructor -  not for public usage.
  Incoming_Message_Stack (const Incoming_Message_Stack&);

  /// Assignment operator - not for public usage
  Incoming_Message_Stack& operator= (Incoming_Message_Stack& other);
};
}

TAO_END_VERSIONED_NAMESPACE_DECL

#if defined (__ACE_INLINE__)
# include "tao/Incoming_Message_Stack.inl"
#endif /* __ACE_INLINE__ */

#include /**/ "ace/post.h"
#endif /*TAO_INCOMING_MESSAGE_STACK_H*/