summaryrefslogtreecommitdiff
path: root/ace/Message_Queue.h
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-06-24 18:56:24 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-06-24 18:56:24 +0000
commita252612f7b4462d6230d8c15e67272bf3f056c92 (patch)
treed5405fc2ebca7ce0127792dba813ad8350f2f325 /ace/Message_Queue.h
parent86cfe6714b190f6e715aff0a2eb6e5613c30ebc9 (diff)
downloadATCD-a252612f7b4462d6230d8c15e67272bf3f056c92.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Message_Queue.h')
-rw-r--r--ace/Message_Queue.h81
1 files changed, 40 insertions, 41 deletions
diff --git a/ace/Message_Queue.h b/ace/Message_Queue.h
index 3d46e93f84f..50d1e93b12d 100644
--- a/ace/Message_Queue.h
+++ b/ace/Message_Queue.h
@@ -109,22 +109,26 @@ public:
// inserted consecutively. Returns -1 on failure, else the number
// of items still on the queue.
- virtual int enqueue (ACE_Message_Block *new_item, ACE_Time_Value *timeout = 0);
+ virtual int enqueue (ACE_Message_Block *new_item,
+ ACE_Time_Value *timeout = 0);
// 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.
- virtual int enqueue_tail (ACE_Message_Block *new_item, ACE_Time_Value *timeout = 0);
+ virtual int enqueue_tail (ACE_Message_Block *new_item,
+ ACE_Time_Value *timeout = 0);
// Enqueue an <ACE_Message_Block *> at the end of the queue.
// Returns -1 on failure, else the number of items still on the
// queue.
- virtual int enqueue_head (ACE_Message_Block *new_item, ACE_Time_Value *timeout = 0);
+ virtual int enqueue_head (ACE_Message_Block *new_item,
+ ACE_Time_Value *timeout = 0);
// Enqueue an <ACE_Message_Block *> at the head of the queue.
// Returns -1 on failure, else the number of items still on the
// queue.
- virtual int dequeue_head (ACE_Message_Block *&first_item, ACE_Time_Value *timeout = 0);
+ virtual int dequeue_head (ACE_Message_Block *&first_item,
+ ACE_Time_Value *timeout = 0);
// 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.
@@ -363,30 +367,29 @@ private:
// Keeps track of how far we've advanced...
};
-
template <ACE_SYNCH_DECL>
class ACE_Dynamic_Message_Queue : public ACE_Message_Queue<ACE_SYNCH_USE>
{
// = TITLE
- // A derived class which adapts the ACE_Message_Queue
+ // 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 dynamically.
+ // <ACE_Message_Blocks> and manage the queue dynamically.
//
// = DESCRIPTION
- // Priorities and queue orderings are refreshed at each enqueue and
- // dequeue operation. Head and tail enqueue methods were made private
- // to prevent out-of-order messages from confusing the pending
- // and late portions of the queue. Messages in the pending portion of
- // the queue whose dynamic priority becomes negative are placed into
- // the late portion of the queue. Messages in the late portion of
- // the queue whose dynamic priority becomes positive are dropped.
- // These behaviors support a limited schedule overrun corresponding
- // to one full cycle through dynamic priority values. These behaviors
- // can be modified in derived classes by providing alternative
+ // Priorities and queue orderings are refreshed at each enqueue
+ // and dequeue operation. Head and tail enqueue methods were
+ // made private to prevent out-of-order messages from confusing
+ // the pending and late portions of the queue. Messages in the
+ // pending portion of the queue whose dynamic priority becomes
+ // negative are placed into the late portion of the queue.
+ // Messages in the late portion of the queue whose dynamic
+ // priority becomes positive are dropped. These behaviors
+ // support a limited schedule overrun corresponding to one full
+ // cycle through dynamic priority values. These behaviors can
+ // be modified in derived classes by providing alternative
// definitions for the appropriate virtual methods.
//
public:
-
// = Initialization and termination methods.
ACE_Dynamic_Message_Queue (ACE_Dynamic_Message_Strategy & message_strategy,
size_t hwm = DEFAULT_HWM,
@@ -400,43 +403,41 @@ public:
// Declare the dynamic allocation hooks.
protected:
-
virtual int enqueue_i (ACE_Message_Block *new_item);
// Enqueue an <ACE_Message_Block *> in accordance with its priority.
// priority may be *dynamic* or *static* or a combination or *both*
// It calls the priority evaluation function passed into the Dynamic
- // Message Queue constructor to update the priorities of all enqueued
- // messages.
+ // Message Queue constructor to update the priorities of all
+ // enqueued messages.
virtual int dequeue_head_i (ACE_Message_Block *&first_item);
// Dequeue and return the <ACE_Message_Block *> at the head of the
// queue.
virtual int refresh_priorities (const ACE_Time_Value & tv);
- // refresh the priorities in the queue according
- // to a specific priority assignment function
+ // Refresh the priorities in the queue according to a specific
+ // priority assignment function.
virtual int refresh_queue (const ACE_Time_Value & tv);
- // refresh the order of messages in the queue
- // after refreshing their priorities
+ // Refresh the order of messages in the queue after refreshing their
+ // priorities.
ACE_Message_Block *pending_list_tail_;
- // Pointer to tail of the pending messages (those whose priority is
- // and has been non-negative) in the ACE_Message_Block list.
+ // Pointer to tail of the pending messages (those whose priority is
+ // and has been non-negative) in the <ACE_Message_Block list>.
- ACE_Dynamic_Message_Strategy & message_strategy_;
- // Pointer to a dynamic priority evaluation function
+ ACE_Dynamic_Message_Strategy &message_strategy_;
+ // Pointer to a dynamic priority evaluation function.
private:
-
// = Disallow these operations.
ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> &))
ACE_UNIMPLEMENTED_FUNC (ACE_Dynamic_Message_Queue (const ACE_Dynamic_Message_Queue<ACE_SYNCH_USE> &))
- // External invocation of these could cause extreme wierdness
- // in a dynamically prioritized queue: disallow their use until
- // and unless a coherent semantics for head and tail enqueueing
- // can be identified.
+ // = These methods can wierdness in dynamically prioritized queue.
+
+ // Disallow their use until and unless a coherent semantics for head
+ // and tail enqueueing can be identified.
ACE_UNIMPLEMENTED_FUNC (virtual int
enqueue_tail (ACE_Message_Block *new_item,
ACE_Time_Value *timeout = 0))
@@ -444,22 +445,20 @@ private:
enqueue_head (ACE_Message_Block *new_item,
ACE_Time_Value *timeout = 0))
- // As messages are *dynamically* prioritized, it is not possible to
- // guarantee that the message at the head of the queue when this
- // method is called will still be at the head when the next method
- // is called: disallow its use until and unless a coherent semantics
- // for peeking at the head of the queue can be identified.
ACE_UNIMPLEMENTED_FUNC (virtual int
peek_dequeue_head (ACE_Message_Block *&first_item,
ACE_Time_Value *tv = 0))
+ // Since messages are *dynamically* prioritized, it is not possible
+ // to guarantee that the message at the head of the queue when this
+ // method is called will still be at the head when the next method
+ // is called: disallow its use until and unless a coherent semantics
+ // for peeking at the head of the queue can be identified.
};
-
template <ACE_SYNCH_DECL>
class ACE_Export ACE_Message_Queue_Factory
{
public:
-
static ACE_Message_Queue<ACE_SYNCH_USE> *
create_static_message_queue (size_t hwm = DEFAULT_HWM,
size_t lwm = DEFAULT_LWM,