|
| ACE_Dynamic_Message_Queue (ACE_Dynamic_Message_Strategy &message_strategy, size_t hwm=ACE_Message_Queue_Base::DEFAULT_HWM, size_t lwm=ACE_Message_Queue_Base::DEFAULT_LWM, ACE_Notification_Strategy *=0) |
|
virtual | ~ACE_Dynamic_Message_Queue () |
| Close down the message queue and release all resources.
|
|
virtual int | remove_messages (ACE_Message_Block *&list_head, ACE_Message_Block *&list_tail, u_int status_flags) |
|
virtual int | dequeue_head (ACE_Message_Block *&first_item, ACE_Time_Value *timeout=0) |
|
virtual void | dump () const |
| Dump the state of the queue.
|
|
virtual int | enqueue_tail (ACE_Message_Block *new_item, ACE_Time_Value *timeout=0) |
|
virtual int | enqueue_head (ACE_Message_Block *new_item, ACE_Time_Value *timeout=0) |
|
| ACE_Message_Queue (size_t hwm=ACE_Message_Queue_Base::DEFAULT_HWM, size_t lwm=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 *ns=0) |
|
virtual int | close () |
|
virtual | ~ACE_Message_Queue () |
| Releases all resources from the message queue and marks it deactivated.
|
|
virtual int | flush () |
|
virtual int | flush_i () |
|
virtual int | enqueue_prio (ACE_Message_Block *new_item, ACE_Time_Value *timeout=0) |
|
virtual int | enqueue_deadline (ACE_Message_Block *new_item, ACE_Time_Value *timeout=0) |
|
virtual int | enqueue (ACE_Message_Block *new_item, ACE_Time_Value *timeout=0) |
|
virtual int | dequeue (ACE_Message_Block *&first_item, ACE_Time_Value *timeout=0) |
| This method is an alias for the dequeue_head() method.
|
|
virtual int | dequeue_prio (ACE_Message_Block *&first_item, ACE_Time_Value *timeout=0) |
|
virtual int | dequeue_tail (ACE_Message_Block *&dequeued, ACE_Time_Value *timeout=0) |
|
virtual int | dequeue_deadline (ACE_Message_Block *&dequeued, ACE_Time_Value *timeout=0) |
|
virtual bool | is_full () |
| True if queue is full, else false.
|
|
virtual bool | is_empty () |
| True if queue is empty, else false.
|
|
virtual size_t | message_bytes () |
|
virtual size_t | message_length () |
|
virtual size_t | message_count () |
|
virtual void | message_bytes (size_t new_size) |
|
virtual void | message_length (size_t new_length) |
|
virtual size_t | high_water_mark () |
|
virtual void | high_water_mark (size_t hwm) |
|
virtual size_t | low_water_mark () |
|
virtual void | low_water_mark (size_t lwm) |
|
virtual int | deactivate () |
|
virtual int | activate () |
|
virtual int | pulse () |
|
virtual int | state () |
|
virtual int | deactivated () |
|
virtual int | notify () |
|
virtual ACE_Notification_Strategy * | notification_strategy () |
| Get the notification strategy for the <Message_Queue>
|
|
virtual void | notification_strategy (ACE_Notification_Strategy *s) |
| Set the notification strategy for the <Message_Queue>
|
|
virtual ACE_SYNCH_MUTEX_T & | lock () |
| Returns a reference to the lock used by the ACE_Message_Queue.
|
|
ACE_Time_Value_T< TIME_POLICY > | gettimeofday () const |
|
void | set_time_policy (TIME_POLICY const &time_policy) |
|
| ACE_Message_Queue_Base () |
|
virtual | ~ACE_Message_Queue_Base () |
| Close down the message queue and release all resources.
|
|
A derived class which adapts the ACE_Message_Queue class in order to maintain dynamic priorities for enqueued <ACE_Message_Blocks> and manage the queue order according to these dynamic priorities.
The messages in the queue are managed so as to preserve a logical ordering with minimal overhead per enqueue and dequeue operation. For this reason, the actual order of messages in the linked list of the queue may differ from their priority order. As time passes, a message may change from pending status to late status, and eventually to beyond late status. To minimize reordering overhead under this design force, three separate boundaries are maintained within the linked list of messages. Messages are dequeued preferentially from the head of the pending portion, then the head of the late portion, and finally from the head of the beyond late portion. In this way, only the boundaries need to be maintained (which can be done efficiently, as aging messages maintain the same linked list order as they progress from one status to the next), with no reordering of the messages themselves, while providing correct priority ordered dequeueing semantics. Head and tail enqueue methods inherited from ACE_Message_Queue are made private to prevent out-of-order messages from confusing management of the various portions of the queue. Messages in the pending portion of the queue whose priority becomes late (according to the specific dynamic strategy) advance into the late portion of the queue. Messages in the late portion of the queue whose priority becomes later than can be represented advance to the beyond_late portion of the queue. These behaviors support a limited schedule overrun, with pending messages prioritized ahead of late messages, and late messages ahead of beyond late messages. These behaviors can be modified in derived classes by providing alternative definitions for the appropriate virtual methods. When filled with messages, the queue's linked list should look like: H T | | B - B - B - B - L - L - L - P - P - P - P - P | | | | | | BH BT LH LT PH PT Where the symbols are as follows: H = Head of the entire list T = Tail of the entire list B = Beyond late message BH = Beyond late messages Head BT = Beyond late messages Tail L = Late message LH = Late messages Head LT = Late messages Tail P = Pending message PH = Pending messages Head PT = Pending messages Tail Caveat: the virtual methods enqueue_tail, enqueue_head, and peek_dequeue_head have semantics for the static message queues that cannot be guaranteed for dynamic message queues. The peek_dequeue_head method just calls the base class method, while the two enqueue methods call the priority enqueue method. The order of messages in the dynamic queue is a function of message deadlines and how long they are in the queues. You can manipulate these in some cases to ensure the correct semantics, but that is not a very stable or portable approach (discouraged).