ACE 8.0.1
|
Message Queue implementation using IO completion port on NT. More...
#include <Message_Queue_NT.h>
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Private Member Functions | |
ACE_Message_Queue_NT (const ACE_Message_Queue_NT &)=delete | |
void | operator= (const ACE_Message_Queue_NT &)=delete |
ACE_Message_Queue_NT (ACE_Message_Queue_NT &&)=delete | |
void | operator= (ACE_Message_Queue_NT &&)=delete |
Private Attributes | |
DWORD | max_cthrs_ |
Maximum threads that can be released (and run) concurrently. | |
DWORD | cur_thrs_ |
Current number of threads waiting to dequeue messages. | |
size_t | cur_bytes_ |
Current number of bytes in queue. | |
size_t | cur_length_ |
Current length of messages in queue. | |
size_t | cur_count_ |
Current number of messages in the queue. | |
ACE_SYNCH_MUTEX | lock_ |
ACE_HANDLE | completion_port_ |
Underlying NT IoCompletionPort. | |
Additional Inherited Members | |
![]() | |
enum | { DEFAULT_HWM = 16 * 1024 , DEFAULT_LWM = 16 * 1024 , ACTIVATED = 1 , DEACTIVATED = 2 , PULSED = 3 } |
![]() | |
int | state_ |
Message Queue implementation using IO completion port on NT.
Implementation of a strip-downed ACE_Message_Queue using NT's IO completion port mechanism.
ACE_Message_Queue_NT::ACE_Message_Queue_NT | ( | DWORD | max_threads = ACE_Message_Queue_Base::DEFAULT_HWM | ) |
|
virtual |
Close down the message queue and release all resources.
|
privatedelete |
|
privatedelete |
|
virtual |
Reactivate the queue so that threads can enqueue and dequeue messages again. Returns the state of the queue before the call.
Implements ACE_Message_Queue_Base.
|
virtual |
Close down the underlying I/O completion port. You need to re-open the MQ after this function is executed.
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
Get the handle to the underlying completion port.
|
virtual |
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 errno
ESHUTDOWN.
The | queue's state before this call. |
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
Returns true if the state of the queue is <DEACTIVATED>, but false if the queue's is <ACTIVATED> or <PULSED>.
Implements ACE_Message_Queue_Base.
|
virtual |
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
Dequeue and return the ACE_Message_Block * at the head of the queue. Returns -1 on failure, else the number of items still on the queue.
Implements ACE_Message_Queue_Base.
|
virtual |
Dump the state of an object.
Implements ACE_Message_Queue_Base.
|
virtual |
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
Enqueue an ACE_Message_Block * at the end of the queue. Returns -1 on failure, else the number of items still on the queue.
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
True if queue is empty, else false. Notice the return value is only transient.
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
Always return false.
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
Get the max concurrent thread number.
|
inlinevirtual |
Number of total bytes on the queue, i.e., sum of the message block sizes.
Implements ACE_Message_Queue_Base.
New value of the number of total bytes on the queue, i.e., sum of the message block sizes.
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
Number of total messages on the queue.
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
Number of total length on the queue, i.e., sum of the message block lengths.
Implements ACE_Message_Queue_Base.
New value of the number of total length on the queue, i.e., sum of the message block lengths.
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
Get the notification strategy for the Message_Queue.
Implements ACE_Message_Queue_Base.
|
inlinevirtual |
Set the notification strategy for the Message_Queue.
Implements ACE_Message_Queue_Base.
|
virtual |
Initialize the Message Queue by creating a new NT I/O completion port. The first arguemnt specifies the number of threads released by the MQ that are allowed to run concurrently. Return 0 when succeeds, -1 otherwise.
|
privatedelete |
|
privatedelete |
|
inlinevirtual |
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 errno
is set to EWOULDBLOCK
. If the queue is deactivated -1 is returned and errno
is set to ESHUTDOWN
. Otherwise, returns -1 on failure, else the number of items still on the queue.
Implements ACE_Message_Queue_Base.
|
virtual |
Pulse the queue to wake up any waiting threads. Changes the queue state to PULSED; future enqueue/dequeue operations proceed as in ACTIVATED state.
The | queue's state before this call. |
Implements ACE_Message_Queue_Base.
ACE_Message_Queue_NT::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
|
private |
Underlying NT IoCompletionPort.
|
private |
Current number of bytes in queue.
|
private |
Current number of messages in the queue.
|
private |
Current length of messages in queue.
|
private |
Current number of threads waiting to dequeue messages.
|
private |
Synchronizer. This should really be an ACE_Recursive_Thread_Mutex but since this class is only supported on NT, it's okay to use ACE_Thread_Mutex here.
|
private |
Maximum threads that can be released (and run) concurrently.