Message Queue implementation using IO completion port on NT.
More...
#include <Message_Queue_NT.h>
Message Queue implementation using IO completion port on NT.
Implementation of a strip-downed ACE_Message_Queue using NT's IO completion port mechanism.
- Note
- Many ACE_Message_Queue features are not supported with this implementation, including:
- <open> method have different signatures.
- <dequeue_head> requires that the ACE_Message_Block pointer argument point to an ACE_Message_Block that was allocated by the caller.
- <peek_dequeue_head>.
- <ACE_Message_Queue_Iterators>.
- No flow control.
ACE_Message_Queue_NT::~ACE_Message_Queue_NT |
( |
void |
| ) |
|
|
virtual |
Close down the message queue and release all resources.
int ACE_Message_Queue_NT::activate |
( |
void |
| ) |
|
|
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.
int ACE_Message_Queue_NT::close |
( |
void |
| ) |
|
|
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.
ACE_HANDLE ACE_Message_Queue_NT::completion_port |
( |
void |
| ) |
|
|
inlinevirtual |
Get the handle to the underlying completion port.
int ACE_Message_Queue_NT::deactivate |
( |
void |
| ) |
|
|
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.
- Return values
-
The | queue's state before this call. |
Implements ACE_Message_Queue_Base.
int ACE_Message_Queue_NT::deactivated |
( |
void |
| ) |
|
|
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.
void ACE_Message_Queue_NT::dump |
( |
void |
| ) |
const |
|
virtual |
bool ACE_Message_Queue_NT::is_empty |
( |
void |
| ) |
|
|
inlinevirtual |
True if queue is empty, else false. Notice the return value is only transient.
Implements ACE_Message_Queue_Base.
bool ACE_Message_Queue_NT::is_full |
( |
void |
| ) |
|
|
inlinevirtual |
DWORD ACE_Message_Queue_NT::max_threads |
( |
void |
| ) |
|
|
inlinevirtual |
Get the max concurrent thread number.
size_t ACE_Message_Queue_NT::message_bytes |
( |
void |
| ) |
|
|
inlinevirtual |
void ACE_Message_Queue_NT::message_bytes |
( |
size_t |
new_size | ) |
|
|
inlinevirtual |
New value of the number of total bytes on the queue, i.e., sum of the message block sizes.
Implements ACE_Message_Queue_Base.
size_t ACE_Message_Queue_NT::message_count |
( |
void |
| ) |
|
|
inlinevirtual |
size_t ACE_Message_Queue_NT::message_length |
( |
void |
| ) |
|
|
inlinevirtual |
Number of total length on the queue, i.e., sum of the message block lengths.
Implements ACE_Message_Queue_Base.
void ACE_Message_Queue_NT::message_length |
( |
size_t |
new_length | ) |
|
|
inlinevirtual |
New value of the number of total length on the queue, i.e., sum of the message block lengths.
Implements ACE_Message_Queue_Base.
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.
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.
int ACE_Message_Queue_NT::pulse |
( |
void |
| ) |
|
|
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.
- Return values
-
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.
ACE_HANDLE ACE_Message_Queue_NT::completion_port_ |
|
private |
Underlying NT IoCompletionPort.
size_t ACE_Message_Queue_NT::cur_bytes_ |
|
private |
Current number of bytes in queue.
size_t ACE_Message_Queue_NT::cur_count_ |
|
private |
Current number of messages in the queue.
size_t ACE_Message_Queue_NT::cur_length_ |
|
private |
Current length of messages in queue.
DWORD ACE_Message_Queue_NT::cur_thrs_ |
|
private |
Current number of threads waiting to dequeue messages.
DWORD ACE_Message_Queue_NT::max_cthrs_ |
|
private |
Maximum threads that can be released (and run) concurrently.
The documentation for this class was generated from the following files: