A threaded message queueing facility, modeled after the queueing facilities in System V STREAMs which can enqueue multiple messages in one call.
More...
template<class ACE_MESSAGE_TYPE, ACE_SYNCH_DECL>
class ACE_Message_Queue_Ex_N< ACE_MESSAGE_TYPE, ACE_SYNCH_DECL >
A threaded message queueing facility, modeled after the queueing facilities in System V STREAMs which can enqueue multiple messages in one call.
As ACE_Message_Queue_Ex, ACE_Message_Queue_Ex_N is a strongly-typed version of the ACE_Message_Queue. If ACE_SYNCH_DECL is ACE_MT_SYNCH then all operations are thread-safe. Otherwise, if it's ACE_NULL_SYNCH then there's no locking overhead.
The ACE_MESSAGE_TYPE messages that are sent to this queue can be chained. Messages are expected to have a next method that returns the next message in the chain; ACE_Message_Queue_Ex_N uses this method to run through all the incoming messages and enqueue them in one call.
template<class ACE_MESSAGE_TYPE , ACE_SYNCH_DECL >
Enqueue one or more ACE_MESSAGE_TYPE objects at the head of the queue. If the new_item next() pointer is non-zero, it is assumed to be the start of a series of ACE_MESSAGE_TYPE objects connected via their next() pointers. The series of blocks will be added to the queue in the same order they are passed in as.
- Parameters:
-
| new_item | Pointer to an ACE_MESSAGE_TYPE that will be added to the queue. If the block's next() pointer is non-zero, all blocks chained from the next() pointer are enqueued as well. |
| tv | The absolute time the caller will wait until for the block to be queued. |
- Return values:
-
| >0 | The number of ACE_MESSAGE_TYPE objects on the queue after adding the specified block(s). |
| -1 | On failure. errno holds the reason. Common errno values are:
- EWOULDBLOCK: the timeout elapsed
- ESHUTDOWN: the queue was deactivated or pulsed
|
Reimplemented from ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, ACE_SYNCH_USE >.
template<class ACE_MESSAGE_TYPE , ACE_SYNCH_DECL >
Enqueue one or more ACE_MESSAGE_TYPE objects at the tail of the queue. If the new_item next() pointer is non-zero, it is assumed to be the start of a series of ACE_MESSAGE_TYPE objects connected via their next() pointers. The series of blocks will be added to the queue in the same order they are passed in as.
- Parameters:
-
| new_item | Pointer to an ACE_MESSAGE_TYPE that will be added to the queue. If the block's next() pointer is non-zero, all blocks chained from the next() pointer are enqueued as well. |
| tv | The absolute time the caller will wait until for the block to be queued. |
- Return values:
-
| >0 | The number of ACE_MESSAGE_TYPE objects on the queue after adding the specified block(s). |
| -1 | On failure. errno holds the reason. Common errno values are:
- EWOULDBLOCK: the timeout elapsed
- ESHUTDOWN: the queue was deactivated or pulsed
|
Reimplemented from ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, ACE_SYNCH_USE >.