#include <Message_Queue_T.h>
Collaboration diagram for ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, >:
Public Types | |
enum | { DEFAULT_PRIORITY = 0 } |
Public Member Functions | |
virtual int | close (void) |
virtual | ~ACE_Message_Queue_Ex (void) |
Releases all resources from the message queue and marks it deactivated. | |
virtual int | flush (void) |
virtual int | flush_i (void) |
virtual ACE_SYNCH_MUTEX_T & | lock (void) |
Returns a reference to the lock used by the ACE_Message_Queue_Ex. | |
virtual void | dump (void) const |
Dump the state of an object. | |
Initialization methods | |
ACE_Message_Queue_Ex (size_t high_water_mark=ACE_Message_Queue_Base::DEFAULT_HWM, size_t low_water_mark=ACE_Message_Queue_Base::DEFAULT_LWM, ACE_Notification_Strategy *ns=0) | |
virtual int | open (size_t hwm=ACE_Message_Queue_Base::DEFAULT_HWM, size_t lwm=ACE_Message_Queue_Base::DEFAULT_LWM, ACE_Notification_Strategy *=0) |
Enqueue and dequeue methods | |
The enqueue and dequeue methods accept a timeout value passed as an ACE_Time_Value *. In all cases, if the timeout pointer is 0, the caller will block until action is possible. If the timeout pointer is non-zero, the call will wait (if needed, subject to water mark settings) until the absolute time specified in the referenced ACE_Time_Value object is reached. If the time is reached before the desired action is possible, the method will return -1 with errno set to EWOULDBLOCK . Regardless of the timeout setting, however, these methods will also fail and return -1 when the queue is closed, deactivated, pulsed, or when a signal occurs.
The time parameters are handled the same as in ACE_Message_Queue, so you can see C++NPv2 Section 6.2 and APG Section 12.3 for a fuller treatment of ACE_Message_Queue, enqueueing, dequeueing, and how these operations are affected by queue state transitions. | |
virtual int | peek_dequeue_head (ACE_MESSAGE_TYPE *&first_item, ACE_Time_Value *timeout=0) |
virtual int | enqueue_prio (ACE_MESSAGE_TYPE *new_item, ACE_Time_Value *timeout=0, unsigned long priority=DEFAULT_PRIORITY) |
virtual int | enqueue_deadline (ACE_MESSAGE_TYPE *new_item, ACE_Time_Value *timeout=0) |
virtual int | enqueue (ACE_MESSAGE_TYPE *new_item, ACE_Time_Value *timeout=0) |
virtual int | enqueue_tail (ACE_MESSAGE_TYPE *new_item, ACE_Time_Value *timeout=0) |
virtual int | enqueue_head (ACE_MESSAGE_TYPE *new_item, ACE_Time_Value *timeout=0) |
virtual int | dequeue (ACE_MESSAGE_TYPE *&first_item, ACE_Time_Value *timeout=0) |
This method is an alias for the following method. | |
virtual int | dequeue_head (ACE_MESSAGE_TYPE *&first_item, ACE_Time_Value *timeout=0) |
virtual int | dequeue_prio (ACE_MESSAGE_TYPE *&dequeued, ACE_Time_Value *timeout=0) |
virtual int | dequeue_tail (ACE_MESSAGE_TYPE *&dequeued, ACE_Time_Value *timeout=0) |
virtual int | dequeue_deadline (ACE_MESSAGE_TYPE *&dequeued, ACE_Time_Value *timeout=0) |
Queue statistics methods | |
virtual int | is_full (void) |
True if queue is full, else false. | |
virtual int | is_empty (void) |
True if queue is empty, else false. | |
virtual size_t | message_bytes (void) |
virtual size_t | message_length (void) |
virtual size_t | message_count (void) |
virtual void | message_bytes (size_t new_size) |
virtual void | message_length (size_t new_length) |
Water mark (flow control) methods | |
virtual size_t | high_water_mark (void) |
virtual void | high_water_mark (size_t hwm) |
virtual size_t | low_water_mark (void) |
virtual void | low_water_mark (size_t lwm) |
Activation and queue state methods | |
See C++NPv2 Section 6.2 and APG Section 12.3 for a fuller treatment of queue states and transitions and how the transitions affect message enqueueing and dequeueing operations. | |
virtual int | deactivate (void) |
virtual int | activate (void) |
virtual int | pulse (void) |
virtual int | state (void) |
virtual int | deactivated (void) |
Notification strategy methods | |
virtual int | notify (void) |
virtual ACE_Notification_Strategy * | notification_strategy (void) |
Get the notification strategy for the . | |
virtual void | notification_strategy (ACE_Notification_Strategy *s) |
Set the notification strategy for the . | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Protected Attributes | |
ACE_Message_Queue< ACE_SYNCH_USE > | queue_ |
Implement this via an ACE_Message_Queue. |
ACE_Message_Queue_Ex is a strongly-typed version of the ACE_Message_Queue class. Rather than queueing in terms of ACE_Message_Block objects, ACE_Message_Queue_Ex has a template argument to specify the type of objects that are queued.
The second template argument parameterizes the queue's synchronization. The argument specifies a synchronization strategy. The two main strategies available for ACE_SYNCH_DECL are:
Definition at line 964 of file Message_Queue_T.h.
|
Definition at line 968 of file Message_Queue_T.h.
00969 { 00970 /// Default priority value. This is the lowest priority. 00971 DEFAULT_PRIORITY = 0 00972 }; |
|
Initialize an ACE_Message_Queue_Ex.
|
|
Releases all resources from the message queue and marks it deactivated.
|
|
Reactivate the queue so that threads can enqueue and dequeue messages again. Returns the state of the queue before the call. |
|
Releases all resources from the message queue and marks it deactivated.
|
|
Deactivate the queue and wakeup all threads waiting on the queue so they can continue. No messages are removed from the queue, however. Any other operations called until the queue is activated again will immediately return -1 with |
|
Returns true if the state of the queue is DEACTIVATED, but false if the queue's state is ACTIVATED or PULSED. |
|
This method is an alias for the following method.
|
|
Because there's deadline associated with enqueue_deadline(), this method will behave just as dequeue_head(). |
|
Dequeue the item at the head of the queue and return a pointer to it.
Referenced by ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, ACE_SYNCH_USE >::dequeue(). |
|
Dequeue the item that has the lowest priority (preserves FIFO order for items with the same priority) and return a pointer to it.
|
|
Dequeue the item at the tail of the queue and return a pointer to it.
|
|
Dump the state of an object.
|
|
|
|
This method acts just like enqueue_tail(). There's no deadline time associated with items. |
|
Enqueue an item at the head of the queue.
Reimplemented in ACE_Message_Queue_Ex_N< ACE_MESSAGE_TYPE, >. |
|
Enqueue an ACE_MESSAGE TYPE into the queue in accordance with the specified priority (0 is lowest priority). FIFO order is maintained when items of the same priority are inserted consecutively.
Referenced by ACE_Message_Queue_Ex< ACE_MESSAGE_TYPE, ACE_SYNCH_USE >::enqueue(). |
|
Enqueue an item at the tail of the queue.
Reimplemented in ACE_Message_Queue_Ex_N< ACE_MESSAGE_TYPE, >. |
|
Releases all resources from the message queue but does not mark it deactivated. This method holds the queue lock during this operation.
|
|
Release all resources from the message queue but do not mark it as deactivated.
|
|
Set the high watermark, which determines how many bytes can be stored in a queue before it's considered "full." |
|
Get high watermark. |
|
True if queue is empty, else false.
|
|
True if queue is full, else false.
|
|
Returns a reference to the lock used by the ACE_Message_Queue_Ex.
|
|
Set the low watermark, which determines how many bytes must be in the queue before supplier threads are allowed to enqueue additional s. |
|
Get low watermark. |
|
New value of the number of total bytes on the queue, i.e., sum of the message block sizes. |
|
Number of total bytes on the queue, i.e., sum of the message block sizes. |
|
Number of total messages on the queue. |
|
New value of the number of total length on the queue, i.e., sum of the message block lengths. |
|
Number of total length on the queue, i.e., sum of the message block lengths. |
|
Set the notification strategy for the .
|
|
Get the notification strategy for the .
|
|
This hook is automatically invoked by , , and when a new item is inserted into the queue. Subclasses can override this method to perform specific notification strategies (e.g., signaling events for a , notifying a , etc.). In a multi-threaded application with concurrent consumers, there is no guarantee that the queue will be still be non-empty by the time the notification occurs. |
|
Initialize an ACE_Message_Queue_Ex.
|
|
Retrieve a pointer to the first item in the queue without removing it.
|
|
Pulse the queue to wake up any waiting threads. Changes the queue state to PULSED; future enqueue/dequeue operations proceed as in ACTIVATED state.
|
|
Returns the current state of the queue, which can be one of ACTIVATED, DEACTIVATED, or PULSED. |
|
Declare the dynamic allocation hooks.
Reimplemented in ACE_Message_Queue_Ex_N< ACE_MESSAGE_TYPE, >. Definition at line 1356 of file Message_Queue_T.h. |
|
Implement this via an ACE_Message_Queue.
Definition at line 1360 of file Message_Queue_T.h. |