#include <Message_Queue_T.h>
Collaboration diagram for ACE_Message_Queue_Ex:

Public Types | |
| enum | { DEFAULT_PRIORITY = 0 } |
Public 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 *=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) |
| virtual int | close (void) |
| Close down the message queue and release all resources. More... | |
| virtual | ~ACE_Message_Queue_Ex (void) |
| Close down the message queue and release all resources. More... | |
| virtual int | flush (void) |
| Release all resources from the message queue but do not mark it as deactivated. This method holds the queue lock during this operation. Returns the number of messages flushed. More... | |
| virtual int | flush_i (void) |
| Release all resources from the message queue but do not mark it as deactivated. This method does not hold the queue lock during this operation, i.e., it assume the lock is held externally. Returns the number of messages flushed. More... | |
| 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) |
| 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 <dequeue_head> method. More... | |
| 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) |
| virtual int | is_full (void) |
| True if queue is full, else false. More... | |
| virtual int | is_empty (void) |
| True if queue is empty, else false. More... | |
| virtual size_t | message_bytes (void) |
| virtual size_t | message_length (void) |
| virtual int | message_count (void) |
| virtual void | message_bytes (size_t new_size) |
| virtual void | message_length (size_t new_length) |
| 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) |
| virtual int | deactivate (void) |
| virtual int | activate (void) |
| virtual int | pulse (void) |
| virtual int | state (void) |
| Returns the current state of the queue, which can be one of ACTIVATED, DEACTIVATED, or PULSED. More... | |
| virtual int | deactivated (void) |
| Returns true if the state of the queue is DEACTIVATED, but false if the queue's state is ACTIVATED or PULSED. More... | |
| virtual int | notify (void) |
| virtual ACE_Notification_Strategy * | notification_strategy (void) |
| Get the notification strategy for the <Message_Queue>. More... | |
| virtual void | notification_strategy (ACE_Notification_Strategy *s) |
| Set the notification strategy for the <Message_Queue>. More... | |
| virtual ACE_SYNCH_MUTEX_T & | lock (void) |
| Returns a reference to the lock used by the <ACE_Message_Queue_Ex>. More... | |
| virtual void | dump (void) const |
| Dump the state of an object. More... | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. More... | |
Private Attributes | |
| ACE_Message_Queue< ACE_SYNCH_USE > | queue_ |
| Implement this via an <ACE_Message_Queue>. More... | |
An <ACE_Message_Queue_Ex> 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.
Definition at line 877 of file Message_Queue_T.h.
|
|||||
|
Definition at line 882 of file Message_Queue_T.h.
00883 {
00884 DEFAULT_PRIORITY = 0
00885 };
|
|
||||||||||||||||||||
|
Initialize an <ACE_Message_Queue>. The <high_water_mark> determines how many bytes can be stored in a queue before it's considered "full." Supplier threads must block until the queue is no longer full. The <low_water_mark> determines how many bytes must be in the queue before supplier threads are allowed to enqueue additional <ACE_Message_Block>s. By default, the <high_water_mark> equals the <low_water_mark>, which means that suppliers will be able to enqueue new messages as soon as a consumer removes any message from the queue. Making the <low_water_mark> smaller than the <high_water_mark> forces consumers to drain more messages from the queue before suppliers can enqueue new messages, which can minimize the "silly window syndrome." Definition at line 52 of file Message_Queue_T.cpp. References ACE_ERROR, ACE_LIB_TEXT, ACE_TRACE, LM_ERROR, ACE_Message_Queue< ACE_SYNCH_USE >::open, and queue_.
|
|
||||||||||
|
Close down the message queue and release all resources.
Definition at line 64 of file Message_Queue_T.cpp. References ACE_TRACE.
00065 {
00066 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::~ACE_Message_Queue_Ex");
00067 }
|
|
||||||||||
|
Reactivate the queue so that threads can enqueue and dequeue messages again. Returns the state of the queue before the call. Definition at line 297 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::activate, and queue_.
|
|
||||||||||
|
Close down the message queue and release all resources.
Definition at line 82 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::close, and queue_.
|
|
||||||||||
|
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 <errno> == ESHUTDOWN. Returns WAS_INACTIVE if queue was inactive before the call and WAS_ACTIVE if queue was active before the call. Definition at line 289 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::deactivate, and queue_.
00290 {
00291 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivate");
00292
00293 return this->queue_.deactivate ();
00294 }
|
|
||||||||||
|
Returns true if the state of the queue is DEACTIVATED, but false if the queue's state is ACTIVATED or PULSED.
Definition at line 313 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::deactivated, and queue_.
00314 {
00315 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::deactivated");
00316
00317 return this->queue_.deactivated ();
00318 }
|
|
||||||||||||||||
|
This method is an alias for the following <dequeue_head> method.
Definition at line 188 of file Message_Queue_T.i. References ACE_TRACE, and dequeue_head.
00190 {
00191 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue");
00192
00193 return this->dequeue_head (first_item, timeout);
00194 }
|
|
||||||||||||||||
|
Dequeue and return the <ACE_MESSAGE_TYPE *> with the lowest deadline time. 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. Definition at line 308 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Block::base, ACE_Message_Queue< ACE_SYNCH_USE >::dequeue_deadline, queue_, and ACE_Message_Block::release.
00310 {
00311 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_deadline");
00312
00313 ACE_Message_Block *mb;
00314
00315 int cur_count = this->queue_.dequeue_deadline (mb, timeout);
00316
00317 // Dequeue the message.
00318 if (cur_count != -1)
00319 {
00320 dequeued = ACE_reinterpret_cast (ACE_MESSAGE_TYPE *, mb->base ());
00321 // Delete the message block.
00322 mb->release ();
00323 return cur_count;
00324 }
00325 else
00326 return -1;
00327 }
|
|
||||||||||||||||
|
Dequeue and return the <ACE_MESSAGE_TYPE *> at the head of the queue. 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. Definition at line 230 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Block::base, ACE_Message_Queue< ACE_SYNCH_USE >::dequeue_head, queue_, and ACE_Message_Block::release. Referenced by dequeue.
00232 {
00233 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_head");
00234
00235 ACE_Message_Block *mb;
00236
00237 int cur_count = this->queue_.dequeue_head (mb, timeout);
00238
00239 // Dequeue the message.
00240 if (cur_count != -1)
00241 {
00242 first_item = ACE_reinterpret_cast (ACE_MESSAGE_TYPE *, mb->base ());
00243 // Delete the message block.
00244 mb->release ();
00245 return cur_count;
00246 }
00247 else
00248 return -1;
00249 }
|
|
||||||||||||||||
|
Dequeue and return the <ACE_MESSAGE_TYPE *> that has the lowest priority. 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. Definition at line 256 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Block::base, ACE_Message_Queue< ACE_SYNCH_USE >::dequeue_prio, queue_, and ACE_Message_Block::release.
00258 {
00259 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_prio");
00260
00261 ACE_Message_Block *mb;
00262
00263 int cur_count = this->queue_.dequeue_prio (mb, timeout);
00264
00265 // Dequeue the message.
00266 if (cur_count != -1)
00267 {
00268 dequeued = ACE_reinterpret_cast (ACE_MESSAGE_TYPE *, mb->base ());
00269 // Delete the message block.
00270 mb->release ();
00271 return cur_count;
00272 }
00273 else
00274 return -1;
00275 }
|
|
||||||||||||||||
|
Dequeue and return the <ACE_MESSAGE_TYPE *> at the tail of the queue. 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. Definition at line 282 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Block::base, ACE_Message_Queue< ACE_SYNCH_USE >::dequeue_tail, queue_, and ACE_Message_Block::release.
00284 {
00285 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::dequeue_tail");
00286
00287 ACE_Message_Block *mb;
00288
00289 int cur_count = this->queue_.dequeue_tail (mb, timeout);
00290
00291 // Dequeue the message.
00292 if (cur_count != -1)
00293 {
00294 dequeued = ACE_reinterpret_cast (ACE_MESSAGE_TYPE *, mb->base ());
00295 // Delete the message block.
00296 mb->release ();
00297 return cur_count;
00298 }
00299 else
00300 return -1;
00301 }
|
|
||||||||||
|
Dump the state of an object.
Definition at line 28 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::dump, and queue_.
|
|
||||||||||||||||
|
This is an alias for <enqueue_prio>. It's only here for backwards compatibility and will go away in a subsequent release. Please use <enqueue_prio> instead. Note that <timeout> uses <{absolute}> time rather than <{relative}> time. Definition at line 149 of file Message_Queue_T.cpp. References ACE_TRACE, and enqueue_prio.
00151 {
00152 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_prio");
00153
00154 return this->enqueue_prio (new_item, timeout);
00155 }
|
|
||||||||||||||||
|
Enqueue an <ACE_MESSAGE_TYPE *> into the <Message_Queue> in accordance with its <msg_deadline_time>. FIFO order is maintained when messages of the same deadline time are inserted consecutively. 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. Definition at line 180 of file Message_Queue_T.cpp. References ACE_NEW_RETURN, ACE_TRACE, DEFAULT_PRIORITY, ACE_Message_Queue< ACE_SYNCH_USE >::enqueue_deadline, queue_, and ACE_Message_Block::release.
00182 {
00183 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_deadline");
00184
00185 ACE_Message_Block *mb;
00186
00187 ACE_NEW_RETURN (mb,
00188 ACE_Message_Block ((char *) new_item,
00189 sizeof (*new_item),
00190 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::DEFAULT_PRIORITY ),
00191 -1);
00192
00193 int result = this->queue_.enqueue_deadline (mb, timeout);
00194 if (result == -1)
00195 // Zap the message.
00196 mb->release ();
00197
00198 return result;
00199 }
|
|
||||||||||||||||
|
Enqueue an <ACE_MESSAGE_TYPE *> at the head of the queue. 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. Definition at line 124 of file Message_Queue_T.cpp. References ACE_NEW_RETURN, ACE_TRACE, DEFAULT_PRIORITY, ACE_Message_Queue< ACE_SYNCH_USE >::enqueue_head, queue_, and ACE_Message_Block::release.
00126 {
00127 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_head");
00128
00129 ACE_Message_Block *mb;
00130
00131 ACE_NEW_RETURN (mb,
00132 ACE_Message_Block ((char *) new_item,
00133 sizeof (*new_item),
00134 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::DEFAULT_PRIORITY),
00135 -1);
00136
00137 int result = this->queue_.enqueue_head (mb, timeout);
00138 if (result == -1)
00139 // Zap the message.
00140 mb->release ();
00141 return result;
00142 }
|
|
||||||||||||||||
|
Enqueue an <ACE_MESSAGE_TYPE *> into the <Message_Queue> in accordance with its <msg_priority> (0 is lowest priority). FIFO order is maintained when messages of the same priority are inserted consecutively. 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. Definition at line 158 of file Message_Queue_T.cpp. References ACE_NEW_RETURN, ACE_TRACE, DEFAULT_PRIORITY, ACE_Message_Queue< ACE_SYNCH_USE >::enqueue_prio, queue_, and ACE_Message_Block::release. Referenced by enqueue.
00160 {
00161 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_prio");
00162
00163 ACE_Message_Block *mb;
00164
00165 ACE_NEW_RETURN (mb,
00166 ACE_Message_Block ((char *) new_item,
00167 sizeof (*new_item),
00168 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::DEFAULT_PRIORITY),
00169 -1);
00170
00171 int result = this->queue_.enqueue_prio (mb, timeout);
00172 if (result == -1)
00173 // Zap the message.
00174 mb->release ();
00175
00176 return result;
00177 }
|
|
||||||||||||||||
|
Enqueue an <ACE_MESSAGE_TYPE *> at the end of the queue. 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. Definition at line 205 of file Message_Queue_T.cpp. References ACE_NEW_RETURN, ACE_TRACE, DEFAULT_PRIORITY, ACE_Message_Queue< ACE_SYNCH_USE >::enqueue_tail, queue_, and ACE_Message_Block::release.
00207 {
00208 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::enqueue_tail");
00209
00210 ACE_Message_Block *mb;
00211
00212 ACE_NEW_RETURN (mb,
00213 ACE_Message_Block ((char *) new_item,
00214 sizeof (*new_item),
00215 ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::DEFAULT_PRIORITY),
00216 -1);
00217
00218 int result = this->queue_.enqueue_tail (mb, timeout);
00219 if (result == -1)
00220 // Zap the message.
00221 mb->release ();
00222 return result;
00223 }
|
|
||||||||||
|
Release all resources from the message queue but do not mark it as deactivated. This method holds the queue lock during this operation. Returns the number of messages flushed.
Definition at line 90 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::flush, and queue_.
|
|
||||||||||
|
Release all resources from the message queue but do not mark it as deactivated. This method does not hold the queue lock during this operation, i.e., it assume the lock is held externally. Returns the number of messages flushed.
Definition at line 98 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::flush_i, and queue_.
|
|
||||||||||
|
Set the high watermark, which determines how many bytes can be stored in a queue before it's considered "full." Definition at line 241 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::high_water_mark, and queue_.
00242 {
00243 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::high_water_mark");
00244
00245 this->queue_.high_water_mark (hwm);
00246 }
|
|
||||||||||
|
Get high watermark. Definition at line 233 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::high_water_mark, and queue_.
00234 {
00235 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::high_water_mark");
00236
00237 return this->queue_.high_water_mark ();
00238 }
|
|
||||||||||
|
True if queue is empty, else false.
Definition at line 215 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::is_empty, and queue_.
|
|
||||||||||
|
True if queue is full, else false.
Definition at line 225 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::is_full, and queue_.
|
|
||||||||||
|
Returns a reference to the lock used by the <ACE_Message_Queue_Ex>.
Definition at line 1205 of file Message_Queue_T.h. References ACE_SYNCH_MUTEX_T, ACE_Message_Queue< ACE_SYNCH_USE >::lock, and queue_.
|
|
||||||||||
|
Set the low watermark, which determines how many bytes must be in the queue before supplier threads are allowed to enqueue additional <ACE_MESSAGE_TYPE>s. Definition at line 257 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::low_water_mark, and queue_.
00258 {
00259 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::low_water_mark");
00260
00261 this->queue_.low_water_mark (lwm);
00262 }
|
|
||||||||||
|
Get low watermark. Definition at line 249 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::low_water_mark, and queue_.
00250 {
00251 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::low_water_mark");
00252
00253 return this->queue_.low_water_mark ();
00254 }
|
|
||||||||||
|
New value of the number of total bytes on the queue, i.e., sum of the message block sizes. Definition at line 36 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::message_bytes, and queue_.
00037 {
00038 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_bytes");
00039
00040 this->queue_.message_bytes (new_value);
00041 }
|
|
||||||||||
|
Number of total bytes on the queue, i.e., sum of the message block sizes. Definition at line 265 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::message_bytes, and queue_.
00266 {
00267 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_bytes");
00268
00269 return this->queue_.message_bytes ();
00270 }
|
|
||||||||||
|
Number of total messages on the queue. Definition at line 281 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::message_count, and queue_.
00282 {
00283 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_count");
00284
00285 return this->queue_.message_count ();
00286 }
|
|
||||||||||
|
New value of the number of total length on the queue, i.e., sum of the message block lengths. Definition at line 44 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::message_length, and queue_.
00045 {
00046 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_length");
00047
00048 this->queue_.message_length (new_value);
00049 }
|
|
||||||||||
|
Number of total length on the queue, i.e., sum of the message block lengths. Definition at line 273 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::message_length, and queue_.
00274 {
00275 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::message_length");
00276
00277 return this->queue_.message_length ();
00278 }
|
|
||||||||||
|
Set the notification strategy for the <Message_Queue>.
Definition at line 205 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::notification_strategy, and queue_.
00206 {
00207 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notification_strategy");
00208
00209 this->queue_.notification_strategy (s);
00210 }
|
|
||||||||||
|
Get the notification strategy for the <Message_Queue>.
Definition at line 197 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::notification_strategy, and queue_.
00198 {
00199 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::notification_strategy");
00200
00201 return this->queue_.notification_strategy ();
00202 }
|
|
||||||||||
|
This hook is automatically invoked by <enqueue_head>, <enqueue_tail>, and <enqueue_prio> 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 <WFMO_Reactor>, notifying a <Reactor>, 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. Definition at line 330 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::notify, and queue_.
|
|
||||||||||||||||||||
|
Initialize an <ACE_Message_Queue>. The <high_water_mark> determines how many bytes can be stored in a queue before it's considered "full." Supplier threads must block until the queue is no longer full. The <low_water_mark> determines how many bytes must be in the queue before supplier threads are allowed to enqueue additional <ACE_Message_Block>s. By default, the <high_water_mark> equals the <low_water_mark>, which means that suppliers will be able to enqueue new messages as soon as a consumer removes any message from the queue. Making the <low_water_mark> smaller than the <high_water_mark> forces consumers to drain more messages from the queue before suppliers can enqueue new messages, which can minimize the "silly window syndrome." Definition at line 70 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::open, and queue_.
|
|
||||||||||||||||
|
Retrieve the first <ACE_MESSAGE_TYPE> 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. Definition at line 108 of file Message_Queue_T.cpp. References ACE_TRACE, ACE_Message_Block::base, ACE_Message_Queue< ACE_SYNCH_USE >::peek_dequeue_head, and queue_.
00110 {
00111 ACE_TRACE ("ACE_Message_Queue_Ex<ACE_MESSAGE_TYPE, ACE_SYNCH_USE>::peek_dequeue_head");
00112
00113 ACE_Message_Block *mb;
00114
00115 int cur_count = this->queue_.peek_dequeue_head (mb, timeout);
00116
00117 if (cur_count != -1)
00118 first_item = ACE_reinterpret_cast (ACE_MESSAGE_TYPE *, mb->base ());
00119
00120 return cur_count;
00121 }
|
|
||||||||||
|
Pulse the queue to wake up any waiting threads. Changes the queue state to PULSED; future enqueue/dequeue operations proceed as in ACTIVATED state.
Definition at line 305 of file Message_Queue_T.i. References ACE_TRACE, ACE_Message_Queue< ACE_SYNCH_USE >::pulse, and queue_.
|
|
||||||||||
|
Returns the current state of the queue, which can be one of ACTIVATED, DEACTIVATED, or PULSED.
Definition at line 321 of file Message_Queue_T.i. References ACE_TRACE, queue_, and ACE_Message_Queue< ACE_SYNCH_USE >::state.
|
|
|||||
|
Declare the dynamic allocation hooks.
Definition at line 1216 of file Message_Queue_T.h. |
|
|||||
|
Implement this via an <ACE_Message_Queue>.
Definition at line 1220 of file Message_Queue_T.h. Referenced by ACE_Message_Queue_Ex, activate, close, deactivate, deactivated, dequeue_deadline, dequeue_head, dequeue_prio, dequeue_tail, dump, enqueue_deadline, enqueue_head, enqueue_prio, enqueue_tail, flush, flush_i, high_water_mark, is_empty, is_full, lock, low_water_mark, message_bytes, message_count, message_length, notification_strategy, notify, open, peek_dequeue_head, pulse, and state. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002