(file) Return to MessageQueueService.html CVS log (file) (dir) Up to [Pegasus] / pegasus / doc

Diff for /pegasus/doc/MessageQueueService.html between version 1.1 and 1.4

version 1.1, 2002/02/05 23:14:54 version 1.4, 2002/03/13 17:33:36
Line 1 
Line 1 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
   <html lang="en"><head>
   <META http-equiv="Content-Type" content="text/html;
         charset=ISO-8859-1"><meta http-equiv="Content-Type"
                                   content="text/html;
                                   charset=ISO-8859-1"><title>Pegasus
         Meta Dispatcher </title><style type="text/css">
   
   body {
     margin: 2em 1em 2em;
     font-family: sans-serif;
     color: black;
     background: white;
     background-position: top left;
     background-attachment: fixed;
     background-repeat: no-repeat;
   }
   :link { color: #00C; background: transparent }
   :visited { color: #609; background: transparent }
   :active { color: #C00; background: transparent }
   
   th, td { /* ns 4 */
     font-family: sans-serif;
   }
   
   h1, h2, h3, h4, h5, h6 { text-align: left }
   /* background should be transparent, but WebTV has a bug */
   h1, h2, h3 { color: #005A9C; background: white }
   h1 { font: 170% sans-serif }
   h2 { font: 140% sans-serif }
   h3 { font: 120% sans-serif }
   h4 { font: bold 100% sans-serif }
   h5 { font: italic 100% sans-serif }
   h6 { font: small-caps 100% sans-serif }
   
   .hide { display: none }
   
   div.head { margin-bottom: 1em }
   div.head h1 { margin-top: 2em; clear: both }
   div.head table { margin-left: 2em; margin-top: 2em }
   div.head img { color: white; border: none } /* remove border from top image */
   
   p.copyright { font-size: small }
   p.copyright small { font-size: small }
   
   pre { margin-left: 2em }
   
   p {
     margin-top: 0.6em;
     margin-bottom: 0.6em;
   }
   
   dt, dd { margin-top: 0; margin-bottom: 0 } /* opera 3.50 */
   dt { font-weight: bold }
   
   pre, code { font-family: monospace } /* navigator 4 requires this */
   
   ul.toc {
     list-style: disc;             /* Mac NS has problem with 'none' */
     list-style: none;
   }
   
   code        { font-family: monospace; }
   var {font-family: monospace; font-style: normal; font-weight: bold;}
   div.constraint,
   div.issue,
   div.note,
   div.notice     { margin-left: 2em; }
   
   li p           { margin-top: 0.8em;
                    margin-bottom: 0.8em; }
   
   li {margin-top: 0.4em; margin-bottom: 0.4em;}
   
   div.exampleInner pre { margin-left: 1em;
                          margin-top: 0em; margin-bottom: 0em}
   div.exampleOuter {border: 4px double gray;
                     margin: 0em; padding: 0em}
   div.exampleInner { background-color: #d5dee3;
                      border-top-width: 4px;
                      border-top-style: double;
                      border-top-color: #d3d3d3;
                      border-bottom-width: 4px;
                      border-bottom-style: double;
                      border-bottom-color: #d3d3d3;
                      padding: 4px; margin: 0em }
   div.exampleWrapper { margin: 4px }
   div.exampleHeader { font-weight: bold;
                       margin: 4px}
   
   table { background-color: #d5dee3;
           width: 85% ;
           border-style: double;
           border-width: 4px;
           border-color: #d3d3d3;
   }
           </style>
   
 <html> <html>
   <head>   <head>
     <title>Pegasus Meta Dispatcher</title>     <title>Pegasus Meta Dispatcher</title>
   </head>   </head>
  
   <body>   <body>
   
     <h1>Pegasus Meta Dispatcher</h1>     <h1>Pegasus Meta Dispatcher</h1>
     <p>     <p>
       The Pegasus Meta Dispatcher is a set of classes that extend the       The Pegasus Meta Dispatcher is a set of classes that extend the
Line 12 
Line 110 
       asynchronous, and multithreaded. The primary classes consist of the       asynchronous, and multithreaded. The primary classes consist of the
       folowing:       folowing:
     </p>     </p>
     <table border="1" bgcolor="#cdcdc1" cellpadding="3" width="80%">          <table>
       <tr align="left"><th>Class</th><th>Derived from</th><th>Source file</th></tr>       <tr align="left"><th>Class</th><th>Derived from</th><th>Source file</th></tr>
         <tr><td>cimom</td><td>MessageQueue</td><td>Pegasus/Common/Cimom.h</td></tr>              <tr><td><div class="exampleInner">cimom</div></td><td>MessageQueue</td><td>Pegasus/Common/Cimom.h</td></tr>
         <tr><td>MessageQueueService</td><td>MessageQueue</td><td>Pegasus/Common/MessageQueueServices.h</td></tr>         <tr><td>MessageQueueService</td><td>MessageQueue</td><td>Pegasus/Common/MessageQueueServices.h</td></tr>
         <tr><td>CimomMessage</td><td>Message</td><td>Pegasus/Common/CimomMessage.h</td></tr>         <tr><td>CimomMessage</td><td>Message</td><td>Pegasus/Common/CimomMessage.h</td></tr>
         <tr><td>AsyncOpNode</td><td>n/a</td><td>Pegasus/Common/AsyncOpNode.h</td></tr>         <tr><td>AsyncOpNode</td><td>n/a</td><td>Pegasus/Common/AsyncOpNode.h</td></tr>
         <tr><td>AsyncDQueue</td><td>unlocked_dq</td><td>Pegasus/Common/DQueue.h</td></tr>         <tr><td>AsyncDQueue</td><td>unlocked_dq</td><td>Pegasus/Common/DQueue.h</td></tr>
         <tr><td>IPC classes</td><td>n/a</td><td>Pegasus/Common/IPC.h</td></tr>         <tr><td>IPC classes</td><td>n/a</td><td>Pegasus/Common/IPC.h</td></tr>
         <tr><td>Threading classes</td><td>n/a</td><td>Pegasus/Common/Thread.h</td></tr>         <tr><td>Threading classes</td><td>n/a</td><td>Pegasus/Common/Thread.h</td></tr>
   
     </table>     </table>
   
     <br>     <br>
     <br>     <br>
  
           <a href = "#non-blocking">Jump to the non-blocking message interface.</a>
   
       <h2>Purposes of Meta Dispatcher</h2>       <h2>Purposes of Meta Dispatcher</h2>
     <p>     <p>
       The Meta Dispatcher has two primary goals:        The Meta Dispatcher has three primary goals:
       <ol>       <ol>
       <li>Provide for orderly asynchronous message-based communication       <li>Provide for orderly asynchronous message-based communication
         among a dynamic set of Pegasus Services.</li>         among a dynamic set of Pegasus Services.</li>
Line 103 
Line 205 
       The Meta Dispatcher therefore acts as a central message       The Meta Dispatcher therefore acts as a central message
       hub. Services communicate with each other <i>via</i> the Meta       hub. Services communicate with each other <i>via</i> the Meta
       Dispatcher.       Dispatcher.
           <div class="exampleOuter"><div class="exampleInner">
       <pre>       <pre>
       Service A--Message----1----> (block on semaphore)       Service A--Message----1----> (block on semaphore)
                                   |                                   |
Line 119 
Line 221 
  
     </pre>     </pre>
  
             </div></div>
     The numbered steps above are as follows:     The numbered steps above are as follows:
     <ol>     <ol>
       <li><b>Service A</b> creates a new <code>AsyncMessage</code> and       <li><b>Service A</b> creates a new <code>AsyncMessage</code> and
Line 247 
Line 350 
  
 <pre> <pre>
  
    Array<Uint32> services;     Array&lt;Uint32&gt;; services;
  
    while( services.size() == 0 )    while( services.size() == 0 )
    {    {
       q_client->find_services(String("test server"), 0, 0, &services);        q_client-&gt;find_services(String("test server"), 0, 0, &services);
       pegasus_yield();       pegasus_yield();
    }    }
  
    cout << "found server at " << services[0] << endl;     cout &lt;&lt; "found server at " &lt;&lt; services[0] &lt;&lt; endl;
  
  
 </pre> </pre>
Line 525 
Line 628 
 <pre> <pre>
       _completeAsyncResponse(msg, resp, ASYNC_OPSTATE_COMPLETE, 0);       _completeAsyncResponse(msg, resp, ASYNC_OPSTATE_COMPLETE, 0);
  
   
    }    }
 </pre> </pre>
  
 </ol> </ol>
         </p>         </p>
  
   <h2>Handling CIMMessage and Other Pre-existing Message Classes</h2>
             <p>
               Existing Messages, including all of the <code>CIMMessage</code>
               derivitives, are not configured to be asynchronous
               request/reply pairs. They are designed to travel through
               Pegasus as events that trigger other processing events,
               which is the end of their lifetime. This is not an optimal
               use model for asynchronous operation because the
               originator of the event does not require nor receive any
               completion notification. Further, there is not a
               one-to-one correspondence of "event messages" to replies.
             </p>
  
     <hr>            <h3>AsyncLegacyOperationStart Message</h3>
 <h2>Class Definitions</h2>            <p>
               The AsyncLegacyOperationStart message is an envelope that
               allows a <code>MessageQueueService</code>-based service to
               send, receive, and process pre-existing "legacy"
               messages.
             </p>
             <p>
               The <code>AsyncLegacyOperationStart</code> Message allows
               an asynchronous service to create, package, and send a
               "legacy" message to another service or, indirectly,
               enqueue it to a non-asynchronous message queue. The code
               example below shows how this works:
             </p>
  
 <h3>cimom (Meta Dispatcher)</h3>  
 <pre> <pre>
 class PEGASUS_COMMON_LINKAGE cimom : public MessageQueue  
 {  
    public :  
       cimom(void);  
  
       virtual ~cimom(void) ;     cout &lt;&lt; " sending LEGACY to test server" &lt;&lt; endl;
  
       Boolean moduleChange(struct timeval last);     Message *legacy = new Message(0x11100011,
                                    Message::getNextKey());
  
       Uint32 getModuleCount(void);     AsyncLegacyOperationStart *req =
       Uint32 getModuleIDs(Uint32 *ids, Uint32 count) throw(IPCException);        new AsyncLegacyOperationStart(q_client-&gt;get_next_xid(),
                                       0,
                                       services[0],
                                       legacy,
                                       q_client-&gt;getQueueId());
      reply = q_client-&gt;SendWait(req);
      delete req;
      delete reply;
  
       AsyncOpNode *get_cached_op(void) throw(IPCException);  </pre>
       void cache_op(AsyncOpNode *op) throw(IPCException);            <p>
              The code sample above shows a <code>Message</code> object
              being embedded inside an
               <code>AsyncLegacyOperationStart</code> message and sent
               using the <code>SendWait</code>API.
             </p>
  
       void set_default_op_timeout(const struct timeval *buffer);            <h3>Default Handler for Legacy Messages</h3>
       void get_default_op_timeout(struct timeval *timeout) const ;            <p>
               The <code>MessageQueueService</code> class has a default
               handler for legacy messages that extracts the
               <code>Message</code> out of its asynchronous "envelope"
               and dispatches it using the pre-existing synchronous
               interface, as shown below.
             </p>
  
       virtual void handleEnqueue();  <pre>
       void register_module(RegisterCimService *msg);  
       void deregister_module(Uint32 quid);  
       void update_module(UpdateCimService *msg );  
       void ioctl(AsyncIoctl *msg );  
  
       void find_service_q(FindServiceQueue *msg );  void MessageQueueService::handle_AsyncLegacyOperationStart(
       void enumerate_service(EnumerateService *msg );                                                 AsyncLegacyOperationStart *req)
       Boolean route_async(AsyncOpNode *operation);  {
       void _shutdown_routed_queue(void);     // remove the legacy message from the request and enqueue it to its destination
      Uint32 result = async_results::CIM_NAK;
  
      Message *legacy = req-&gt;act;
      if ( legacy != 0 )
      {
         MessageQueue* queue = MessageQueue::lookup(req-&gt;legacy_destination);
         if( queue != 0 )
         {
           // Enqueue the response:
            queue-&gt;enqueue(legacy);
            result = async_results::OK;
         }
      }
      _make_response(req, result);
   }
  
    protected:  </pre>
       Uint32 get_module_q(const String & name);  
       void _make_response(AsyncRequest *req, Uint32 code);  
       void _completeAsyncResponse(AsyncRequest *request,  
                                   AsyncReply *reply,  
                                   Uint32 state,  
                                   Uint32 flag);  
    private:  
       struct timeval _default_op_timeout;  
       struct timeval _last_module_change;  
       DQueue&lt;message_module&gt; _modules;  
  
       DQueue&lt;AsyncOpNode&gt; _recycle;            <p>
               The default handler shown above extracts the legacy
               message and attempts to <code>enqueue</code> that message
               syncrhonously using the pre-existing interface.
             </p>
  
       AsyncDQueue&lt;AsyncOpNode&gt; _routed_ops;  <h3>Example of Custom Handler for Legacy Messages</h3>
       DQueue&lt;AsyncOpNode&gt; _internal_ops;            <p>
               By implementing the virtual
               <code>_handle_async_request</code> method,
               a service can choose to implement its own handler for
               Legacy messages, as the code below shows:
             </p>
  
       static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL _routing_proc(void *);  <ol>
  
       Thread _routing_thread;  <li><b>Implement the virtual <code>_handle_async_request</code> method.</b></li>
   <pre>
  
       static Uint32 get_xid(void);  void MessageQueueServer::_handle_async_request(AsyncRequest *req)
       void _handle_cimom_op(AsyncOpNode *op, Thread *thread, MessageQueue *queue);  {
       Uint32 _ioctl(Uint32, Uint32, void *);     if (req->getType() == 0x04100000 )
      {
         req->op->processing();
         handle_test_request(req);
      }
      else if ( req->getType() == async_messages::CIMSERVICE_STOP )
      {
         req->op->processing();
         handle_CimServiceStop(static_cast<CimServiceStop *>(req));
      }
   </pre>
   <li><b>Implement a dispatcher for <code>ASYNC_LEGACY_OP_START</code></b></li>
   <pre>
      else if ( req->getType() == async_messages::ASYNC_LEGACY_OP_START )
      {
         req->op->processing();
         handle_LegacyOpStart(static_cast<AsyncLegacyOperationStart *>(req));
      }
   
      else
         Base::_handle_async_request(req);
   }
   
   </pre>
   <li><b>Implement a dispatcher for <code>ASYNC_LEGACY_OP_START</code></b></li>
   <pre>
  
   void MessageQueueServer::handle_LegacyOpStart(AsyncLegacyOperationStart *req)
   {
  
       AtomicInt _die;     Message *legacy = req-&gt;act;
       AtomicInt _routed_queue_shutdown;     cout &lt;&lt; " ### handling legacy messages " &lt;&lt; endl;
  
       static AtomicInt _xid;  
  
 //       CIMOperationRequestDispatcher *_cim_dispatcher;        AsyncReply *resp =
 //       CIMOperationResponseEncoder *_cim_encoder;           new AsyncReply(async_messages::REPLY,
 //       CIMOperationRequestDecoder *_cim_decoder;                          req-&gt;getKey(),
 //       CIMRepository *_repository;                          req-&gt;getRouting(),
                           0,
                           req-&gt;op,
                           async_results::OK,
                           req-&gt;resp,
                           req-&gt;block);
         _completeAsyncResponse(req, resp, ASYNC_OPSTATE_COMPLETE, 0 );
  
 };        if (legacy != 0 )
            cout &lt;&lt; " legacy msg type: " &lt;&lt; legacy-&gt;getType() &lt;&lt; endl;
   
   }
  
 </pre> </pre>
  
  
 <h3>MessageQueueService</h3>  </ol>
  
 <pre>      <hr>
  
 class message_module;  
  
 class PEGASUS_COMMON_LINKAGE MessageQueueService : public MessageQueue  <a name="non-blocking"><h2>Sending Messages without Blocking (Async with Callback)</h2></a>
 {  
    public:  
  
       typedef MessageQueue Base;                <p>
                   Whenever there is a possibility that the processing of
                   one message may generate a nested message (message
                   generated within the handler of a message) it is
                   necessary to send messages without blocking, and to
                   receive responses via callback routines. The diagram
                   below shows the (more complicated) flow of
                   non-blocking messages.
                 </p>
   <br>
                 <div class="exampleOuter"><div class="exampleInner">
         <pre>
         Service A--Message----1---->
                                  |
           . <-----------(return)-+----->-(loop)--->-+
           .                      |  Meta Dispatcher |
           .                      +----<-----<---<---+
           .                                      Message---2-->Service B
           .                                                            |
           .                                        <--Response--3------+
           .                                        |
           .                        +--<--<-----<-----+--(return)---->
           .                        | Meta Dispatcher |
         Service A <--Callback--4---+--->-(loop)-->---+
                      |       ^
                      +-------+
       </pre>
                   </div></div>
  
       MessageQueueService(const char *name, Uint32 queueID, Uint32 capabilities, Uint32 mask) ;                <h3>Test Program</h3>
  
       virtual ~MessageQueueService(void);                <p>
                   There is a test program that sends and receives
                   non-blocking messages in
                   <code>$(PEGASUS_ROOT)/src/Pegasus/Common/tests/async_callback/</code>
                 </p>
  
       virtual void handle_heartbeat_request(AsyncRequest *req);                <h3>SendAsync method</h3>
       virtual void handle_heartbeat_reply(AsyncReply *rep);  
  
       virtual void handle_AsyncIoctl(AsyncIoctl *req);                <p>
       virtual void handle_CimServiceStart(CimServiceStart *req);                  The <code>MessageQueueService</code> class sends
       virtual void handle_CimServiceStop(CimServiceStop *req);                  non-blocking messages using the <code>SendAsync</code>
       virtual void handle_CimServicePause(CimServicePause *req);                  method from <code>MessageQueueService.h</code>.
       virtual void handle_CimServiceResume(CimServiceResume *req);                </p><br>
  
       virtual void handle_AsyncOperationStart(AsyncOperationStart *req);  
       virtual void handle_AsyncOperationResult(AsyncOperationResult *req);  
       virtual Boolean accept_async(AsyncOpNode *op);  
       virtual Boolean messageOK(const Message *msg) ;  
  
       AsyncReply *SendWait(AsyncRequest *request);                <div class="exampleOuter"><div class="exampleInner">
   <pre>
  
       void _completeAsyncResponse(AsyncRequest *request,  Boolean <b><font color=#000000>SendAsync</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>op<font color=#990000>,</font>
                                  AsyncReply *reply,                    Uint32 destination<font color=#990000>,</font>
                                  Uint32 state,                    <font color=#009900>void</font> <font color=#990000>(</font><font color=#990000>*</font>callback<font color=#990000>)</font><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font><font color=#990000>,</font> MessageQueue <font color=#990000>*</font><font color=#990000>,</font> <font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>,</font>
                                  Uint32 flag);                    MessageQueue <font color=#990000>*</font>callback_q<font color=#990000>,</font>
       Boolean register_service(String name, Uint32 capabilities, Uint32 mask);                    <font color=#009900>void</font> <font
       Boolean update_service(Uint32 capabilities, Uint32 mask);                                                        color=#990000>*</font>callback_ptr<font color=#990000>)</font><font color=#990000>;</font>
       Boolean deregister_service(void);                  </pre>
       virtual void _shutdown_incoming_queue(void);                  <br>
       void find_services(String name,                  <div class="note">
                          Uint32 capabilities,                    <var>AsyncOpNode *op (In)</var> is the shared data
                          Uint32 mask,                    structure that controls the message flow and
                          Array&lt;Uint32&gt; *results);                    consolidates the response data. This data structure is
       void enumerate_service(Uint32 queue, message_module *result);                    also passed to the callback function as the first
       Uint32 get_next_xid(void);                    parameter. The caller must
       AsyncOpNode *get_op(void);                    allocate and free this data structure. <br>
       void return_op(AsyncOpNode *op);                    <br>
       Uint32 _capabilities;                    <var>Uint32 destination (In)</var> is the queue ID of
       Uint32 _mask;                    the service which will receive the asynchronous
       AtomicInt _die;                    request message.</var><br>
    protected:                    <br>
                     <var>void (*callback)(AsyncOpNode *, MessageQueue *,
                       void *) (In)</var> is the static class method that
                     will be called when the request/response pair is complete.<br>
                     <br>
                     The callback is always passed <var>op</var> as the
                     first parameter. The second parameter is the
                     <var>MessageQueue *</var> object instance that is
                     executing the callback function. Because callback
                     functions must be static class methods, the callback
                     can use the <var>MessageQueue *</var> parameter as a
                     pseudo <var>this</var> pointer. <br>
                     <br>
                     <var>MessageQueue *callback_q (In)</var> is the
                     queue pointer that will be passed to the callback
                     routine as the second parameter. It also controls
                     which queue instance receives the callback.
                     <br>
                     <br>
                     <var>void *callback_ptr (In)</var> is a pointer that will
                     be passed to the callback function.
  
       virtual void _handle_incoming_operation(AsyncOpNode *operation, Thread *thread, MessageQueue *queue);                  </div>
       virtual void _handle_async_request(AsyncRequest *req);                </div></div>
       virtual void _make_response(AsyncRequest *req, Uint32 code);  
       cimom *_meta_dispatcher;  
  
    private:                <br>
       void handleEnqueue();  
       DQueue&lt;AsyncOpNode&gt; _pending;  
       AsyncDQueue&lt;AsyncOpNode&gt; _incoming;  
  
       static PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL _req_proc(void *);                <h3>How the Meta Dispatcher Processes Non-Blocking Messages</h3>
       AtomicInt _incoming_queue_shutdown;                <p>
                   The focus of processing non-blocking messages is to
                   remove the possibility of deadlock. Therefore, all
                   message processing is performed by background
                   threads. All access by services to shared data
                   structures is discrete in the sense that one service
                   never calls into another service. For example,
                   callback routines are executed by the background
                   thread of the receiving service. (As opposed to the
                   sending service making a callback <i>into</i> the
                   receiving service.)
                 </p>
  
       Thread _req_thread;                    <ol>
                       <li>The requesting service creates a request, an
                       <code>AsyncOpNode</code> and calls
                       <code>MessageQueueService::SendAsync(...)</code>.</li>
                       <li><code>SendAsync</code> marks the
                       <code>AsyncOpNode</code> as
                       <code>ASYNC_OPFLAGS_CALLBACK</code> with the
                       <code>ASYNC_OPSTATE_COMPLETE</code> bit
                       <i>clear</i>.</li> <li>The Meta Dispatcher routes
                       the <code>AsyncOpNode</code> to the responding
                       service.</li> <li>The responding service's
                       background thread pulls the message off its
                       internal queue and processes the request. This
                       will frequently entail creating and inserting a
                       response message into the <code>AsyncOpNode</code>
                       by calling
                       <code>AsyncOpNode::put_response(AsyncMessage
                       *)</code>.</li> <li>The responding service
                       completes the response by calling
                       <code>MessageQueueService::_complete_op_node(AsyncOpNode
                       *, Uint32, Uint32, Uint32)</code>.</li>
                       <li><code>_complete_op_node</code> passes the
                       operation back to the Meta Dispatcher, which
                       routes it <i>back</i> to the requesting
                       service.</li> <li>The requesting service's
                       background thread pulls the
                       <code>AsyncOpNode</code> off its internal queue
                       and calls
                       <code>AsyncOpNode::_async_callback</code>, which
                     is a function pointer that holds the address of the
                     requesting service's static callback method..</li>
                       <li>The requesting service deallocates the op
                         node, the request message, and the response message.</li>
                     </ol>
  
       struct timeval _default_op_timeout;                <h3>Virtual Methods for Non-Blocking Messages</h3>
                 <p>
                   To use non-blocking messages, a service should
                   implement the following virtual method from
                   <code>MessageQueueService</code>, plus a static class
                   callback function.
                 </p>
                 <div class="exampleOuter"><div class="exampleInner">
                     <pre>
   <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>_handle_async_request</font></b><font color=#990000>(</font>AsyncRequest <font color=#990000>*</font>req<font color=#990000>)</font><font color=#990000>;</font>
                     </pre>
                     <div class="note">
                       <var>AsyncRequest *req (In)</var> is the incoming
                       request. <code>req->op</code> is the
                       <code>AsyncOpNode</code> that is controlling this
                       operation.
                       <br><br>
                       This method is called by the service's background
                       thread whenever an <code>AsyncRequest</code>
                       message is sent to the service. <i>This includes
                         both blocking and non-blocking request messages.</i><p>
                       <p>
                         Within <code>_handle_async_request</code> you
                         can determine whether the message is blocking or
                         non-blocking by using the following code
                         segment:
   <pre><code>
  
       static AtomicInt _xid;  if(req->op->read_flags() & ASYNC_OPFLAGS_CALLBACK )
   {
  
  };     // let everyone know you are working on the request
      req->op->processing();
  
      // this request is part of a callback (non-blocking) operation
      AsyncResponse *response = new AsyncResponse(...);
  
 </pre>     // initialize the response message however is appropriate
  
 <h3>Asynchronous Messages</h3>    // put the response to the op node
     req->op->put_response(response);
  
 <pre>    // complete the operation
     _complete_op_node(req->op, 0, 0, async_results::OK);
  
 extern const Uint32 CIMOM_Q_ID;    return;
   }
   </code></pre>
                     </div>
                   </div>
                 </div>
                 <br>
  
 class AsyncOpNode;  
  
 class PEGASUS_COMMON_LINKAGE async_results  <div class="exampleOuter"><div class = "exampleInner">
 {  
    public:  
       static const Uint32 OK;  
       static const Uint32 PARAMETER_ERROR;  
       static const Uint32 MODULE_ALREADY_REGISTERED;  
       static const Uint32 MODULE_NOT_FOUND;  
       static const Uint32 INTERNAL_ERROR;  
   
       static const Uint32 ASYNC_STARTED;  
       static const Uint32 ASYNC_PROCESSING;  
       static const Uint32 ASYNC_COMPLETE;  
       static const Uint32 ASYNC_CANCELLED;  
       static const Uint32 ASYNC_PAUSED;  
       static const Uint32 ASYNC_RESUMED;  
   
       static const Uint32 CIM_SERVICE_STARTED;  
       static const Uint32 CIM_SERVICE_STOPPED;  
       static const Uint32 CIM_SERVICE_PAUSED;  
   
       static const Uint32 CIM_SERVICE_RESUMED;  
       static const Uint32 CIM_NAK;  
   
       static const Uint32 ASYNC_PHASE_COMPLETE;  
       static const Uint32 ASYNC_CHILD_COMPLETE;  
       static const Uint32 ASYNC_PHASE_STARTED;  
       static const Uint32 ASYNC_CHILD_STARTED;  
       static const Uint32 CIM_PAUSED;  
       static const Uint32 CIM_STOPPED;  
  
 };                    <pre>
  
   <b><font color=#0000FF>static</font></b> <font color=#009900>void</font> <b><font color=#000000>async_callback_function</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>op<font color=#990000>,</font> MessageQueue <font color=#990000>*</font><font color=#990000>,</font> <font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>;</font>
  
 class PEGASUS_COMMON_LINKAGE async_messages                    </pre>
 {                    <div class="note">
    public:                      <var>AsyncOpNode *op (In)</var> is the
       static const Uint32 HEARTBEAT;                      incoming shared object that is controlling this
       static const Uint32 REPLY;                      completing operation.<br>
       static const Uint32 REGISTER_CIM_SERVICE;                      <br>
       static const Uint32 DEREGISTER_CIM_SERVICE;                      <var>MessageQueue *q (In)</var> is a pointer to
       static const Uint32 UPDATE_CIM_SERVICE;                      the class that has received the complete
       static const Uint32 IOCTL;                      <var>op</var>. This parameter is meant to be used
       static const Uint32 CIMSERVICE_START;                      as a <code>this</code> pointer because the
       static const Uint32 CIMSERVICE_STOP;                      callback is a static class method.
       static const Uint32 CIMSERVICE_PAUSE;                      <br>
       static const Uint32 CIMSERVICE_RESUME;                      <br>
                       <var>void *parm (In)</var> is a pointer that the
       static const Uint32 ASYNC_OP_START;                      class passed to <code>SendAsync</code>. It can be
       static const Uint32 ASYNC_OP_RESULT;                      used as a convenience for the class.<br>
       static const Uint32 ASYNC_LEGACY_OP_START;                      <br>
       static const Uint32 ASYNC_LEGACY_OP_RESULT;  
   
       static const Uint32 FIND_SERVICE_Q;  
       static const Uint32 FIND_SERVICE_Q_RESULT;  
       static const Uint32 ENUMERATE_SERVICE;  
       static const Uint32 ENUMERATE_SERVICE_RESULT;  
 };  
  
                       This method is <i>only</i> called when a
                       non-blocking operation is complete, meaning that
                       the responding service has added a response
                       message to the <var>op</var> and set the
                       <code>ASYNC_OPSTATE_COMPLETE</code> bit. <br><br>
                       <pre>
  
 class PEGASUS_COMMON_LINKAGE AsyncMessage : public Message  void my_class::async_callback_function(AsyncOpNode *op,
                                          MessageQueue *q,
                                          void *parm)
 { {
    public:  
       AsyncMessage(Uint32 type,  
                    Uint32 key,  
                    Uint32 routing,  
                    Uint32 mask,  
                    AsyncOpNode *operation);  
  
       virtual ~AsyncMessage(void)     my_class *myself = static_cast&lt;my_class *&gt;(q);
       {     AsyncRequest *request = op-&gt;get_request();
      AsyncResponse *response = op-&gt;get_response();
  
      // process response
   
      delete request;
      delete response;
      myself-&gt;put_op(op);
      return;
       }       }
  
       Boolean operator ==(void *key);                    </div>
       Boolean operator ==(const AsyncMessage& msg);                  </div>
                 </div>
  
       AsyncOpNode *op;                <h3>Strategies for Handling Non-Blocking Responses</h3>
       Thread *_myself;                <p>
       MessageQueue *_service;                  All of the legacy message handling code in Pegasus is
 };                  syncrhonous, meaning that a service can send a request
                   and receive the response in two adjacent lines of
                   code. Non-blocking messages are different because the
                   timing and existence of a response message is
                   undetermined.
                 </p>
                 <p>
                   There are couple of possible strategies for handing
                   non-blocking response messages.
  
                   <ol>
                     <li>Seperate the request creation and sending code
                     from the response handling code into distinct methods.</li>
                   <li>Handle request creation and sending and response
                     handling in the same method using different code blocks.
                   </ol>
                 </p>
   
                 <h4>Separate Request and Response Handling Methods</h4>
                 <div class="exampleOuter">
                   <div class="exampleInner">
                     <ol>
                       <li>Write the request generation method.
                     <pre>
  
 inline Boolean AsyncMessage::operator ==(void *key)   void my_class::generate_request(Uint32 destination)
 { {
    if( key == reinterpret_cast&lt;void *&gt;(this))     AsyncOpNode *op = get_op();
       return true;     my_request *req = new my_request(...);
    return false;     op-&gt;put_request(req);
   
      SendAsync(op, destination, my_callback, this, (void *)0);
      return;
 } }
                         </pre>
                         </li>
                       <li> Write the request handling method.
                         <pre>
  
 inline Boolean AsyncMessage::operator ==(const AsyncMessage& msg)  void my_class::handle_response(AsyncOpNode *op)
   {
      my_response *res = op-&gt;get_response();
      if(res != 0 )
 { {
    return this-&gt;operator==(reinterpret_cast&lt;void *&gt;(const_cast&lt;AsyncMessage *&gt;(&msg)));        // handle response
         delete response;
 } }
      put_op(op);
      return;
   }
                         </pre>
                       </li>
                       <li> Have your callback method call your response
                         method.
                         <pre>
  
   void my_class:my_callback(AsyncOpNode *op, MessageQueue *queue, void *parm)
 class PEGASUS_COMMON_LINKAGE AsyncRequest : public AsyncMessage  
 { {
    public:     my_class *myself = static_cast&lt;queue&gt;
       AsyncRequest(Uint32 type,  
                    Uint32 key,  
                    Uint32 routing,  
                    Uint32 mask,  
                    AsyncOpNode *operation,  
                    Uint32 destination,  
                    Uint32 response,  
                    Boolean blocking);  
  
      myself-&gt;handle_response(op);
      return;
   }
                         </pre>
                       </li>
                     </ol>
                   </div>
                 </div>
  
       virtual ~AsyncRequest(void)  
       {  
  
       }                <h4>Singe Request and Response Handling Method</h4>
                 <p>
                   This strategy requires two separate code blocks within
                   the request/response method, and conditional execution
                   depending on the status of the operation.
                 </p>
                 <p>
                   I think the advantage of this strategy is that it
                   matches more closely the current<br>
                   <code>handleEnqueue(Message *msg)</code> code
                   convention that is in Pegasus.
                 </p>
  
       Uint32 dest;                <div class="exampleOuter">
       Uint32 resp;                  <div class="exampleInner">
       Boolean block;                    <ol>
 };                      <li>Write the request generation block.
                     <pre>
  
 class PEGASUS_COMMON_LINKAGE AsyncReply : public AsyncMessage   void my_class::handle_operation(AsyncOpNode *op)
 { {
    public:     if(op == NULL)
       AsyncReply(Uint32 type,     {
                  Uint32 key,        AsyncOpNode *op = get_op();
                  Uint32 routing,        my_request *req = new my_request(...);
                  Uint32 mask,        op-&gt;put_request(req);
                  AsyncOpNode *operation,  
                  Uint32 result_code,  
                  Uint32 destination,  
                  Boolean blocking);  
  
         SendAsync(op, destination, my_callback, this, (void *)0);
  
       virtual ~AsyncReply(void)     }
      else
       {       {
          if(op != 0 )  
             delete op;  
  
       }       }
      return;
   }
                         </pre>
                         </li>
                       <li> Write the request handling block.
                         <pre>
  
       Uint32 result;   void my_class::handle_operation(AsyncOpNode *op)
       Uint32 dest;  {
       Boolean block;     if(op == NULL)
 };     {
         AsyncOpNode *op = get_op();
         my_request *req = new my_request(...);
         op-&gt;put_request(req);
  
         SendAsync(op, destination, my_callback, this, (void *)0);
  
 class PEGASUS_COMMON_LINKAGE RegisterCimService : public AsyncRequest     }
      else
 { {
    public:        my_response *res = op-&gt;get_response();
       RegisterCimService(Uint32 routing,        if(res != 0 )
                          AsyncOpNode *operation,  
                          Boolean blocking,  
                          String service_name,  
                          Uint32 service_capabilities,  
                          Uint32 service_mask,  
                          Uint32 service_queue);  
   
       virtual ~RegisterCimService(void)  
       {       {
            // handle response
            delete response;
         }
         put_op(op);
      }
      return;
       }       }
  
       String name;                        </pre>
       Uint32 capabilities;                      </li>
       Uint32 mask;                      <li> Have your callback method call your handler
       Uint32 queue;                        method.
 };                        <pre>
  
 class PEGASUS_COMMON_LINKAGE DeRegisterCimService : public AsyncRequest  void my_class:my_callback(AsyncOpNode *op, MessageQueue *queue, void *parm)
 { {
    public:     my_class *myself = static_cast&lt;queue&gt;
       DeRegisterCimService(Uint32 routing,  
                            AsyncOpNode *operation,     myself-&gt;handle_operation(op);
                            Boolean blocking,     return;
                            Uint32 service_queue);  }
                         </pre>
                       </li>
                     </ol>
                   </div>
                 </div>
  
   <hr><hr>
  
       virtual ~DeRegisterCimService(void)  <h2>Class Definitions</h2>
       {  
  
       }  <h3>cimom (Meta Dispatcher)</h3>
  
       Uint32 queue;  <pre>
 } ;  <tt>
   <i><font color=#9A1900>//%///-*-c++-*-/////////////////////////////////////////////////////////////////</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,</font></i>
   <i><font color=#9A1900>// The Open Group, Tivoli Systems</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Permission is hereby granted, free of charge, to any person obtaining a copy</font></i>
   <i><font color=#9A1900>// of this software and associated documentation files (the "Software"), to </font></i>
   <i><font color=#9A1900>// deal in the Software without restriction, including without limitation the </font></i>
   <i><font color=#9A1900>// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or </font></i>
   <i><font color=#9A1900>// sell copies of the Software, and to permit persons to whom the Software is</font></i>
   <i><font color=#9A1900>// furnished to do so, subject to the following conditions:</font></i>
   <i><font color=#9A1900>// </font></i>
   <i><font color=#9A1900>// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN </font></i>
   <i><font color=#9A1900>// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED</font></i>
   <i><font color=#9A1900>// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT</font></i>
   <i><font color=#9A1900>// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR </font></i>
   <i><font color=#9A1900>// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT </font></i>
   <i><font color=#9A1900>// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN </font></i>
   <i><font color=#9A1900>// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</font></i>
   <i><font color=#9A1900>// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>//==============================================================================</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Author: Mike Day (mdday@us.ibm.com</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Modified By: </font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>//%/////////////////////////////////////////////////////////////////////////////</font></i>
   
   <b><font color=#000080>#ifndef</font></b> CIMOM_include
   <b><font color=#000080>#define</font></b> CIMOM_include
   
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Config.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Exception.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/MessageQueue.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/DQueue.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Thread.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Array.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/AsyncOpNode.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/CimomMessage.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/MessageQueueService.h&gt;</font>
   
   PEGASUS_NAMESPACE_BEGIN
   
   <b><font color=#0000FF>extern</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIMOM_Q_ID<font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE module_capabilities
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#0000FF>static</font></b> Uint32 async<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> Uint32 remote<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> Uint32 trusted<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> Uint32 paused<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> Uint32 stopped<font color=#990000>;</font>
   <font color=#FF0000>}</font> <font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE cimom<font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE message_module
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>message_module</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
            <font color=#990000>:</font> <b><font color=#000000>_name</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>,</font> <b><font color=#000000>_capabilities</font></b><font color=#990000>(</font><font color=#993399>0</font><font color=#990000>)</font><font color=#990000>,</font>
              <b><font color=#000000>_mask</font></b><font color=#990000>(</font><font color=#993399>0</font><font color=#990000>)</font><font color=#990000>,</font> <b><font color=#000000>_q_id</font></b><font color=#990000>(</font><font color=#993399>0</font><font color=#990000>)</font> <font color=#FF0000>{</font> <font color=#FF0000>}</font>
   
         <b><font color=#000000>message_module</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> String <font color=#990000>&amp;</font> name<font color=#990000>,</font>
                        Uint32 capabilities<font color=#990000>,</font>
                        Uint32 mask<font color=#990000>,</font>
                        Uint32 queue<font color=#990000>)</font>
            <font color=#990000>:</font> <b><font color=#000000>_name</font></b><font color=#990000>(</font>name<font color=#990000>)</font><font color=#990000>,</font> <b><font color=#000000>_capabilities</font></b><font color=#990000>(</font>capabilities<font color=#990000>)</font><font color=#990000>,</font>
              <b><font color=#000000>_mask</font></b><font color=#990000>(</font>mask<font color=#990000>)</font><font color=#990000>,</font> <b><font color=#000000>_q_id</font></b><font color=#990000>(</font>queue<font color=#990000>)</font>  <font color=#FF0000>{</font> <font color=#FF0000>}</font>
   
         Boolean <b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>(</font><b><font color=#0000FF>const</font></b> message_module <font color=#990000>*</font>mm<font color=#990000>)</font> <b><font color=#0000FF>const</font></b><font color=#990000>;</font>
         Boolean <b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>(</font><b><font color=#0000FF>const</font></b> String <font color=#990000>&amp;</font> name <font color=#990000>)</font> <b><font color=#0000FF>const</font></b> <font color=#990000>;</font>
         Boolean <b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>(</font><b><font color=#0000FF>const</font></b> message_module <font color=#990000>&amp;</font> mm <font color=#990000>)</font> <b><font color=#0000FF>const</font></b> <font color=#990000>;</font>
         Boolean <b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>(</font><b><font color=#0000FF>const</font></b> <font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font> <b><font color=#0000FF>const</font></b><font color=#990000>;</font>
         Boolean <b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>(</font>Uint32<font color=#990000>)</font> <b><font color=#0000FF>const</font></b><font color=#990000>;</font>
   
         <b><font color=#0000FF>const</font></b> String <font color=#990000>&amp;</font> <b><font color=#000000>get_name</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <b><font color=#0000FF>const</font></b> <font color=#990000>;</font>
         Uint32 <b><font color=#000000>get_capabilities</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <b><font color=#0000FF>const</font></b> <font color=#990000>;</font>
         Uint32 <b><font color=#000000>get_mask</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <b><font color=#0000FF>const</font></b> <font color=#990000>;</font>
         Uint32 <b><font color=#000000>get_queue</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <b><font color=#0000FF>const</font></b> <font color=#990000>;</font>
   
         <font color=#009900>void</font> <b><font color=#000000>put_name</font></b><font color=#990000>(</font>String <font color=#990000>&amp;</font> name<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>put_capabilities</font></b><font color=#990000>(</font>Uint32 capabilities<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>put_mask</font></b><font color=#990000>(</font>Uint32 mask<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>put_queue</font></b><font color=#990000>(</font>Uint32 queue<font color=#990000>)</font> <font color=#990000>;</font>
   
      <b><font color=#0000FF>private</font></b><font color=#990000>:</font>
         String _name<font color=#990000>;</font>
         Uint32 _capabilities<font color=#990000>;</font>
         Uint32 _mask<font color=#990000>;</font>
         <b><font color=#0000FF>struct</font></b> timeval _heartbeat<font color=#990000>;</font>
   
   
         Uint32 _q_id<font color=#990000>;</font>
         <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> cimom<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> MessageQueueService<font color=#990000>;</font>
   
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE cimom <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> MessageQueue
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b> <font color=#990000>:</font>
         <b><font color=#000000>cimom</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>cimom</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <font color=#990000>;</font>
   
         Boolean <b><font color=#000000>moduleChange</font></b><font color=#990000>(</font><b><font color=#0000FF>struct</font></b> timeval last<font color=#990000>)</font><font color=#990000>;</font>
   
         Uint32 <b><font color=#000000>getModuleCount</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
         Uint32 <b><font color=#000000>getModuleIDs</font></b><font color=#990000>(</font>Uint32 <font color=#990000>*</font>ids<font color=#990000>,</font> Uint32 count<font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
   
         AsyncOpNode <font color=#990000>*</font><b><font color=#000000>get_cached_op</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>cache_op</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>op<font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
   
         <font color=#009900>void</font> <b><font color=#000000>set_default_op_timeout</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> <b><font color=#0000FF>struct</font></b> timeval <font color=#990000>*</font>buffer<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>get_default_op_timeout</font></b><font color=#990000>(</font><b><font color=#0000FF>struct</font></b> timeval <font color=#990000>*</font>timeout<font color=#990000>)</font> <b><font color=#0000FF>const</font></b> <font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handleEnqueue</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>register_module</font></b><font color=#990000>(</font>RegisterCimService <font color=#990000>*</font>msg<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>deregister_module</font></b><font color=#990000>(</font>Uint32 quid<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>update_module</font></b><font color=#990000>(</font>UpdateCimService <font color=#990000>*</font>msg <font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>ioctl</font></b><font color=#990000>(</font>AsyncIoctl <font color=#990000>*</font>msg <font color=#990000>)</font><font color=#990000>;</font>
   
         <font color=#009900>void</font> <b><font color=#000000>find_service_q</font></b><font color=#990000>(</font>FindServiceQueue <font color=#990000>*</font>msg <font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>enumerate_service</font></b><font color=#990000>(</font>EnumerateService <font color=#990000>*</font>msg <font color=#990000>)</font><font color=#990000>;</font>
         Boolean <b><font color=#000000>route_async</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>_shutdown_routed_queue</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
   
   
      <b><font color=#0000FF>protected</font></b><font color=#990000>:</font>
         Uint32 <b><font color=#000000>get_module_q</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> String <font color=#990000>&amp;</font> name<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <font color=#009900>void</font> <b><font color=#000000>_make_response</font></b><font color=#990000>(</font>Message <font color=#990000>*</font>req<font color=#990000>,</font> Uint32 code<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <font color=#009900>void</font> <b><font color=#000000>_completeAsyncResponse</font></b><font color=#990000>(</font>AsyncRequest <font color=#990000>*</font>request<font color=#990000>,</font>
                                     AsyncReply <font color=#990000>*</font>reply<font color=#990000>,</font>
                                     Uint32 state<font color=#990000>,</font>
                                     Uint32 flag<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <font color=#009900>void</font> <b><font color=#000000>_complete_op_node</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>op<font color=#990000>,</font> Uint32 state<font color=#990000>,</font> Uint32 flag<font color=#990000>,</font> Uint32 code<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <font color=#009900>void</font> <b><font color=#000000>_default_callback</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font><font color=#990000>,</font> MessageQueue <font color=#990000>*</font><font color=#990000>,</font> <font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>;</font>
   
      <b><font color=#0000FF>private</font></b><font color=#990000>:</font>
         <b><font color=#0000FF>struct</font></b> timeval _default_op_timeout<font color=#990000>;</font>
         <b><font color=#0000FF>struct</font></b> timeval _last_module_change<font color=#990000>;</font>
         DQueue<font color=#FF0000>&lt;message_module&gt;</font> _modules<font color=#990000>;</font>
   
         DQueue<font color=#FF0000>&lt;AsyncOpNode&gt;</font> _recycle<font color=#990000>;</font>
   
         AsyncDQueue<font color=#FF0000>&lt;AsyncOpNode&gt;</font> _routed_ops<font color=#990000>;</font>
         DQueue<font color=#FF0000>&lt;AsyncOpNode&gt;</font> _internal_ops<font color=#990000>;</font>
   
         <b><font color=#0000FF>static</font></b> PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL <b><font color=#000000>_routing_proc</font></b><font color=#990000>(</font><font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>;</font>
   
         Thread _routing_thread<font color=#990000>;</font>
   
         <b><font color=#0000FF>static</font></b> Uint32 <b><font color=#000000>get_xid</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>_handle_cimom_op</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>op<font color=#990000>,</font> Thread <font color=#990000>*</font>thread<font color=#990000>,</font> MessageQueue <font color=#990000>*</font>queue<font color=#990000>)</font><font color=#990000>;</font>
         Uint32 <b><font color=#000000>_ioctl</font></b><font color=#990000>(</font>Uint32<font color=#990000>,</font> Uint32<font color=#990000>,</font> <font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>;</font>
   
   
         AtomicInt _die<font color=#990000>;</font>
         AtomicInt _routed_queue_shutdown<font color=#990000>;</font>
   
         <b><font color=#0000FF>static</font></b> AtomicInt _xid<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> cimom <font color=#990000>*</font>_global_this<font color=#990000>;</font>
  
 class PEGASUS_COMMON_LINKAGE UpdateCimService : public AsyncRequest        <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> MessageQueueService<font color=#990000>;</font>
 {  
    public:  
       UpdateCimService(Uint32 routing,  
                        AsyncOpNode *operation,  
                        Boolean blocking,  
                        Uint32 service_queue,  
                        Uint32 service_capabilities,  
                        Uint32 service_mask);  
  
       virtual ~UpdateCimService(void)  <font color=#FF0000>}</font><font color=#990000>;</font>
       {  
  
       }  PEGASUS_NAMESPACE_END
  
       Uint32 queue;  <b><font color=#000080>#endif</font></b> <i><font color=#9A1900>// CIMOM_include</font></i>
       Uint32 capabilities;  </tt>
       Uint32 mask;  </pre>
 };  
  
   <h3>MessageQueueService</h3>
  
 class PEGASUS_COMMON_LINKAGE AsyncIoctl : public AsyncRequest  <pre>
 {  <tt>
    public:  <i><font color=#9A1900>//%////-*-c++-*-////////////////////////////////////////////////////////////////</font></i>
       AsyncIoctl(Uint32 routing,  <i><font color=#9A1900>//</font></i>
                  AsyncOpNode *operation,  <i><font color=#9A1900>// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM</font></i>
                  Uint32 destination,  <i><font color=#9A1900>//</font></i>
                  Uint32 response,  <i><font color=#9A1900>// Permission is hereby granted, free of charge, to any person obtaining a copy</font></i>
                  Boolean blocking,  <i><font color=#9A1900>// of this software and associated documentation files (the "Software"), to</font></i>
                  Uint32 code,  <i><font color=#9A1900>// deal in the Software without restriction, including without limitation the</font></i>
                  Uint32 int_param,  <i><font color=#9A1900>// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or</font></i>
                  void *p_param);  <i><font color=#9A1900>// sell copies of the Software, and to permit persons to whom the Software is</font></i>
   <i><font color=#9A1900>// furnished to do so, subject to the following conditions:</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN</font></i>
   <i><font color=#9A1900>// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED</font></i>
   <i><font color=#9A1900>// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT</font></i>
   <i><font color=#9A1900>// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR</font></i>
   <i><font color=#9A1900>// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT</font></i>
   <i><font color=#9A1900>// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN</font></i>
   <i><font color=#9A1900>// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</font></i>
   <i><font color=#9A1900>// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>//==============================================================================</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Author: Mike Day (mdday@us.ibm.com)</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Modified By:</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>//%/////////////////////////////////////////////////////////////////////////////</font></i>
   
   <b><font color=#000080>#ifndef</font></b> Pegasus_MessageQueue_Service_h
   <b><font color=#000080>#define</font></b> Pegasus_MessageQueue_Service_h
   
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Config.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Message.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Exception.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/IPC.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Thread.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/AsyncOpNode.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Cimom.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/CimomMessage.h&gt;</font>
   
   PEGASUS_NAMESPACE_BEGIN
   
   <b><font color=#0000FF>extern</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIMOM_Q_ID<font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> message_module<font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE MessageQueueService <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> MessageQueue
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
   
         <b><font color=#0000FF>typedef</font></b> MessageQueue Base<font color=#990000>;</font>
   
         <b><font color=#000000>MessageQueueService</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> <font color=#009900>char</font> <font color=#990000>*</font>name<font color=#990000>,</font> Uint32 queueID<font color=#990000>,</font>
                             Uint32 capabilities <font color=#990000>=</font> <font color=#993399>0</font><font color=#990000>,</font>
                             Uint32 mask <font color=#990000>=</font> message_mask<font color=#990000>:</font><font color=#990000>:</font>type_cimom <font color=#990000>|</font>
                             message_mask<font color=#990000>:</font><font color=#990000>:</font>type_service <font color=#990000>|</font>
                             message_mask<font color=#990000>:</font><font color=#990000>:</font>ha_request <font color=#990000>|</font>
                             message_mask<font color=#990000>:</font><font color=#990000>:</font>ha_reply <font color=#990000>|</font>
                             message_mask<font color=#990000>:</font><font color=#990000>:</font>ha_async <font color=#990000>)</font> <font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>MessageQueueService</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> Boolean <b><font color=#000000>isAsync</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <font color=#FF0000>{</font>  <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>true</font></b><font color=#990000>;</font>  <font color=#FF0000>}</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>enqueue</font></b><font color=#990000>(</font>Message <font color=#990000>*</font><font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
   
         AsyncReply <font color=#990000>*</font><b><font color=#000000>SendWait</font></b><font color=#990000>(</font>AsyncRequest <font color=#990000>*</font>request<font color=#990000>)</font><font color=#990000>;</font>
         Boolean <b><font color=#000000>SendAsync</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>op<font color=#990000>,</font>
                           Uint32 destination<font color=#990000>,</font>
                           <font color=#009900>void</font> <font color=#990000>(</font><font color=#990000>*</font>callback<font color=#990000>)</font><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font><font color=#990000>,</font> MessageQueue <font color=#990000>*</font><font color=#990000>,</font> <font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>,</font>
                           MessageQueue <font color=#990000>*</font>callback_q<font color=#990000>,</font>
                           <font color=#009900>void</font> <font color=#990000>*</font>callback_ptr<font color=#990000>)</font><font color=#990000>;</font>
         Boolean  <b><font color=#000000>SendForget</font></b><font color=#990000>(</font>Message <font color=#990000>*</font>msg<font color=#990000>)</font><font color=#990000>;</font>
         Boolean <b><font color=#000000>ForwardOp</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font><font color=#990000>,</font> Uint32 destination<font color=#990000>)</font><font color=#990000>;</font>
   
   
         Boolean <b><font color=#000000>register_service</font></b><font color=#990000>(</font>String name<font color=#990000>,</font> Uint32 capabilities<font color=#990000>,</font> Uint32 mask<font color=#990000>)</font><font color=#990000>;</font>
         Boolean <b><font color=#000000>update_service</font></b><font color=#990000>(</font>Uint32 capabilities<font color=#990000>,</font> Uint32 mask<font color=#990000>)</font><font color=#990000>;</font>
         Boolean <b><font color=#000000>deregister_service</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>_shutdown_incoming_queue</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
   
         <font color=#009900>void</font> <b><font color=#000000>find_services</font></b><font color=#990000>(</font>String name<font color=#990000>,</font>
                            Uint32 capabilities<font color=#990000>,</font>
                            Uint32 mask<font color=#990000>,</font>
                            Array<font color=#FF0000>&lt;Uint32&gt;</font> <font color=#990000>*</font>results<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>enumerate_service</font></b><font color=#990000>(</font>Uint32 queue<font color=#990000>,</font> message_module <font color=#990000>*</font>result<font color=#990000>)</font><font color=#990000>;</font>
         Uint32 <b><font color=#000000>get_next_xid</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
         AsyncOpNode <font color=#990000>*</font><b><font color=#000000>get_op</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>return_op</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>op<font color=#990000>)</font><font color=#990000>;</font>
   
         Uint32 _mask<font color=#990000>;</font>
         AtomicInt _die<font color=#990000>;</font>
      <b><font color=#0000FF>protected</font></b><font color=#990000>:</font>
         <b><font color=#0000FF>virtual</font></b> Boolean <b><font color=#000000>accept_async</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>op<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> Boolean <b><font color=#000000>messageOK</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> Message <font color=#990000>*</font>msg<font color=#990000>)</font> <font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handleEnqueue</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <font color=#990000>=</font> <font color=#993399>0</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handleEnqueue</font></b><font color=#990000>(</font>Message <font color=#990000>*</font><font color=#990000>)</font> <font color=#990000>=</font> <font color=#993399>0</font><font color=#990000>;</font>
         Boolean <b><font color=#000000>_enqueueResponse</font></b><font color=#990000>(</font>Message <font color=#990000>*</font><font color=#990000>,</font> Message <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>_handle_incoming_operation</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>_handle_async_request</font></b><font color=#990000>(</font>AsyncRequest <font color=#990000>*</font>req<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>_handle_async_callback</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>_make_response</font></b><font color=#990000>(</font>Message <font color=#990000>*</font>req<font color=#990000>,</font> Uint32 code<font color=#990000>)</font><font color=#990000>;</font>
   
   
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_heartbeat_request</font></b><font color=#990000>(</font>AsyncRequest <font color=#990000>*</font>req<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_heartbeat_reply</font></b><font color=#990000>(</font>AsyncReply <font color=#990000>*</font>rep<font color=#990000>)</font><font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_AsyncIoctl</font></b><font color=#990000>(</font>AsyncIoctl <font color=#990000>*</font>req<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_CimServiceStart</font></b><font color=#990000>(</font>CimServiceStart <font color=#990000>*</font>req<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_CimServiceStop</font></b><font color=#990000>(</font>CimServiceStop <font color=#990000>*</font>req<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_CimServicePause</font></b><font color=#990000>(</font>CimServicePause <font color=#990000>*</font>req<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_CimServiceResume</font></b><font color=#990000>(</font>CimServiceResume <font color=#990000>*</font>req<font color=#990000>)</font><font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_AsyncOperationStart</font></b><font color=#990000>(</font>AsyncOperationStart <font color=#990000>*</font>req<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_AsyncOperationResult</font></b><font color=#990000>(</font>AsyncOperationResult <font color=#990000>*</font>rep<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_AsyncLegacyOperationStart</font></b><font color=#990000>(</font>AsyncLegacyOperationStart <font color=#990000>*</font>req<font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>virtual</font></b> <font color=#009900>void</font> <b><font color=#000000>handle_AsyncLegacyOperationResult</font></b><font color=#990000>(</font>AsyncLegacyOperationResult <font color=#990000>*</font>rep<font color=#990000>)</font><font color=#990000>;</font>
   
         <font color=#009900>void</font> <b><font color=#000000>_completeAsyncResponse</font></b><font color=#990000>(</font>AsyncRequest <font color=#990000>*</font>request<font color=#990000>,</font>
                                    AsyncReply <font color=#990000>*</font>reply<font color=#990000>,</font>
                                    Uint32 state<font color=#990000>,</font>
                                    Uint32 flag<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>_complete_op_node</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font><font color=#990000>,</font> Uint32<font color=#990000>,</font> Uint32<font color=#990000>,</font> Uint32<font color=#990000>)</font><font color=#990000>;</font>
   
   
         <b><font color=#0000FF>static</font></b> cimom <font color=#990000>*</font>_meta_dispatcher<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> AtomicInt _service_count<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> Mutex _meta_dispatcher_mutex<font color=#990000>;</font>
   
      <b><font color=#0000FF>private</font></b><font color=#990000>:</font>
   
         DQueue<font color=#FF0000>&lt;AsyncOpNode&gt;</font> _pending<font color=#990000>;</font>
         AsyncDQueue<font color=#FF0000>&lt;AsyncOpNode&gt;</font> _incoming<font color=#990000>;</font>
         AsyncDQueue<font color=#FF0000>&lt;AsyncOpNode&gt;</font> _callback<font color=#990000>;</font>
   
         <b><font color=#0000FF>static</font></b> PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL <b><font color=#000000>_req_proc</font></b><font color=#990000>(</font><font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <font color=#009900>void</font> <b><font color=#000000>_sendwait_callback</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font><font color=#990000>,</font> MessageQueue <font color=#990000>*</font><font color=#990000>,</font> <font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>;</font>
         AtomicInt _incoming_queue_shutdown<font color=#990000>;</font>
         Thread _req_thread<font color=#990000>;</font>
         <b><font color=#0000FF>struct</font></b> timeval _default_op_timeout<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> AtomicInt _xid<font color=#990000>;</font>
         <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> cimom<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
  
       virtual ~AsyncIoctl(void)  PEGASUS_NAMESPACE_END
       {  
  
       }  <b><font color=#000080>#endif</font></b> <i><font color=#9A1900>/* Pegasus_MessageQueue_Service_h */</font></i>
   </tt>
   </pre>
  
       enum  <h3>Asynchronous Messages</h3>
       {  
          IO_CLOSE,  <pre>
          IO_OPEN,  <tt>
          IO_SOURCE_QUENCH,  <i><font color=#9A1900>//%///-*-c++-*-/////////////////////////////////////////////////////////////////</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,</font></i>
   <i><font color=#9A1900>// The Open Group, Tivoli Systems</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Permission is hereby granted, free of charge, to any person obtaining a copy</font></i>
   <i><font color=#9A1900>// of this software and associated documentation files (the "Software"), to</font></i>
   <i><font color=#9A1900>// deal in the Software without restriction, including without limitation the</font></i>
   <i><font color=#9A1900>// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or</font></i>
   <i><font color=#9A1900>// sell copies of the Software, and to permit persons to whom the Software is</font></i>
   <i><font color=#9A1900>// furnished to do so, subject to the following conditions:</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN</font></i>
   <i><font color=#9A1900>// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED</font></i>
   <i><font color=#9A1900>// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT</font></i>
   <i><font color=#9A1900>// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR</font></i>
   <i><font color=#9A1900>// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT</font></i>
   <i><font color=#9A1900>// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN</font></i>
   <i><font color=#9A1900>// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</font></i>
   <i><font color=#9A1900>// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>//==============================================================================</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Author: Mike Day (mdday@us.ibm.com)</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Modified By:</font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>//%/////////////////////////////////////////////////////////////////////////////</font></i>
   
   <b><font color=#000080>#ifndef</font></b> Pegasus_CimomMessage_h
   <b><font color=#000080>#define</font></b> Pegasus_CimomMessage_h
   
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Config.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Exception.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/MessageQueue.h&gt;</font>
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/AsyncOpNode.h&gt;</font>
   
   PEGASUS_NAMESPACE_BEGIN
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// This identifier is the queue id for CIMOM queue. It is initialized in</font></i>
   <i><font color=#9A1900>// CimomMessage.cpp by calling MessageQueue::getNextQueueId(). Note that</font></i>
   <i><font color=#9A1900>// this value is passed in the constructor for the CIMOM queue.</font></i>
   <i><font color=#9A1900>//</font></i>
   <b><font color=#0000FF>extern</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIMOM_Q_ID<font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> AsyncOpNode<font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE async_results
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 OK<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 PARAMETER_ERROR<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 MODULE_ALREADY_REGISTERED<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 MODULE_NOT_FOUND<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 INTERNAL_ERROR<font color=#990000>;</font>
   
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_STARTED<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_PROCESSING<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_COMPLETE<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_CANCELLED<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_PAUSED<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_RESUMED<font color=#990000>;</font>
   
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIM_SERVICE_STARTED<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIM_SERVICE_STOPPED<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIM_SERVICE_PAUSED<font color=#990000>;</font>
   
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIM_SERVICE_RESUMED<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIM_NAK<font color=#990000>;</font>
   
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_PHASE_COMPLETE<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_CHILD_COMPLETE<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_PHASE_STARTED<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_CHILD_STARTED<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIM_PAUSED<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIM_STOPPED<font color=#990000>;</font>
   
   <font color=#FF0000>}</font><font color=#990000>;</font>
   
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE async_messages
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 HEARTBEAT<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 REPLY<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 REGISTER_CIM_SERVICE<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 DEREGISTER_CIM_SERVICE<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 UPDATE_CIM_SERVICE<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 IOCTL<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIMSERVICE_START<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIMSERVICE_STOP<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIMSERVICE_PAUSE<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 CIMSERVICE_RESUME<font color=#990000>;</font>
   
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_OP_START<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_OP_RESULT<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_LEGACY_OP_START<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ASYNC_LEGACY_OP_RESULT<font color=#990000>;</font>
   
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 FIND_SERVICE_Q<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 FIND_SERVICE_Q_RESULT<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ENUMERATE_SERVICE<font color=#990000>;</font>
         <b><font color=#0000FF>static</font></b> <b><font color=#0000FF>const</font></b> Uint32 ENUMERATE_SERVICE_RESULT<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
   
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE AsyncMessage <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> Message
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>AsyncMessage</font></b><font color=#990000>(</font>Uint32 type<font color=#990000>,</font>
                      Uint32 destination<font color=#990000>,</font>
                      Uint32 key<font color=#990000>,</font>
                      Uint32 routing<font color=#990000>,</font>
                      Uint32 mask<font color=#990000>,</font>
                      AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>)</font><font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>AsyncMessage</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
   
         <font color=#FF0000>}</font>
   
         Boolean <b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font><font color=#990000>(</font><b><font color=#0000FF>const</font></b> <font color=#009900>void</font> <font color=#990000>*</font>key<font color=#990000>)</font><font color=#990000>;</font>
         Boolean <b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font><font color=#990000>(</font><b><font color=#0000FF>const</font></b> AsyncMessage<font color=#990000>&amp;</font> msg<font color=#990000>)</font><font color=#990000>;</font>
   
         AsyncOpNode <font color=#990000>*</font>op<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
   
   
   <b><font color=#0000FF>inline</font></b> Boolean AsyncMessage<font color=#990000>:</font><font color=#990000>:</font><b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font><font color=#990000>(</font><b><font color=#0000FF>const</font></b> <font color=#009900>void</font> <font color=#990000>*</font>key<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font> key <font color=#990000>=</font><font color=#990000>=</font> <b><font color=#0000FF>reinterpret_cast</font></b><font color=#990000>&lt;</font><font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>&gt;</font><font color=#990000>(</font><b><font color=#0000FF>this</font></b><font color=#990000>)</font><font color=#990000>)</font>
         <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>true</font></b><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>false</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> Boolean AsyncMessage<font color=#990000>:</font><font color=#990000>:</font><b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font><font color=#990000>(</font><b><font color=#0000FF>const</font></b> AsyncMessage<font color=#990000>&amp;</font> msg<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>this</font></b><font color=#990000>-</font><font color=#990000>&gt;</font><b><font color=#0000FF>operator</font></b><font color=#990000>=</font><font color=#990000>=</font><font color=#990000>(</font><b><font color=#0000FF>reinterpret_cast</font></b><font color=#990000>&lt;</font><font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>&gt;</font><font color=#990000>(</font><b><font color=#0000FF>const_cast</font></b><font color=#990000>&lt;</font>AsyncMessage <font color=#990000>*</font><font color=#990000>&gt;</font><font color=#990000>(</font><font color=#990000>&amp;</font>msg<font color=#990000>)</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE AsyncRequest <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncMessage
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>AsyncRequest</font></b><font color=#990000>(</font>Uint32 type<font color=#990000>,</font>
                      Uint32 key<font color=#990000>,</font>
                      Uint32 routing<font color=#990000>,</font>
                      Uint32 mask<font color=#990000>,</font>
                      AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                      Uint32 destination<font color=#990000>,</font>
                      Uint32 response<font color=#990000>,</font>
                      Boolean blocking<font color=#990000>)</font><font color=#990000>;</font>
   
   
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>AsyncRequest</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
   
         <font color=#FF0000>}</font>
   
         Uint32 resp<font color=#990000>;</font>
         Boolean block<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE AsyncReply <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncMessage
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>AsyncReply</font></b><font color=#990000>(</font>Uint32 type<font color=#990000>,</font>
                    Uint32 key<font color=#990000>,</font>
                    Uint32 routing<font color=#990000>,</font>
                    Uint32 mask<font color=#990000>,</font>
                    AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                    Uint32 result_code<font color=#990000>,</font>
                    Uint32 destination<font color=#990000>,</font>
                    Boolean blocking<font color=#990000>)</font><font color=#990000>;</font>
   
   
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>AsyncReply</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
   
         <font color=#FF0000>}</font>
   
         Uint32 result<font color=#990000>;</font>
         Boolean block<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
   
   
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE RegisterCimService <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>RegisterCimService</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                            AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                            Boolean blocking<font color=#990000>,</font>
                            String service_name<font color=#990000>,</font>
                            Uint32 service_capabilities<font color=#990000>,</font>
                            Uint32 service_mask<font color=#990000>,</font>
                            Uint32 service_queue<font color=#990000>)</font><font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>RegisterCimService</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
   
         <font color=#FF0000>}</font>
   
         String name<font color=#990000>;</font>
         Uint32 capabilities<font color=#990000>;</font>
         Uint32 mask<font color=#990000>;</font>
         Uint32 queue<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE DeRegisterCimService <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>DeRegisterCimService</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                              AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                              Boolean blocking<font color=#990000>,</font>
                              Uint32 service_queue<font color=#990000>)</font><font color=#990000>;</font>
   
   
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>DeRegisterCimService</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
   
         <font color=#FF0000>}</font>
   
         Uint32 queue<font color=#990000>;</font>
   <font color=#FF0000>}</font> <font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE UpdateCimService <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>UpdateCimService</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                          AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                          Boolean blocking<font color=#990000>,</font>
                          Uint32 service_queue<font color=#990000>,</font>
                          Uint32 service_capabilities<font color=#990000>,</font>
                          Uint32 service_mask<font color=#990000>)</font><font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>UpdateCimService</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
   
         <font color=#FF0000>}</font>
   
         Uint32 queue<font color=#990000>;</font>
         Uint32 capabilities<font color=#990000>;</font>
         Uint32 mask<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
   
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE AsyncIoctl <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>AsyncIoctl</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                    AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                    Uint32 destination<font color=#990000>,</font>
                    Uint32 response<font color=#990000>,</font>
                    Boolean blocking<font color=#990000>,</font>
                    Uint32 code<font color=#990000>,</font>
                    Uint32 int_param<font color=#990000>,</font>
                    <font color=#009900>void</font> <font color=#990000>*</font>p_param<font color=#990000>)</font><font color=#990000>;</font>
   
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>AsyncIoctl</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
   
         <font color=#FF0000>}</font>
   
         <b><font color=#0000FF>enum</font></b>
         <font color=#FF0000>{</font>
            IO_CLOSE<font color=#990000>,</font>
            IO_OPEN<font color=#990000>,</font>
            IO_SOURCE_QUENCH<font color=#990000>,</font>
          IO_SERVICE_DEFINED          IO_SERVICE_DEFINED
       };        <font color=#FF0000>}</font><font color=#990000>;</font>
  
  
  
       Uint32 ctl;        Uint32 ctl<font color=#990000>;</font>
       Uint32 intp;        Uint32 intp<font color=#990000>;</font>
       void *voidp;        <font color=#009900>void</font> <font color=#990000>*</font>voidp<font color=#990000>;</font>
  
 };  <font color=#FF0000>}</font><font color=#990000>;</font>
  
 class PEGASUS_COMMON_LINKAGE CimServiceStart : public AsyncRequest  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE CimServiceStart <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
 {  <font color=#FF0000>{</font>
    public:     <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
       CimServiceStart(Uint32 routing,        <b><font color=#000000>CimServiceStart</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                       AsyncOpNode *operation,                        AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                       Uint32 destination,                        Uint32 destination<font color=#990000>,</font>
                       Uint32 response,                        Uint32 response<font color=#990000>,</font>
                       Boolean blocking);                        Boolean blocking<font color=#990000>)</font><font color=#990000>;</font>
  
       virtual ~CimServiceStart(void)        <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>CimServiceStart</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
       {        <font color=#FF0000>{</font>
  
       }        <font color=#FF0000>}</font>
 };  <font color=#FF0000>}</font><font color=#990000>;</font>
  
  
 class PEGASUS_COMMON_LINKAGE CimServiceStop : public AsyncRequest  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE CimServiceStop <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
 {  <font color=#FF0000>{</font>
    public:     <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
       CimServiceStop(Uint32 routing,        <b><font color=#000000>CimServiceStop</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                      AsyncOpNode *operation,                       AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                      Uint32 destination,                       Uint32 destination<font color=#990000>,</font>
                      Uint32 response,                       Uint32 response<font color=#990000>,</font>
                      Boolean blocking);                       Boolean blocking<font color=#990000>)</font><font color=#990000>;</font>
  
       virtual ~CimServiceStop(void)        <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>CimServiceStop</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
       {        <font color=#FF0000>{</font>
  
       }        <font color=#FF0000>}</font>
 };  <font color=#FF0000>}</font><font color=#990000>;</font>
  
 class PEGASUS_COMMON_LINKAGE CimServicePause : public AsyncRequest  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE CimServicePause <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
 {  <font color=#FF0000>{</font>
    public:     <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
       CimServicePause(Uint32 routing,        <b><font color=#000000>CimServicePause</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                       AsyncOpNode *operation,                        AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                       Uint32 destination,                        Uint32 destination<font color=#990000>,</font>
                       Uint32 response,                        Uint32 response<font color=#990000>,</font>
                       Boolean blocking);                        Boolean blocking<font color=#990000>)</font><font color=#990000>;</font>
  
  
       virtual ~CimServicePause(void)        <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>CimServicePause</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
       {        <font color=#FF0000>{</font>
  
       }        <font color=#FF0000>}</font>
 };  <font color=#FF0000>}</font><font color=#990000>;</font>
  
 class PEGASUS_COMMON_LINKAGE CimServiceResume : public AsyncRequest  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE CimServiceResume <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
 {  <font color=#FF0000>{</font>
    public:     <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
       CimServiceResume(Uint32 routing,        <b><font color=#000000>CimServiceResume</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                        AsyncOpNode *operation,                         AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                        Uint32 destination,                         Uint32 destination<font color=#990000>,</font>
                        Uint32 response,                         Uint32 response<font color=#990000>,</font>
                        Boolean blocking);                         Boolean blocking<font color=#990000>)</font><font color=#990000>;</font>
  
  
       virtual ~CimServiceResume(void)        <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>CimServiceResume</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
       {        <font color=#FF0000>{</font>
  
       }        <font color=#FF0000>}</font>
 };  <font color=#FF0000>}</font><font color=#990000>;</font>
  
 class PEGASUS_COMMON_LINKAGE AsyncOperationStart : public AsyncRequest  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE AsyncOperationStart <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
 {  <font color=#FF0000>{</font>
    public:     <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
       AsyncOperationStart(Uint32 routing,        <b><font color=#000000>AsyncOperationStart</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                           AsyncOpNode *operation,                            AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                           Uint32 destination,                            Uint32 destination<font color=#990000>,</font>
                           Uint32 response,                            Uint32 response<font color=#990000>,</font>
                           Boolean blocking,                            Boolean blocking<font color=#990000>,</font>
                           Message *action);                            Message <font color=#990000>*</font>action<font color=#990000>)</font><font color=#990000>;</font>
  
  
       virtual ~AsyncOperationStart(void)        <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>AsyncOperationStart</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
       {        <font color=#FF0000>{</font>
            <b><font color=#0000FF>delete</font></b> _act<font color=#990000>;</font>
         <font color=#FF0000>}</font>
  
       }  
  
       Message *act;        Message <font color=#990000>*</font><b><font color=#000000>get_action</font></b><font color=#990000>(</font><font color=#009900>void</font> <font color=#990000>)</font> <font color=#990000>;</font>
 };  
  
 class PEGASUS_COMMON_LINKAGE AsyncOperationResult : public AsyncReply  
 {  
    public:  
       AsyncOperationResult(Uint32 key,  
                            Uint32 routing,  
                            AsyncOpNode *operation,  
                            Uint32 result_code,  
                            Uint32 destination,  
                            Uint32 blocking);  
  
      <b><font color=#0000FF>private</font></b><font color=#990000>:</font>
         <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> MessageQueueService<font color=#990000>;</font>
         <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> cimom<font color=#990000>;</font>
         Message <font color=#990000>*</font>_act<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
  
       virtual ~AsyncOperationResult(void)  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE AsyncOperationResult <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncReply
       {  <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>AsyncOperationResult</font></b><font color=#990000>(</font>Uint32 key<font color=#990000>,</font>
                              Uint32 routing<font color=#990000>,</font>
                              AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                              Uint32 result_code<font color=#990000>,</font>
                              Uint32 destination<font color=#990000>,</font>
                              Uint32 blocking<font color=#990000>)</font><font color=#990000>;</font>
  
       }  
 };  
  
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>AsyncOperationResult</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
  
 class PEGASUS_COMMON_LINKAGE AsyncLegacyOperationStart : public AsyncRequest        <font color=#FF0000>}</font>
 {  <font color=#FF0000>}</font><font color=#990000>;</font>
    public:  
       AsyncLegacyOperationStart(Uint32 routing,  
                                 AsyncOpNode *operation,  
                                 Uint32 destination,  
                                 Message *action);  
  
  
       virtual ~AsyncLegacyOperationStart(void)  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE AsyncLegacyOperationStart <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
       {  <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>AsyncLegacyOperationStart</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                                   AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                                   Uint32 destination<font color=#990000>,</font>
                                   Message <font color=#990000>*</font>action<font color=#990000>,</font>
                                   Uint32 action_destination<font color=#990000>)</font><font color=#990000>;</font>
  
       }  
  
       Message *act;        <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>AsyncLegacyOperationStart</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
 };        <font color=#FF0000>{</font>
            <b><font color=#0000FF>delete</font></b> _act<font color=#990000>;</font>
         <font color=#FF0000>}</font>
  
 class PEGASUS_COMMON_LINKAGE AsyncLegacyOperationResult : public AsyncReply        Message <font color=#990000>*</font><b><font color=#000000>get_action</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
 {  
    public:  
       AsyncLegacyOperationResult(Uint32 key,  
                                  Uint32 routing,  
                                  AsyncOpNode *operation,  
                                  Message *result);  
  
       virtual ~AsyncLegacyOperationResult(void)     <b><font color=#0000FF>private</font></b><font color=#990000>:</font>
       {        <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> MessageQueueService<font color=#990000>;</font>
         <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> cimom<font color=#990000>;</font>
         Message <font color=#990000>*</font>_act<font color=#990000>;</font>
         Uint32 _legacy_destination<font color=#990000>;</font>
  
       }  <font color=#FF0000>}</font><font color=#990000>;</font>
  
       Message *res;  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE AsyncLegacyOperationResult <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncReply
 };  <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>AsyncLegacyOperationResult</font></b><font color=#990000>(</font>Uint32 key<font color=#990000>,</font>
                                    Uint32 routing<font color=#990000>,</font>
                                    AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                                    Message <font color=#990000>*</font>result<font color=#990000>)</font><font color=#990000>;</font>
  
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>AsyncLegacyOperationResult</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
            <b><font color=#0000FF>delete</font></b> _res<font color=#990000>;</font>
         <font color=#FF0000>}</font>
  
 class PEGASUS_COMMON_LINKAGE FindServiceQueue : public AsyncRequest        Message <font color=#990000>*</font><b><font color=#000000>get_result</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
 {  
    public:  
       FindServiceQueue(Uint32 routing,  
                        AsyncOpNode *operation,  
                        Uint32 response,  
                        Boolean blocking,  
                        String service_name,  
                        Uint32 service_capabilities,  
                        Uint32 service_mask);  
  
       virtual ~FindServiceQueue(void)  
       {  
  
       }     <b><font color=#0000FF>private</font></b><font color=#990000>:</font>
         <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> MessageQueueService<font color=#990000>;</font>
         <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> cimom<font color=#990000>;</font>
         Message <font color=#990000>*</font>_res<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
  
       String name;  
       Uint32 capabilities;  
       Uint32 mask;  
 } ;  
  
 class PEGASUS_COMMON_LINKAGE FindServiceQueueResult : public AsyncReply  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE FindServiceQueue <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
 {  <font color=#FF0000>{</font>
    public:     <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
       FindServiceQueueResult(Uint32 key,        <b><font color=#000000>FindServiceQueue</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                              Uint32 routing,                         AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                              AsyncOpNode *operation,                         Uint32 response<font color=#990000>,</font>
                              Uint32 result_code,                         Boolean blocking<font color=#990000>,</font>
                              Uint32 destination,                         String service_name<font color=#990000>,</font>
                              Boolean blocking,                         Uint32 service_capabilities<font color=#990000>,</font>
                              Array&lt;Uint32&gt; queue_ids);                         Uint32 service_mask<font color=#990000>)</font><font color=#990000>;</font>
  
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>FindServiceQueue</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
  
       virtual ~FindServiceQueueResult(void)        <font color=#FF0000>}</font>
       {  
  
       }        String name<font color=#990000>;</font>
         Uint32 capabilities<font color=#990000>;</font>
         Uint32 mask<font color=#990000>;</font>
   <font color=#FF0000>}</font> <font color=#990000>;</font>
  
       Array&lt;Uint32&gt; qids;  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE FindServiceQueueResult <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncReply
 } ;  <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>FindServiceQueueResult</font></b><font color=#990000>(</font>Uint32 key<font color=#990000>,</font>
                                Uint32 routing<font color=#990000>,</font>
                                AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                                Uint32 result_code<font color=#990000>,</font>
                                Uint32 destination<font color=#990000>,</font>
                                Boolean blocking<font color=#990000>,</font>
                                Array<font color=#FF0000>&lt;Uint32&gt;</font> queue_ids<font color=#990000>)</font><font color=#990000>;</font>
  
 class PEGASUS_COMMON_LINKAGE EnumerateService : public AsyncRequest  
 {  
    public:  
       EnumerateService(Uint32 routing,  
                        AsyncOpNode *operation,  
                        Uint32 response,  
                        Boolean blocking,  
                        Uint32 queue_id);  
  
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>FindServiceQueueResult</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
  
       virtual ~EnumerateService(void)        <font color=#FF0000>}</font>
       {  
  
       }        Array<font color=#FF0000>&lt;Uint32&gt;</font> qids<font color=#990000>;</font>
   <font color=#FF0000>}</font> <font color=#990000>;</font>
  
       Uint32 qid;  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE EnumerateService <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncRequest
 };  <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
         <b><font color=#000000>EnumerateService</font></b><font color=#990000>(</font>Uint32 routing<font color=#990000>,</font>
                          AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                          Uint32 response<font color=#990000>,</font>
                          Boolean blocking<font color=#990000>,</font>
                          Uint32 queue_id<font color=#990000>)</font><font color=#990000>;</font>
  
 class PEGASUS_COMMON_LINKAGE EnumerateServiceResponse : public AsyncReply  
 {  
    public:  
       EnumerateServiceResponse(Uint32 key,  
                                Uint32 routing,  
                                AsyncOpNode *operation,  
                                Uint32 result_code,  
                                Uint32 response,  
                                Boolean blocking,  
                                String service_name,  
                                Uint32 service_capabilities,  
                                Uint32 service_mask,  
                                Uint32 service_qid);  
  
         <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>EnumerateService</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
  
       virtual ~EnumerateServiceResponse(void)        <font color=#FF0000>}</font>
       {  
  
       }        Uint32 qid<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
  
       String name;  <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE EnumerateServiceResponse <font color=#990000>:</font> <b><font color=#0000FF>public</font></b> AsyncReply
       Uint32 capabilities;  <font color=#FF0000>{</font>
       Uint32 mask;     <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
       Uint32 qid;        <b><font color=#000000>EnumerateServiceResponse</font></b><font color=#990000>(</font>Uint32 key<font color=#990000>,</font>
 };                                 Uint32 routing<font color=#990000>,</font>
                                  AsyncOpNode <font color=#990000>*</font>operation<font color=#990000>,</font>
                                  Uint32 result_code<font color=#990000>,</font>
                                  Uint32 response<font color=#990000>,</font>
                                  Boolean blocking<font color=#990000>,</font>
                                  String service_name<font color=#990000>,</font>
                                  Uint32 service_capabilities<font color=#990000>,</font>
                                  Uint32 service_mask<font color=#990000>,</font>
                                  Uint32 service_qid<font color=#990000>)</font><font color=#990000>;</font>
  
 </pre>  
  
 <h3>AsyncOPNode</h3>        <b><font color=#0000FF>virtual</font></b> <font color=#990000>~</font><b><font color=#000000>EnumerateServiceResponse</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
         <font color=#FF0000>{</font>
  
 <pre>        <font color=#FF0000>}</font>
 #define ASYNC_OPFLAGS_UNKNOWN           0x00000000  
 #define ASYNC_OPFLAGS_INTERVAL_REPEAT   0x00000010  
 #define ASYNC_OPFLAGS_INDICATION        0x00000020  
 #define ASYNC_OPFLAGS_REMOTE            0x00000040  
 #define ASYNC_OPFLAGS_LOCAL_OUT_OF_PROC 0x00000080  
 #define ASYNC_OPFLAGS_PHASED            0x00000001  
 #define ASYNC_OPFLAGS_PARTIAL           0x00000002  
 #define ASYNC_OPFLAGS_NORMAL            0x00000000  
 #define ASYNC_OPFLAGS_SINGLE            0x00000008  
 #define ASYNC_OPFLAGS_MULTIPLE          0x00000010  
 #define ASYNC_OPFLAGS_TOTAL             0x00000020  
 #define ASYNC_OPFLAGS_META_DISPATCHER   0x00000040  
   
 #define ASYNC_OPSTATE_UNKNOWN           0x00000000  
 #define ASYNC_OPSTATE_OFFERED           0x00000001  
 #define ASYNC_OPSTATE_DECLINED          0x00000002  
 #define ASYNC_OPSTATE_STARTED           0x00000004  
 #define ASYNC_OPSTATE_PROCESSING        0x00000008  
 #define ASYNC_OPSTATE_DELIVER           0x00000010  
 #define ASYNC_OPSTATE_RESERVE           0x00000020  
 #define ASYNC_OPSTATE_COMPLETE          0x00000040  
 #define ASYNC_OPSTATE_TIMEOUT           0x00000080  
 #define ASYNC_OPSTATE_CANCELLED         0x00000100  
 #define ASYNC_OPSTATE_PAUSED            0x00000200  
 #define ASYNC_OPSTATE_SUSPENDED         0x00000400  
 #define ASYNC_OPSTATE_RESUMED           0x00000800  
 #define ASYNC_OPSTATE_ORPHANED          0x00001000  
 #define ASYNC_OPSTATE_RELEASED          0x00002000  
  
 class Cimom;        String name<font color=#990000>;</font>
         Uint32 capabilities<font color=#990000>;</font>
         Uint32 mask<font color=#990000>;</font>
         Uint32 qid<font color=#990000>;</font>
   <font color=#FF0000>}</font><font color=#990000>;</font>
  
 class PEGASUS_COMMON_LINKAGE AsyncOpNode  
 {  
    public:  
  
       AsyncOpNode(void);  PEGASUS_NAMESPACE_END
       ~AsyncOpNode(void);  
   <b><font color=#000080>#endif</font></b> <i><font color=#9A1900>// CIMOM_MESSAGE_include</font></i>
   </tt>
   </pre>
  
       Boolean  operator == (const void *key) const;  
       Boolean operator == (const AsyncOpNode & node) const;  
  
       void get_timeout_interval(struct timeval *buffer) ;  <h3>AsyncOpNode</h3>
       void set_timeout_interval(const struct timeval *interval);  
  
       Boolean timeout(void)  ;  <pre>
   <tt>
       OperationContext & get_context(void) ;  <i><font color=#9A1900>//%///////////-*-c++-*-//////////////////////////////////////////////////////</font></i>
   <i><font color=#9A1900>//</font></i>
       void put_request(const Message *request) ;  <i><font color=#9A1900>// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM</font></i>
       Message *get_request(void) ;  <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>// Permission is hereby granted, free of charge, to any person obtaining a copy</font></i>
       void put_response(const Message *response) ;  <i><font color=#9A1900>// of this software and associated documentation files (the "Software"), to </font></i>
       Message *get_response(void) ;  <i><font color=#9A1900>// deal in the Software without restriction, including without limitation the </font></i>
   <i><font color=#9A1900>// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or </font></i>
       Uint32 read_state(void) ;  <i><font color=#9A1900>// sell copies of the Software, and to permit persons to whom the Software is</font></i>
       void write_state(Uint32) ;  <i><font color=#9A1900>// furnished to do so, subject to the following conditions:</font></i>
   <i><font color=#9A1900>// </font></i>
       Uint32 read_flags(void);  <i><font color=#9A1900>// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN </font></i>
       void write_flags(Uint32);  <i><font color=#9A1900>// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED</font></i>
   <i><font color=#9A1900>// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT</font></i>
       void lock(void)  throw(IPCException);  <i><font color=#9A1900>// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR </font></i>
       void unlock(void) throw(IPCException);  <i><font color=#9A1900>// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT </font></i>
       void udpate(void) throw(IPCException);  <i><font color=#9A1900>// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN </font></i>
       void deliver(const Uint32 count) throw(IPCException);  <i><font color=#9A1900>// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</font></i>
       void reserve(const Uint32 size) throw(IPCException);  <i><font color=#9A1900>// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</font></i>
       void processing(void) throw(IPCException) ;  <i><font color=#9A1900>//</font></i>
       void processing(OperationContext *context) throw(IPCException);  <i><font color=#9A1900>//==============================================================================</font></i>
       void complete(void) throw(IPCException) ;  <i><font color=#9A1900>//</font></i>
       void complete(OperationContext *context) throw(IPCException);  <i><font color=#9A1900>// Author: Mike Day (mdday@us.ibm.com)</font></i>
       void release(void);  <i><font color=#9A1900>//</font></i>
       void wait(void);  <i><font color=#9A1900>// Modified By: </font></i>
   <i><font color=#9A1900>//</font></i>
   <i><font color=#9A1900>//%/////////////////////////////////////////////////////////////////////////////</font></i>
    private:  
       Semaphore _client_sem;  
       Mutex _mut;  <b><font color=#000080>#ifndef</font></b> Pegasus_AsyncOpNode_h
       unlocked_dq&lt;Message&gt; _request;  <b><font color=#000080>#define</font></b> Pegasus_AsyncOpNode_h
       unlocked_dq&lt;Message&gt; _response;  
   <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Config.h&gt;</font>
       OperationContext _operation_list;  <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/Message.h&gt;</font>
       Uint32 _state;  <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/OperationContext.h&gt;</font>
       Uint32 _flags;  <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/internal_dq.h&gt;</font>
       Uint32 _offered_count;  <b><font color=#000080>#include</font></b> <font color=#FF0000>&lt;Pegasus/Common/IPC.h&gt;</font>
       Uint32 _total_ops;  
       Uint32 _completed_ops;  PEGASUS_NAMESPACE_BEGIN
       Uint32 _user_data;  
   <i><font color=#9A1900>// ATTN usage of flags and state is inconsistent</font></i>
       struct timeval _start;  <i><font color=#9A1900>// &lt;&lt; Wed Jan 16 17:41:57 2002 mdd &gt;&gt;</font></i>
       struct timeval _lifetime;  <i><font color=#9A1900>// resolved mdd </font></i>
       struct timeval _updated;  
       struct timeval _timeout_interval;  
   <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_UNKNOWN           <font color=#993399>0x00000000</font>
       AsyncOpNode *_parent;  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_INTERVAL_REPEAT   <font color=#993399>0x00000010</font>
       unlocked_dq&lt;AsyncOpNode&gt; _children;  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_INDICATION        <font color=#993399>0x00000020</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_REMOTE            <font color=#993399>0x00000040</font>
       void _reset(unlocked_dq&lt;AsyncOpNode&gt; *dst_q);  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_LOCAL_OUT_OF_PROC <font color=#993399>0x00000080</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_PHASED            <font color=#993399>0x00000001</font>
       // the lifetime member is for cache management by the cimom  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_PARTIAL           <font color=#993399>0x00000002</font>
       void _set_lifetime(struct timeval *lifetime) ;  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_NORMAL            <font color=#993399>0x00000000</font>
       Boolean _check_lifetime(void) ;  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_SINGLE            <font color=#993399>0x00000008</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_MULTIPLE          <font color=#993399>0x00000010</font>
       Boolean _is_child(void) ;  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_TOTAL             <font color=#993399>0x00000020</font>
       Uint32 _is_parent(void) ;  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_META_DISPATCHER   <font color=#993399>0x00000040</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_FIRE_AND_FORGET   <font color=#993399>0x00000080</font>
       Boolean _is_my_child(const AsyncOpNode & caller) const;  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_SIMPLE_STATUS     <font color=#993399>0x00000100</font>
       void _make_orphan( AsyncOpNode & parent) ;  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_CALLBACK          <font color=#993399>0x00000200</font>
       void _adopt_child(AsyncOpNode *child) ;  <b><font color=#000080>#define</font></b> ASYNC_OPFLAGS_FORWARD           <font color=#993399>0x00000400</font>
       void _disown_child(AsyncOpNode *child) ;  
       friend class cimom;  <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_UNKNOWN           <font color=#993399>0x00000000</font>
       friend class MessageQueueService;  <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_OFFERED           <font color=#993399>0x00000001</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_DECLINED          <font color=#993399>0x00000002</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_STARTED           <font color=#993399>0x00000004</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_PROCESSING        <font color=#993399>0x00000008</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_DELIVER           <font color=#993399>0x00000010</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_RESERVE           <font color=#993399>0x00000020</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_COMPLETE          <font color=#993399>0x00000040</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_TIMEOUT           <font color=#993399>0x00000080</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_CANCELLED         <font color=#993399>0x00000100</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_PAUSED            <font color=#993399>0x00000200</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_SUSPENDED         <font color=#993399>0x00000400</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_RESUMED           <font color=#993399>0x00000800</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_ORPHANED          <font color=#993399>0x00001000</font>
   <b><font color=#000080>#define</font></b> ASYNC_OPSTATE_RELEASED          <font color=#993399>0x00002000</font>
   
   <b><font color=#0000FF>class</font></b> Cimom<font color=#990000>;</font>
   <b><font color=#0000FF>class</font></b> Thread<font color=#990000>;</font>
   
   <b><font color=#0000FF>class</font></b> PEGASUS_COMMON_LINKAGE AsyncOpNode
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>public</font></b><font color=#990000>:</font>
   
         <b><font color=#000000>AsyncOpNode</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
         <font color=#990000>~</font><b><font color=#000000>AsyncOpNode</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
   
         Boolean  <b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>(</font><b><font color=#0000FF>const</font></b> <font color=#009900>void</font> <font color=#990000>*</font>key<font color=#990000>)</font> <b><font color=#0000FF>const</font></b><font color=#990000>;</font>
         Boolean <b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>(</font><b><font color=#0000FF>const</font></b> AsyncOpNode <font color=#990000>&amp;</font> node<font color=#990000>)</font> <b><font color=#0000FF>const</font></b><font color=#990000>;</font>
   
         <font color=#009900>void</font> <b><font color=#000000>get_timeout_interval</font></b><font color=#990000>(</font><b><font color=#0000FF>struct</font></b> timeval <font color=#990000>*</font>buffer<font color=#990000>)</font> <font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>set_timeout_interval</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> <b><font color=#0000FF>struct</font></b> timeval <font color=#990000>*</font>interval<font color=#990000>)</font><font color=#990000>;</font>
   
         Boolean <b><font color=#000000>timeout</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>  <font color=#990000>;</font>
   
         OperationContext <font color=#990000>&amp;</font> <b><font color=#000000>get_context</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <font color=#990000>;</font>
   
         <font color=#009900>void</font> <b><font color=#000000>put_request</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> Message <font color=#990000>*</font>request<font color=#990000>)</font> <font color=#990000>;</font>
         Message <font color=#990000>*</font><b><font color=#000000>get_request</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <font color=#990000>;</font>
   
         <font color=#009900>void</font> <b><font color=#000000>put_response</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> Message <font color=#990000>*</font>response<font color=#990000>)</font> <font color=#990000>;</font>
         Message <font color=#990000>*</font><b><font color=#000000>get_response</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <font color=#990000>;</font>
   
         Uint32 <b><font color=#000000>read_state</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>write_state</font></b><font color=#990000>(</font>Uint32<font color=#990000>)</font> <font color=#990000>;</font>
   
         Uint32 <b><font color=#000000>read_flags</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>write_flags</font></b><font color=#990000>(</font>Uint32<font color=#990000>)</font><font color=#990000>;</font>
   
         <font color=#009900>void</font> <b><font color=#000000>lock</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>  <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>udpate</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>deliver</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> Uint32 count<font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>reserve</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> Uint32 size<font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>processing</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font> <font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>processing</font></b><font color=#990000>(</font>OperationContext <font color=#990000>*</font>context<font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>complete</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font> <font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>complete</font></b><font color=#990000>(</font>OperationContext <font color=#990000>*</font>context<font color=#990000>)</font> <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>release</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>wait</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font><font color=#990000>;</font>
   
   
      <b><font color=#0000FF>private</font></b><font color=#990000>:</font>
         Semaphore _client_sem<font color=#990000>;</font>
         Mutex _mut<font color=#990000>;</font>
         unlocked_dq<font color=#FF0000>&lt;Message&gt;</font> _request<font color=#990000>;</font>
         unlocked_dq<font color=#FF0000>&lt;Message&gt;</font> _response<font color=#990000>;</font>
   
         OperationContext _operation_list<font color=#990000>;</font>
         Uint32 _state<font color=#990000>;</font>
         Uint32 _flags<font color=#990000>;</font>
         Uint32 _offered_count<font color=#990000>;</font>
         Uint32 _total_ops<font color=#990000>;</font>
         Uint32 _completed_ops<font color=#990000>;</font>
         Uint32 _user_data<font color=#990000>;</font>
         Uint32 _completion_code<font color=#990000>;</font>
         MessageQueue <font color=#990000>*</font>_op_dest<font color=#990000>;</font>
   
         <b><font color=#0000FF>struct</font></b> timeval _start<font color=#990000>;</font>
         <b><font color=#0000FF>struct</font></b> timeval _lifetime<font color=#990000>;</font>
         <b><font color=#0000FF>struct</font></b> timeval _updated<font color=#990000>;</font>
         <b><font color=#0000FF>struct</font></b> timeval _timeout_interval<font color=#990000>;</font>
   
         AsyncOpNode <font color=#990000>*</font>_parent<font color=#990000>;</font>
         unlocked_dq<font color=#FF0000>&lt;AsyncOpNode&gt;</font> _children<font color=#990000>;</font>
   
         <font color=#009900>void</font> <b><font color=#000000>_reset</font></b><font color=#990000>(</font>unlocked_dq<font color=#FF0000>&lt;AsyncOpNode&gt;</font> <font color=#990000>*</font>dst_q<font color=#990000>)</font><font color=#990000>;</font>
   
         <i><font color=#9A1900>// the lifetime member is for cache management by the cimom</font></i>
         <font color=#009900>void</font> <b><font color=#000000>_set_lifetime</font></b><font color=#990000>(</font><b><font color=#0000FF>struct</font></b> timeval <font color=#990000>*</font>lifetime<font color=#990000>)</font> <font color=#990000>;</font>
         Boolean <b><font color=#000000>_check_lifetime</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <font color=#990000>;</font>
   
         Boolean <b><font color=#000000>_is_child</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <font color=#990000>;</font>
         Uint32 <b><font color=#000000>_is_parent</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font> <font color=#990000>;</font>
         Boolean <b><font color=#000000>_is_my_child</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> AsyncOpNode <font color=#990000>&amp;</font> caller<font color=#990000>)</font> <b><font color=#0000FF>const</font></b><font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>_make_orphan</font></b><font color=#990000>(</font> AsyncOpNode <font color=#990000>&amp;</font> parent<font color=#990000>)</font> <font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>_adopt_child</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>child<font color=#990000>)</font> <font color=#990000>;</font>
         <font color=#009900>void</font> <b><font color=#000000>_disown_child</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>child<font color=#990000>)</font> <font color=#990000>;</font>
         <font color=#009900>void</font> <font color=#990000>(</font><font color=#990000>*</font>_async_callback<font color=#990000>)</font><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font><font color=#990000>,</font>
                                 MessageQueue <font color=#990000>*</font><font color=#990000>,</font>
                                 <font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>;</font>
         <i><font color=#9A1900>// &lt;&lt; Tue Mar 12 14:44:51 2002 mdd &gt;&gt;</font></i>
         <i><font color=#9A1900>// pointers for async callbacks  - don't use </font></i>
         AsyncOpNode <font color=#990000>*</font>_callback_node<font color=#990000>;</font>
         MessageQueue <font color=#990000>*</font>_callback_response_q<font color=#990000>;</font>
         <font color=#009900>void</font> <font color=#990000>*</font>_callback_ptr<font color=#990000>;</font>
         MessageQueue <font color=#990000>*</font>_callback_request_q<font color=#990000>;</font>
         <i><font color=#9A1900>//      &lt;&lt; Tue Mar 12 14:44:53 2002 mdd &gt;&gt;</font></i>
         <i><font color=#9A1900>// pointers to help static class message handlers - don't use </font></i>
         MessageQueue <font color=#990000>*</font>_service_ptr<font color=#990000>;</font>
         Thread <font color=#990000>*</font>_thread_ptr<font color=#990000>;</font>
   
         <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> cimom<font color=#990000>;</font>
         <b><font color=#0000FF>friend</font></b> <b><font color=#0000FF>class</font></b> MessageQueueService<font color=#990000>;</font>
   
   <font color=#FF0000>}</font><font color=#990000>;</font>
   
   
   <b><font color=#0000FF>inline</font></b> Boolean AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>(</font><b><font color=#0000FF>const</font></b> <font color=#009900>void</font> <font color=#990000>*</font>key<font color=#990000>)</font> <b><font color=#0000FF>const</font></b>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>if</font></b> <font color=#990000>(</font>key <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>(</font><font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><b><font color=#0000FF>this</font></b><font color=#990000>)</font>
         <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>true</font></b><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>false</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> Boolean AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#0000FF>operator</font></b> <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>(</font><b><font color=#0000FF>const</font></b> AsyncOpNode <font color=#990000>&amp;</font> node<font color=#990000>)</font> <b><font color=#0000FF>const</font></b>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>return</font></b> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#0000FF>operator</font></b><font color=#990000>=</font><font color=#990000>=</font><font color=#990000>(</font><font color=#990000>(</font><b><font color=#0000FF>const</font></b> <font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>)</font><font color=#990000>&amp;</font>node<font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>get_timeout_interval</font></b><font color=#990000>(</font><b><font color=#0000FF>struct</font></b> timeval <font color=#990000>*</font>buffer<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font>buffer <font color=#990000>!</font><font color=#990000>=</font> <font color=#993399>0</font><font color=#990000>)</font>
      <font color=#FF0000>{</font>
         _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font> <b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font> <font color=#990000>)</font><font color=#990000>;</font>
         buffer<font color=#990000>-</font><font color=#990000>&gt;</font>tv_sec <font color=#990000>=</font> _timeout_interval<font color=#990000>.</font>tv_sec<font color=#990000>;</font>
         buffer<font color=#990000>-</font><font color=#990000>&gt;</font>tv_usec <font color=#990000>=</font> _timeout_interval<font color=#990000>.</font>tv_usec<font color=#990000>;</font>
         _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <font color=#FF0000>}</font>
      <b><font color=#0000FF>return</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>set_timeout_interval</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> <b><font color=#0000FF>struct</font></b> timeval <font color=#990000>*</font>interval<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font>interval <font color=#990000>!</font><font color=#990000>=</font> <font color=#993399>0</font><font color=#990000>)</font>
      <font color=#FF0000>{</font>
         _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
         _timeout_interval<font color=#990000>.</font>tv_sec <font color=#990000>=</font> interval<font color=#990000>-</font><font color=#990000>&gt;</font>tv_sec<font color=#990000>;</font>
         _timeout_interval<font color=#990000>.</font>tv_usec <font color=#990000>=</font> interval<font color=#990000>-</font><font color=#990000>&gt;</font>tv_usec<font color=#990000>;</font>
         <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
         _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <font color=#FF0000>}</font>
   <font color=#FF0000>}</font>
   
   
   <b><font color=#0000FF>inline</font></b> Boolean AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>timeout</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>struct</font></b> timeval now<font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>now<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      Boolean ret <font color=#990000>=</font> <b><font color=#0000FF>false</font></b><font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font><font color=#990000>(</font>_updated<font color=#990000>.</font>tv_sec <font color=#990000>+</font> _timeout_interval<font color=#990000>.</font>tv_sec <font color=#990000>)</font> <font color=#990000>&lt;</font> now<font color=#990000>.</font>tv_sec<font color=#990000>)</font>
         <b><font color=#0000FF>if</font></b><font color=#990000>(</font><font color=#990000>(</font>_updated<font color=#990000>.</font>tv_usec <font color=#990000>+</font> _timeout_interval<font color=#990000>.</font>tv_usec <font color=#990000>)</font> <font color=#990000>&lt;</font> now<font color=#990000>.</font>tv_usec<font color=#990000>)</font>
            ret <font color=#990000>=</font>  <b><font color=#0000FF>true</font></b><font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> ret<font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <i><font color=#9A1900>// context is now a locked list</font></i>
   <b><font color=#0000FF>inline</font></b> OperationContext <font color=#990000>&amp;</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>get_context</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> _operation_list<font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   
   <b><font color=#0000FF>inline</font></b>  <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>put_request</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> Message <font color=#990000>*</font>request<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font> <b><font color=#0000FF>false</font></b> <font color=#990000>=</font><font color=#990000>=</font> _request<font color=#990000>.</font><b><font color=#000000>exists</font></b><font color=#990000>(</font><b><font color=#0000FF>reinterpret_cast</font></b><font color=#990000>&lt;</font><font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>&gt;</font><font color=#990000>(</font><b><font color=#0000FF>const_cast</font></b><font color=#990000>&lt;</font>Message <font color=#990000>*</font><font color=#990000>&gt;</font><font color=#990000>(</font>request<font color=#990000>)</font><font color=#990000>)</font><font color=#990000>)</font> <font color=#990000>)</font>
      _request<font color=#990000>.</font><b><font color=#000000>insert_last</font></b><font color=#990000>(</font> <b><font color=#0000FF>const_cast</font></b><font color=#990000>&lt;</font>Message <font color=#990000>*</font><font color=#990000>&gt;</font><font color=#990000>(</font>request<font color=#990000>)</font> <font color=#990000>)</font> <font color=#990000>;</font>
   
   <i><font color=#9A1900>//   _request = const_cast&lt;Message *&gt;(request);</font></i>
   
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> Message <font color=#990000>*</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>get_request</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      Message <font color=#990000>*</font>ret<font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      ret <font color=#990000>=</font> _request<font color=#990000>.</font><b><font color=#000000>remove_first</font></b><font color=#990000>(</font><font color=#990000>)</font> <font color=#990000>;</font>
   <i><font color=#9A1900>//   ret = _request;</font></i>
   
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> ret<font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>put_response</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> Message <font color=#990000>*</font>response<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>if</font></b> <font color=#990000>(</font><b><font color=#0000FF>false</font></b> <font color=#990000>=</font><font color=#990000>=</font> _response<font color=#990000>.</font><b><font color=#000000>exists</font></b><font color=#990000>(</font><b><font color=#0000FF>reinterpret_cast</font></b><font color=#990000>&lt;</font><font color=#009900>void</font> <font color=#990000>*</font><font color=#990000>&gt;</font><font color=#990000>(</font><b><font color=#0000FF>const_cast</font></b><font color=#990000>&lt;</font>Message <font color=#990000>*</font><font color=#990000>&gt;</font><font color=#990000>(</font>response<font color=#990000>)</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>)</font>
      _response<font color=#990000>.</font><b><font color=#000000>insert_last</font></b><font color=#990000>(</font> <b><font color=#0000FF>const_cast</font></b><font color=#990000>&lt;</font>Message <font color=#990000>*</font><font color=#990000>&gt;</font><font color=#990000>(</font>response<font color=#990000>)</font> <font color=#990000>)</font><font color=#990000>;</font>
   
   <i><font color=#9A1900>//   _response = const_cast&lt;Message *&gt;(response);</font></i>
   
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> Message <font color=#990000>*</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>get_response</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      Message <font color=#990000>*</font>ret<font color=#990000>;</font>
   
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
   <i><font color=#9A1900>//   gettimeofday(&amp;_updated, NULL);</font></i>
      ret <font color=#990000>=</font> _response<font color=#990000>.</font><b><font color=#000000>remove_first</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <i><font color=#9A1900>//   ret = _response;</font></i>
   
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> ret<font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> Uint32 AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>read_state</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      Uint32 ret <font color=#990000>=</font> _state<font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> ret<font color=#990000>;</font>
   
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>write_state</font></b><font color=#990000>(</font>Uint32 state<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      _state <font color=#990000>=</font> state<font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> Uint32 AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>read_flags</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      Uint32 ret <font color=#990000>=</font> _flags<font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> ret<font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>write_flags</font></b><font color=#990000>(</font>Uint32 flags<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      _flags <font color=#990000>=</font> flags<font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   
   <b><font color=#0000FF>inline</font></b>  <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
      <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
      <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>udpate</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
      <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>deliver</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> Uint32 count<font color=#990000>)</font>
      <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      _completed_ops <font color=#990000>=</font> count<font color=#990000>;</font>
      _state <font color=#990000>|</font><font color=#990000>=</font> ASYNC_OPSTATE_DELIVER<font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>reserve</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> Uint32 size<font color=#990000>)</font>
      <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      _total_ops <font color=#990000>=</font> size<font color=#990000>;</font>
      _state <font color=#990000>|</font><font color=#990000>=</font> ASYNC_OPSTATE_RESERVE<font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>processing</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
      <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      _state <font color=#990000>|</font><font color=#990000>=</font> ASYNC_OPSTATE_PROCESSING<font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <i><font color=#9A1900>// con will be empty upon return of this member function</font></i>
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>processing</font></b><font color=#990000>(</font>OperationContext <font color=#990000>*</font>con<font color=#990000>)</font>
      <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      _state <font color=#990000>|</font><font color=#990000>=</font> ASYNC_OPSTATE_PROCESSING<font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
   
      context <font color=#990000>*</font>c <font color=#990000>=</font> con<font color=#990000>-</font><font color=#990000>&gt;</font><b><font color=#000000>remove_context</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>while</font></b><font color=#990000>(</font>c <font color=#990000>!</font><font color=#990000>=</font> <font color=#993399>0</font><font color=#990000>)</font>
      <font color=#FF0000>{</font>
         _operation_list<font color=#990000>.</font><b><font color=#000000>add_context</font></b><font color=#990000>(</font>c<font color=#990000>)</font><font color=#990000>;</font>
         c <font color=#990000>=</font> con<font color=#990000>-</font><font color=#990000>&gt;</font><b><font color=#000000>remove_context</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <font color=#FF0000>}</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>complete</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
      <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      _state <font color=#990000>|</font><font color=#990000>=</font> ASYNC_OPSTATE_COMPLETE<font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   
      <b><font color=#0000FF>return</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>complete</font></b><font color=#990000>(</font>OperationContext <font color=#990000>*</font>con<font color=#990000>)</font>
      <b><font color=#0000FF>throw</font></b><font color=#990000>(</font>IPCException<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      _state <font color=#990000>|</font><font color=#990000>=</font> ASYNC_OPSTATE_COMPLETE<font color=#990000>;</font>
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>_updated<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      context <font color=#990000>*</font>c <font color=#990000>=</font> con<font color=#990000>-</font><font color=#990000>&gt;</font><b><font color=#000000>remove_context</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>while</font></b><font color=#990000>(</font>c <font color=#990000>!</font><font color=#990000>=</font> <font color=#993399>0</font><font color=#990000>)</font>
      <font color=#FF0000>{</font>
         _operation_list<font color=#990000>.</font><b><font color=#000000>add_context</font></b><font color=#990000>(</font>c<font color=#990000>)</font><font color=#990000>;</font>
         c <font color=#990000>=</font> con<font color=#990000>-</font><font color=#990000>&gt;</font><b><font color=#000000>remove_context</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <font color=#FF0000>}</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>wait</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _client_sem<font color=#990000>.</font><b><font color=#000000>wait</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>release</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      _state <font color=#990000>|</font><font color=#990000>=</font> ASYNC_OPSTATE_RELEASED<font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b>  <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>_set_lifetime</font></b><font color=#990000>(</font><b><font color=#0000FF>struct</font></b> timeval <font color=#990000>*</font>lifetime<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      _mut<font color=#990000>.</font><b><font color=#000000>lock</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      _lifetime<font color=#990000>.</font>tv_sec <font color=#990000>=</font> lifetime<font color=#990000>-</font><font color=#990000>&gt;</font>tv_sec<font color=#990000>;</font>
      _lifetime<font color=#990000>.</font>tv_usec <font color=#990000>=</font> lifetime<font color=#990000>-</font><font color=#990000>&gt;</font>tv_usec<font color=#990000>;</font>
      _mut<font color=#990000>.</font><b><font color=#000000>unlock</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> Boolean AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>_check_lifetime</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>struct</font></b> timeval now<font color=#990000>;</font>
   
      <b><font color=#000000>gettimeofday</font></b><font color=#990000>(</font><font color=#990000>&amp;</font>now<font color=#990000>,</font> NULL<font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font><font color=#990000>(</font>_start<font color=#990000>.</font>tv_sec <font color=#990000>+</font> _lifetime<font color=#990000>.</font>tv_sec <font color=#990000>)</font> <font color=#990000>&gt;</font><font color=#990000>=</font> now<font color=#990000>.</font>tv_sec<font color=#990000>)</font>
         <b><font color=#0000FF>if</font></b><font color=#990000>(</font><font color=#990000>(</font>_start<font color=#990000>.</font>tv_usec <font color=#990000>+</font> _lifetime<font color=#990000>.</font>tv_usec <font color=#990000>)</font> <font color=#990000>&gt;</font><font color=#990000>=</font> now<font color=#990000>.</font>tv_usec<font color=#990000>)</font>
            <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>true</font></b><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>false</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> Boolean AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>_is_child</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>if</font></b> <font color=#990000>(</font>_parent <font color=#990000>!</font><font color=#990000>=</font> <font color=#993399>0</font><font color=#990000>)</font>
         <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>true</font></b><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>false</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> Uint32 AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>_is_parent</font></b><font color=#990000>(</font><font color=#009900>void</font><font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>return</font></b> _children<font color=#990000>.</font><b><font color=#000000>count</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> Boolean AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>_is_my_child</font></b><font color=#990000>(</font><b><font color=#0000FF>const</font></b> AsyncOpNode <font color=#990000>&amp;</font> caller<font color=#990000>)</font> <b><font color=#0000FF>const</font></b>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>if</font></b> <font color=#990000>(</font> _parent <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>&amp;</font>caller <font color=#990000>)</font>
         <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>true</font></b><font color=#990000>;</font>
      <b><font color=#0000FF>return</font></b> <b><font color=#0000FF>false</font></b><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>_make_orphan</font></b><font color=#990000>(</font> AsyncOpNode <font color=#990000>&amp;</font> parent<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font> _parent <font color=#990000>=</font><font color=#990000>=</font> <font color=#990000>&amp;</font>parent <font color=#990000>)</font>
      <font color=#FF0000>{</font>
         _parent <font color=#990000>=</font> NULL<font color=#990000>;</font>
         parent<font color=#990000>.</font>_children<font color=#990000>.</font><b><font color=#000000>remove</font></b><font color=#990000>(</font><b><font color=#0000FF>this</font></b><font color=#990000>)</font><font color=#990000>;</font>
      <font color=#FF0000>}</font>
      <b><font color=#0000FF>else</font></b>
         <b><font color=#0000FF>throw</font></b> <b><font color=#000000>Permission</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>_adopt_child</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>child<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font>child <font color=#990000>=</font><font color=#990000>=</font> NULL<font color=#990000>)</font>
         <b><font color=#0000FF>throw</font></b> <b><font color=#000000>NullPointer</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font><b><font color=#0000FF>true</font></b> <font color=#990000>=</font><font color=#990000>=</font> child<font color=#990000>-</font><font color=#990000>&gt;</font><b><font color=#000000>_is_child</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font>
         <b><font color=#0000FF>throw</font></b> <b><font color=#000000>Permission</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      child<font color=#990000>-</font><font color=#990000>&gt;</font>_parent <font color=#990000>=</font> <b><font color=#0000FF>this</font></b><font color=#990000>;</font>
      _children<font color=#990000>.</font><b><font color=#000000>insert_last</font></b><font color=#990000>(</font>child<font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
   
   <b><font color=#0000FF>inline</font></b> <font color=#009900>void</font> AsyncOpNode<font color=#990000>:</font><font color=#990000>:</font><b><font color=#000000>_disown_child</font></b><font color=#990000>(</font>AsyncOpNode <font color=#990000>*</font>child<font color=#990000>)</font>
   <font color=#FF0000>{</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font>child <font color=#990000>=</font><font color=#990000>=</font> NULL<font color=#990000>)</font>
         <b><font color=#0000FF>throw</font></b> <b><font color=#000000>NullPointer</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>;</font>
      <b><font color=#0000FF>if</font></b><font color=#990000>(</font> <b><font color=#0000FF>false</font></b> <font color=#990000>=</font><font color=#990000>=</font> child<font color=#990000>-</font><font color=#990000>&gt;</font><b><font color=#000000>_is_child</font></b><font color=#990000>(</font><font color=#990000>)</font> <font color=#990000>|</font><font color=#990000>|</font> <b><font color=#0000FF>false</font></b> <font color=#990000>=</font><font color=#990000>=</font> child<font color=#990000>-</font><font color=#990000>&gt;</font><b><font color=#000000>_is_my_child</font></b><font color=#990000>(</font> <font color=#990000>*</font><b><font color=#0000FF>this</font></b> <font color=#990000>)</font><font color=#990000>)</font>
         <b><font color=#0000FF>throw</font></b> <b><font color=#000000>Permission</font></b><font color=#990000>(</font><b><font color=#000000>pegasus_thread_self</font></b><font color=#990000>(</font><font color=#990000>)</font><font color=#990000>)</font><font color=#990000>;</font>
      child<font color=#990000>-</font><font color=#990000>&gt;</font><b><font color=#000000>_make_orphan</font></b><font color=#990000>(</font> <font color=#990000>*</font><b><font color=#0000FF>this</font></b> <font color=#990000>)</font><font color=#990000>;</font>
      _children<font color=#990000>.</font><b><font color=#000000>remove</font></b><font color=#990000>(</font>child<font color=#990000>)</font><font color=#990000>;</font>
   <font color=#FF0000>}</font>
  
 };  PEGASUS_NAMESPACE_END
   
   <b><font color=#000080>#endif</font></b> <i><font color=#9A1900>//Pegasus_AsyncOpNode_h</font></i>
   </tt>
 </pre> </pre>
  
   
 <hr> <hr>
     <address><a href="mailto:mdday@us.ibm.com">Michael Day</a></address>     <address><a href="mailto:mdday@us.ibm.com">Michael Day</a></address>
 <!-- Created: Tue Feb  5 13:21:55 EST 2002 --> <!-- Created: Tue Feb  5 13:21:55 EST 2002 -->
 <!-- hhmts start --> <!-- hhmts start -->
 Last modified: Tue Feb  5 18:09:50 EST 2002  Last modified: Wed Mar 13 12:26:56 EST 2002
 <!-- hhmts end --> <!-- hhmts end -->
   </body>   </body>
 </html> </html>


Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2