3 //=============================================================================
5 * @file Incoming_Message_Queue.h
7 * @author Balachandran Natarajan <bala@cs.wustl.edu>
9 //=============================================================================
11 #ifndef TAO_INCOMING_MESSAGE_QUEUE_H
12 #define TAO_INCOMING_MESSAGE_QUEUE_H
14 #include /**/ "ace/pre.h"
16 #include "tao/Pluggable_Messaging_Utils.h"
17 #include "ace/Message_Block.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
26 class TAO_Queued_Data
;
30 * @class TAO_Incoming_Message_Queue
32 * @brief A queue of the messages in the incoming data path.
34 * Please read the documentation in the TAO_Transport class to find
35 * out more about the design of the incoming data path.
37 * Under certain conditions TAO may have to maintain a queue
38 * per-connection. This queue is drained by the pluggable
39 * protocols framework, normally under control of the ACE_Reactor, but
40 * other configurations are conceivable.
42 * The memory that is allocated for holding the messages comes from
43 * the global pool for the following reasons
45 * - the thread that reads a part of the message would not be the same
46 * thread that reads and fills the rest of the message
47 * - the thread that actually processes the message can be totally
50 class TAO_Export TAO_Incoming_Message_Queue
54 TAO_Incoming_Message_Queue (TAO_ORB_Core
*orb_core
);
57 ~TAO_Incoming_Message_Queue ();
59 /// Adding and deleting a node from the queue.
60 TAO_Queued_Data
*dequeue_head ();
61 TAO_Queued_Data
*dequeue_tail ();
62 int enqueue_tail (TAO_Queued_Data
*nd
);
64 /// Return the length of the queue..
65 CORBA::ULong
queue_length () const;
68 friend class TAO_Transport
;
72 \brief A circular linked list of messages awaiting processing.
74 \a last_message_added_ points to the most recent message added to
75 the list. The earliest addition can be easily accessed via
76 \a last_message_added_->next_.
78 TAO_Queued_Data
*last_added_
;
80 /// The size of the queue
83 /// Copy of our ORB Core
84 TAO_ORB_Core
*orb_core_
;
87 /// Constant value indicating that the correct value is unknown yet,
88 /// probably parsing the header failed due to insufficient data in buffer.
89 const size_t TAO_MISSING_DATA_UNDEFINED
= ~((size_t) 0); // MAX_SIZE_T
91 TAO_END_VERSIONED_NAMESPACE_DECL
93 #if defined (__ACE_INLINE__)
94 # include "tao/Incoming_Message_Queue.inl"
95 #endif /* __ACE_INLINE__ */
97 #include /**/ "ace/post.h"
98 #endif /*TAO_INCOMING_MESSAGE_QUEUE_H*/