3 //=============================================================================
7 * @author Tim Bradley <bradley_t@ociweb.com>
9 //=============================================================================
11 #ifndef TAO_CSD_TP_QUEUE_H
12 #define TAO_CSD_TP_QUEUE_H
14 #include /**/ "ace/pre.h"
16 #include "tao/CSD_ThreadPool/CSD_TP_Export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/Versioned_Namespace.h"
23 #include "tao/orbconf.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 class TP_Queue_Visitor
;
37 * @brief Queue of servant requests that need to be dispatched.
39 * This is the queue of pending servant requests that is "owned"
40 * by a TP_Strategy object. When an ORB thread dispatches
41 * a servant request to the strategy object, it will create the
42 * appropriate (subclass of) TP_Request object to "wrap"
43 * the servant request in a "queue-friendly" wrapper. The ORB thread
44 * will then place the TP_Request object on to the queue. Note that
45 * this scenario pertains to what are being called "remote requests".
46 * There are other scenarios in which other types of requests can
47 * get added to this queue.
49 * The strategy object will employ a set of worker threads that are
50 * responsible for "servicing" the servant requests in the queue.
52 * Note: In the future, support will be added to allow the client
53 * application inject "custom" TP_Request objects into
54 * a TP_Strategy object, causing them to be placed in
57 class TAO_CSD_TP_Export TP_Queue
60 /// Default Constructor.
66 /// Place a request at the end of the queue.
67 void put(TP_Request
* request
);
69 /// Returns true if the queue is empty. Returns false otherwise.
70 bool is_empty() const;
72 /// Visitors will visit each request in the queue, from front to back,
73 /// and have the ability to stop visiting at any time (ie, before
74 /// visiting every request).
75 void accept_visitor(TP_Queue_Visitor
& visitor
);
78 /// The request at the front of the queue.
81 /// The request at the end of the queue.
87 TAO_END_VERSIONED_NAMESPACE_DECL
89 #if defined (__ACE_INLINE__)
90 # include "tao/CSD_ThreadPool/CSD_TP_Queue.inl"
91 #endif /* __ACE_INLINE__ */
93 #include /**/ "ace/post.h"
95 #endif /* TAO_CSD_TP_QUEUE_H */