#include <Message_Queue.h>
Inheritance diagram for ACE_Message_Queue_Base:
Public Types | |
enum | { DEFAULT_HWM = 16 * 1024, DEFAULT_LWM = 16 * 1024, WAS_ACTIVE = 1, ACTIVATED = 1, WAS_INACTIVE = 2, DEACTIVATED = 2, PULSED = 3 } |
Public Member Functions | |
ACE_Message_Queue_Base (void) | |
virtual int | close (void)=0 |
Close down the message queue and release all resources. | |
virtual | ~ACE_Message_Queue_Base (void) |
Close down the message queue and release all resources. | |
virtual int | peek_dequeue_head (ACE_Message_Block *&first_item, ACE_Time_Value *timeout=0)=0 |
virtual int | enqueue_tail (ACE_Message_Block *new_item, ACE_Time_Value *timeout=0)=0 |
virtual int | enqueue (ACE_Message_Block *new_item, ACE_Time_Value *timeout=0)=0 |
virtual int | dequeue_head (ACE_Message_Block *&first_item, ACE_Time_Value *timeout=0)=0 |
virtual int | dequeue (ACE_Message_Block *&first_item, ACE_Time_Value *timeout=0)=0 |
virtual int | is_full (void)=0 |
True if queue is full, else false. | |
virtual int | is_empty (void)=0 |
True if queue is empty, else false. | |
virtual size_t | message_bytes (void)=0 |
virtual size_t | message_length (void)=0 |
virtual size_t | message_count (void)=0 |
Number of total messages on the queue. | |
virtual void | message_bytes (size_t new_size)=0 |
virtual void | message_length (size_t new_length)=0 |
virtual int | deactivate (void)=0 |
virtual int | activate (void)=0 |
virtual int | pulse (void)=0 |
virtual int | state (void) |
Returns the current state of the queue. | |
virtual int | deactivated (void)=0 |
virtual ACE_Notification_Strategy * | notification_strategy (void)=0 |
Get the notification strategy for the . | |
virtual void | notification_strategy (ACE_Notification_Strategy *s)=0 |
Set the notification strategy for the . | |
virtual void | dump (void) const=0 |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Protected Attributes | |
int | state_ |
Private Member Functions | |
ACE_Message_Queue_Base (const ACE_Message_Queue_Base &) | |
void | operator= (const ACE_Message_Queue_Base &) |
For all the ACE_Time_Value pointer parameters the caller will block until action is possible if timeout == 0. Otherwise, it will wait until the absolute time specified in *timeout elapses.
A queue is always in one of three states: . ACTIVATED . DEACTIVATED . PULSED
Definition at line 52 of file Message_Queue.h.
|
Definition at line 55 of file Message_Queue.h.
00056 { 00057 // Default high and low watermarks. 00058 00059 /// Default high watermark (16 K). 00060 DEFAULT_HWM = 16 * 1024, 00061 /// Default low watermark (same as high water mark). 00062 DEFAULT_LWM = 16 * 1024, 00063 00064 // Queue states. Before PULSED state was added, the activate() 00065 // and deactivate() methods returned WAS_INACTIVE or WAS_ACTIVE 00066 // to indicate the previous condition. Now those methods 00067 // return the state the queue was previously in. WAS_ACTIVE 00068 // and WAS_INACTIVE are defined to match previous semantics for 00069 // applications that don't use the PULSED state. 00070 00071 /// @deprecated Use ACTIVATED instead. 00072 WAS_ACTIVE = 1, 00073 /// Message queue is active and processing normally 00074 ACTIVATED = 1, 00075 00076 /// @deprecated Use DEACTIVATED instead. 00077 WAS_INACTIVE = 2, 00078 /// Queue is deactivated; no enqueue or dequeue operations allowed. 00079 DEACTIVATED = 2, 00080 00081 /// Message queue was pulsed; enqueue and dequeue may proceed normally. 00082 PULSED = 3 00083 00084 }; |
|
Definition at line 12 of file Message_Queue.inl.
00013 { 00014 } |
|
Close down the message queue and release all resources.
Definition at line 18 of file Message_Queue.cpp.
00019 { 00020 } |
|
|
|
Reactivate the queue so that threads can enqueue and dequeue messages again.
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Close down the message queue and release all resources.
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Deactivate the queue and wake up 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
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Returns 1 if the state of the queue is DEACTIVATED, and 0 if the queue's state is ACTIVATED or PULSED. Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Dequeue and return the <ACE_Message_Block *> at the head of the queue. Returns number of items in queue if the call succeeds or -1 otherwise. These calls return -1 when queue is closed, deactivated (in which case Implemented in ACE_Message_Queue<>, ACE_Dynamic_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Dump the state of an object.
Implemented in ACE_Message_Queue<>, ACE_Dynamic_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Enqueue a <ACE_Message_Block *> into the tail of the queue. Returns number of items in queue if the call succeeds or -1 otherwise. These calls return -1 when queue is closed, deactivated (in which case Implemented in ACE_Message_Queue<>, ACE_Dynamic_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
True if queue is empty, else false.
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
True if queue is full, else false.
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
New value of the number of total bytes on the queue, i.e., sum of the message block sizes. Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Number of total bytes on the queue, i.e., sum of the message block sizes. Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Number of total messages on the queue.
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
New value of the number of total length on the queue, i.e., sum of the message block lengths. Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Number of total length on the queue, i.e., sum of the message block lengths. Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Set the notification strategy for the .
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Get the notification strategy for the .
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
|
|
Retrieve the first ACE_Message_Block without removing it. Note that timeout uses <{absolute}> time rather than <{relative}> time. If the timeout elapses without receiving a message -1 is returned and Implemented in ACE_Message_Queue<>, ACE_Dynamic_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Pulse the queue to wake up any waiting threads. Changes the queue state to PULSED; future enqueue/dequeue operations proceed as in ACTIVATED state.
Implemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. |
|
Returns the current state of the queue.
Reimplemented in ACE_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. Definition at line 23 of file Message_Queue.cpp. References ACE_TRACE, and state_.
|
|
Declare the dynamic allocation hooks.
Reimplemented in ACE_Message_Queue<>, ACE_Dynamic_Message_Queue<>, ACE_Message_Queue< ACE_SYNCH >, and ACE_Message_Queue< ACE_SYNCH_USE >. Definition at line 213 of file Message_Queue.h. |
|
Indicates the state of the queue, which can be , , or . Definition at line 223 of file Message_Queue.h. Referenced by state(). |