(file) Return to Message.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 karl  1.48 //%2003////////////////////////////////////////////////////////////////////////
  2 mike  1.4  //
  3 karl  1.48 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development
  4            // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
  5            // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
  6            // IBM Corp.; EMC Corporation, The Open Group.
  7 mike  1.4  //
  8            // Permission is hereby granted, free of charge, to any person obtaining a copy
  9 chip  1.24 // of this software and associated documentation files (the "Software"), to
 10            // deal in the Software without restriction, including without limitation the
 11            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 12 mike  1.4  // sell copies of the Software, and to permit persons to whom the Software is
 13            // furnished to do so, subject to the following conditions:
 14 kumpf 1.37 // 
 15 chip  1.24 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 16 mike  1.4  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 17            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 18 chip  1.24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 19            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 20            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 21 mike  1.4  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 22            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 23            //
 24            //==============================================================================
 25            //
 26            // Author: Mike Brasher (mbrasher@bmc.com)
 27            //
 28 mike  1.6  // Modified By: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
 29 kumpf 1.27 //              Carol Ann Krug Graves, Hewlett-Packard Company
 30            //                  (carolann_graves@hp.com)
 31            //              Mike Day (mdday@us.ibm.com)
 32            //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 33 sage  1.30 //              Arthur Pichlkostner (via Markus: sedgewick_de@yahoo.de)
 34 w.white 1.52 //				Willis White (whiwill@us.ibm.com)
 35 brian.campbell 1.55 //         Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase1
 36 mike           1.4  //
 37                     //%/////////////////////////////////////////////////////////////////////////////
 38                     
 39                     #ifndef Pegasus_Message_h
 40                     #define Pegasus_Message_h
 41                     
 42 mike           1.6  #include <Pegasus/Common/Config.h>
 43 mike           1.4  #include <iostream>
 44 mike           1.6  #include <cstring>
 45 kumpf          1.39 #include <Pegasus/Common/InternalException.h>
 46 mike           1.6  #include <Pegasus/Common/IPC.h>
 47 sage           1.30 #include <Pegasus/Common/StatisticalData.h>
 48 kumpf          1.38 #include <Pegasus/Common/Linkage.h>
 49 w.white        1.52 #include <Pegasus/Common/CIMDateTime.h>
 50 mike           1.4  
 51                     PEGASUS_NAMESPACE_BEGIN
 52                     
 53 mday           1.18 // REVIEW: could class be renamed to MessageMask (coding standard)
 54 mike           1.11 
 55 chip           1.24 class PEGASUS_COMMON_LINKAGE message_mask
 56 mike           1.6  {
 57                        public:
 58 mike           1.11 
 59 mike           1.6        static Uint32 type_legacy;
 60 mday           1.9        static Uint32 type_CIMOperation;
 61                           static Uint32 type_CIMAsyncOperation;
 62                           static Uint32 type_export;
 63                           static Uint32 type_lifetime;
 64 mike           1.6        static Uint32 type_socket;
 65                           static Uint32 type_connection;
 66                           static Uint32 type_http;
 67 kumpf          1.27       static Uint32 type_http_error;
 68 mike           1.6        static Uint32 type_cimom;
 69 mday           1.9        static Uint32 type_control;
 70                           static Uint32 type_service;
 71                           static Uint32 type_broadcast;
 72 kumpf          1.28       static Uint32 type_client_exception;
 73 chip           1.24 
 74 mday           1.9        static Uint32 ha_no_delete;
 75                           static Uint32 ha_request;
 76                           static Uint32 ha_reply;
 77 mday           1.10       static Uint32 ha_synchronous;
 78 mday           1.13       static Uint32 ha_async;
 79 mday           1.22       static Uint32 ha_wait;
 80 chip           1.24 
 81                     
 82                           // more for documentation than for use
 83 mike           1.7  
 84 mday           1.9        inline Uint32 get_type(Uint32 flags)
 85 mike           1.6        {
 86                     	 return (flags & 0x000fffff);
 87                           }
 88                     
 89                           inline Uint32 get_handling(Uint32 flags)
 90                           {
 91                     	 return( flags & 0xfff00000);
 92                           }
 93                     };
 94                     
 95 mday           1.20 class cimom;
 96 mike           1.4  class MessageQueue;
 97 mday           1.19 class MessageQueueService;
 98                     class AsyncLegacyOperationStart;
 99                     class AsyncLegacyOperationResult;
100 mike           1.4  
101 kumpf          1.40 enum HttpMethod
102                     {
103                         HTTP_METHOD__POST,
104                         HTTP_METHOD_M_POST
105                     };
106                     
107 chip           1.24 /** The Message class and derived classes are used to pass messages between
108 mike           1.4      modules. Messages are passed between modules using the message queues
109                         (see MessageQueue class). Derived classes may add their own fields.
110                         This base class defines two common fields: type, which is the type of
111                         the message, and key which is a key value whose meaning is defined by
112                         the derived class. The MessageQueue class provides methods for finding
113                         messages by both type and key.
114                     
115                         The Message class also provides previous and next pointers which are
116                         used to place the messages on a queue by the MessageQueue class.
117                     */
118 mike           1.5  class PEGASUS_COMMON_LINKAGE Message
119 mike           1.4  {
120 mday           1.8     public:
121 mike           1.4  
122 mday           1.8        Message(
123 mday           1.20 	 Uint32 type,
124                     	 Uint32 destination = 0,
125 chip           1.24 	 Uint32 key = getNextKey(),
126 mday           1.8  	 Uint32 routing_code = 0,
127 chip           1.24 	 Uint32 mask = message_mask::type_legacy )
128                     	 :
129                     	 _type(type),
130                     	 _key(key),
131                     	 _routing_code(routing_code),
132 mday           1.8  	 _mask(mask),
133 kumpf          1.45          _httpMethod (HTTP_METHOD__POST),
134 mday           1.44 	_last_thread_id(pegasus_thread_self()),
135 chip           1.24 	 _next(0),
136 mday           1.19 	 _prev(0),
137 mday           1.20 	 _async(0),
138 brian.campbell 1.55 	 dest(destination),
139                     	 _isComplete(true), 
140                     	 _index(0)
141 chip           1.24       {
142 mday           1.8  
143                           }
144 mike           1.6  
145 mday           1.32       Message & operator = ( const Message & msg)
146                           {
147                     	 if (this != &msg)
148                     	 {
149                     	    _type = msg._type;
150                     	    _key = msg._key;
151                     	    _routing_code = msg._routing_code;
152                     	    _mask = msg._mask;
153 mday           1.44 	    _last_thread_id = msg._last_thread_id;
154 mday           1.32 	    _next = _prev = _async = 0;
155                     	    dest = msg.dest;
156 brian.campbell 1.55 			_httpMethod = msg._httpMethod;
157                     			_index = msg._index;
158                     			_isComplete = msg._isComplete;
159 mday           1.44 	    
160 mday           1.32 	 }
161                     	 return *this;
162                           }
163 chip           1.34 
164 chip           1.24 
165                           virtual ~Message();
166 mike           1.4  
167 mday           1.8        Uint32 getType() const { return _type; }
168 mike           1.4  
169 mday           1.8        void setType(Uint32 type) { _type = type; }
170 mike           1.4  
171 mday           1.8        Uint32 getKey() const { return _key; }
172 mike           1.4  
173 mday           1.8        void setKey(Uint32 key) { _key = key; }
174 mike           1.4  
175 mday           1.8        Uint32 getRouting() const { return _routing_code; }
176                           void setRouting(Uint32 routing) { _routing_code = routing; }
177 mike           1.4  
178 mday           1.8        Uint32 getMask() const { return _mask; }
179 chip           1.24 
180 mday           1.8        void setMask(Uint32 mask) { _mask = mask; }
181 chip           1.24 
182 kumpf          1.40       HttpMethod getHttpMethod() const { return _httpMethod; }
183                     
184                           void setHttpMethod(HttpMethod httpMethod) {_httpMethod = httpMethod;}
185                     
186 sage           1.31 #ifdef PEGASUS_HAS_PERFINST
187 sage           1.30 //
188                     // Needed for performance measurement
189                     //
190                     
191                           void startServer();
192                     
193                           void endServer();
194                     
195                           void startProvider();
196                     
197                           void endProvider();
198                     
199 w.white        1.52       CIMDateTime getStartServerTime() const { return _timeServerStart; }
200 sage           1.30 
201 w.white        1.52       void setStartServerTime(CIMDateTime timeServerStart)
202 sage           1.30       {
203                                _timeServerStart = timeServerStart;
204                           }
205                     
206 w.white        1.52       CIMDateTime getStartProviderTime() const { return _timeProviderStart; }
207 sage           1.30 
208 w.white        1.52       void setStartProviderTime(CIMDateTime timeProviderStart)
209 sage           1.30       {
210                               _timeProviderStart = timeProviderStart;
211                           }
212                     
213 w.white        1.52       CIMDateTime getEndServerTime() const { return _timeServerEnd; }
214 sage           1.30 
215 w.white        1.52       void setEndServerTime (CIMDateTime timeServerEnd)
216 sage           1.30       {
217                               _timeServerEnd = timeServerEnd;
218                           }
219                     
220 w.white        1.52       CIMDateTime getEndProviderTime() const { return _timeProviderEnd; }
221 sage           1.30 
222 w.white        1.52       void setEndProviderTime(CIMDateTime timeProviderEnd)
223 sage           1.30       {
224                               _timeProviderEnd = timeProviderEnd;
225                           }
226                     
227 w.white        1.52 	  CIMDateTime getProviderTime() { return _providerTime;}
228                     
229                           CIMDateTime getTotalTime() { return _totalTime; }
230                     
231                     	  CIMDateTime getServerTime() { return _serverTime; }
232 sage           1.30 //
233 sage           1.31 #endif
234 sage           1.30 
235 mday           1.8        Message* getNext() { return _next; }
236 mike           1.4  
237 mday           1.8        const Message* getNext() const { return _next; }
238 mike           1.4  
239 mday           1.8        Message* getPrevious() { return _prev; }
240 mike           1.4  
241 mday           1.8        const Message* getPrevious() const { return _prev; }
242 mike           1.4  
243 chip           1.24       static Uint32 getNextKey()
244                           {
245                     	
246                     	 _mut.lock( pegasus_thread_self() ) ;
247 mike           1.6  	 Uint32 ret = _nextKey++;
248                     	 _mut.unlock();
249                     	 return ret;
250                           }
251 chip           1.24 
252 mike           1.36       virtual void print(
253                     	  PEGASUS_STD(ostream)& os, 
254                     	  Boolean printHeader = true) const;
255 mike           1.4  
256 chip           1.24       // << Thu Dec 27 10:46:04 2001 mdd >> for use with DQueue container
257                           // as used by AsyncOpNode
258 kumpf          1.23       Boolean operator == (const void *msg )
259 mday           1.13       {
260 mday           1.16 	 if (reinterpret_cast<void *>(this) == msg )
261 mday           1.13 	    return true;
262                     	 return false;
263                           }
264 chip           1.24 
265 mday           1.22       Message *get_async(void)
266                           {
267                     	 Message *ret = _async;
268                     	 _async = 0;
269                     	 return ret;
270 chip           1.24 	
271 mday           1.22       }
272 chip           1.24 
273 mday           1.22       void put_async(Message * msg)
274                           {
275                     	 _async = msg;
276                           }
277 chip           1.24 
278 mday           1.44       // << Tue Jul  1 11:02:49 2003 mdd >> pep_88 and helper for i18n and l10n
279                           Boolean thread_changed(void)
280                           {
281                     	 if(_last_thread_id != pegasus_thread_self())
282                     	 {
283                     	    _last_thread_id = pegasus_thread_self();
284                     	    return true;
285                     	 }
286                     
287                     	 return false;
288                           }
289                           
290                           // << Tue Jul  1 13:41:02 2003 mdd >> pep_88 - 
291                           // assist in synchronizing responses with requests
292                     
293                           void synch_response(Message *req)
294                           {
295                     	 _key = req->_key;
296                     	 _routing_code = req->_routing_code;
297                           }
298                           
299 brian.campbell 1.55 			// set the message index indicating what piece (or sequence) this is
300                     			// message indexes start at zero
301                     			void setIndex(Uint32 index) { _index = index; }
302                     
303                     			// increment the message index
304                     			void incrementIndex() { _index++; }
305                     
306                     			// set the complete flag indicating if this message piece is the 
307                     			// last or not
308                     			void setComplete(Boolean isComplete) 
309                     				{ _isComplete = isComplete ? true:false; }
310                     
311                     			// get the message index (or sequence number)
312                     			Uint32 getIndex() const { return _index; }
313                     
314                     			// is this the first piece of the message ?
315                     			Boolean isFirst() const { return _index == 0 ? true : false; }
316                     
317                     			// is this message complete? (i.e the last in a one or more sequence)
318                     			Boolean isComplete() const { return _isComplete; }
319 chip           1.24 
320 mday           1.8     private:
321 mike           1.6        Uint32 _type;
322                           Uint32 _key;
323 mday           1.8        Uint32 _routing_code;
324 mike           1.6        Uint32 _mask;
325 kumpf          1.40       HttpMethod _httpMethod;
326 sage           1.30 // Needed for performance measurement
327 w.white        1.52       CIMDateTime _timeServerStart;
328                           CIMDateTime _timeServerEnd;
329                           CIMDateTime _timeProviderStart;
330                           CIMDateTime _timeProviderEnd;
331                     	  CIMDateTime _providerTime;
332                     	  CIMDateTime _serverTime;	
333                           CIMDateTime _totalTime;
334 sage           1.30 //
335 mday           1.44 
336                           // << Tue Jul  1 11:02:35 2003 mdd >> pep_88 and helper for i18n and l10n
337                           PEGASUS_THREAD_TYPE _last_thread_id;
338                           
339 mike           1.6        Message* _next;
340                           Message* _prev;
341 mday           1.32 
342 mday           1.19    protected:
343 mday           1.32 
344                        public:
345 mday           1.19       Message *_async;
346 mday           1.20       Uint32 dest;
347 mday           1.19    private:
348 mike           1.6        MessageQueue* _owner;
349 brian.campbell 1.55       Boolean _isComplete;
350                           Uint32 _index;
351 mike           1.6        static Uint32 _nextKey;
352                           static Mutex _mut;
353 mday           1.44 
354                     
355                     
356 mday           1.20       friend class cimom;
357 mike           1.6        friend class MessageQueue;
358 mday           1.19       friend class MessageQueueService;
359                           friend class AsyncLegacyOperationStart;
360                           friend class AsyncLegacyOperationResult;
361 chip           1.24 
362 mike           1.4  };
363 mike           1.5  
364 mike           1.6  
365 mike           1.5  enum MessageType
366                     {
367                         DUMMY_MESSAGE,
368                     
369                         // CIM Message types:
370                     
371                         CIM_GET_CLASS_REQUEST_MESSAGE,
372                         CIM_GET_INSTANCE_REQUEST_MESSAGE,
373 mike           1.6      CIM_EXPORT_INDICATION_REQUEST_MESSAGE,
374 mike           1.5      CIM_DELETE_CLASS_REQUEST_MESSAGE,
375                         CIM_DELETE_INSTANCE_REQUEST_MESSAGE,
376                         CIM_CREATE_CLASS_REQUEST_MESSAGE,
377                         CIM_CREATE_INSTANCE_REQUEST_MESSAGE,
378                         CIM_MODIFY_CLASS_REQUEST_MESSAGE,
379                         CIM_MODIFY_INSTANCE_REQUEST_MESSAGE,
380 mday           1.32     CIM_ENUMERATE_CLASSES_REQUEST_MESSAGE, //10
381 mike           1.5      CIM_ENUMERATE_CLASS_NAMES_REQUEST_MESSAGE,
382                         CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE,
383                         CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE,
384                         CIM_EXEC_QUERY_REQUEST_MESSAGE,
385                         CIM_ASSOCIATORS_REQUEST_MESSAGE,
386                         CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE,
387                         CIM_REFERENCES_REQUEST_MESSAGE,
388                         CIM_REFERENCE_NAMES_REQUEST_MESSAGE,
389                         CIM_GET_PROPERTY_REQUEST_MESSAGE,
390 mday           1.32     CIM_SET_PROPERTY_REQUEST_MESSAGE, //20
391 mike           1.5      CIM_GET_QUALIFIER_REQUEST_MESSAGE,
392                         CIM_SET_QUALIFIER_REQUEST_MESSAGE,
393                         CIM_DELETE_QUALIFIER_REQUEST_MESSAGE,
394                         CIM_ENUMERATE_QUALIFIERS_REQUEST_MESSAGE,
395                         CIM_INVOKE_METHOD_REQUEST_MESSAGE,
396 mike           1.6      CIM_ENABLE_INDICATION_SUBSCRIPTION_REQUEST_MESSAGE,
397                         CIM_MODIFY_INDICATION_SUBSCRIPTION_REQUEST_MESSAGE,
398                         CIM_DISABLE_INDICATION_SUBSCRIPTION_REQUEST_MESSAGE,
399 kumpf          1.15     CIM_PROCESS_INDICATION_REQUEST_MESSAGE,
400 mday           1.32     CIM_HANDLE_INDICATION_REQUEST_MESSAGE, // 30
401 kumpf          1.15     CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE,
402                         CIM_NOTIFY_PROVIDER_TERMINATION_REQUEST_MESSAGE,
403 chip           1.25 
404                         // new
405 chip           1.26     CIM_ENABLE_INDICATIONS_REQUEST_MESSAGE,
406                         CIM_DISABLE_INDICATIONS_REQUEST_MESSAGE,
407 chip           1.25     CIM_CREATE_SUBSCRIPTION_REQUEST_MESSAGE,
408                         CIM_MODIFY_SUBSCRIPTION_REQUEST_MESSAGE,
409                         CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE,
410                     
411 kumpf          1.29     // new
412                         CIM_DISABLE_MODULE_REQUEST_MESSAGE,
413                         CIM_ENABLE_MODULE_REQUEST_MESSAGE,
414                     
415 kumpf          1.43     CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE,  // 40
416 kumpf          1.35 
417 kumpf          1.43     CIM_GET_CLASS_RESPONSE_MESSAGE,
418 mike           1.5      CIM_GET_INSTANCE_RESPONSE_MESSAGE,
419 kumpf          1.43     CIM_EXPORT_INDICATION_RESPONSE_MESSAGE,
420 mike           1.5      CIM_DELETE_CLASS_RESPONSE_MESSAGE,
421                         CIM_DELETE_INSTANCE_RESPONSE_MESSAGE,
422                         CIM_CREATE_CLASS_RESPONSE_MESSAGE,
423                         CIM_CREATE_INSTANCE_RESPONSE_MESSAGE,
424                         CIM_MODIFY_CLASS_RESPONSE_MESSAGE,
425                         CIM_MODIFY_INSTANCE_RESPONSE_MESSAGE,
426 kumpf          1.43     CIM_ENUMERATE_CLASSES_RESPONSE_MESSAGE,  // 50
427 mike           1.5      CIM_ENUMERATE_CLASS_NAMES_RESPONSE_MESSAGE,
428                         CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE,
429                         CIM_ENUMERATE_INSTANCE_NAMES_RESPONSE_MESSAGE,
430                         CIM_EXEC_QUERY_RESPONSE_MESSAGE,
431                         CIM_ASSOCIATORS_RESPONSE_MESSAGE,
432                         CIM_ASSOCIATOR_NAMES_RESPONSE_MESSAGE,
433                         CIM_REFERENCES_RESPONSE_MESSAGE,
434                         CIM_REFERENCE_NAMES_RESPONSE_MESSAGE,
435                         CIM_GET_PROPERTY_RESPONSE_MESSAGE,
436 kumpf          1.43     CIM_SET_PROPERTY_RESPONSE_MESSAGE,  // 60
437 mike           1.5      CIM_GET_QUALIFIER_RESPONSE_MESSAGE,
438                         CIM_SET_QUALIFIER_RESPONSE_MESSAGE,
439                         CIM_DELETE_QUALIFIER_RESPONSE_MESSAGE,
440                         CIM_ENUMERATE_QUALIFIERS_RESPONSE_MESSAGE,
441                         CIM_INVOKE_METHOD_RESPONSE_MESSAGE,
442 mike           1.6      CIM_ENABLE_INDICATION_SUBSCRIPTION_RESPONSE_MESSAGE,
443                         CIM_MODIFY_INDICATION_SUBSCRIPTION_RESPONSE_MESSAGE,
444                         CIM_DISABLE_INDICATION_SUBSCRIPTION_RESPONSE_MESSAGE,
445 kumpf          1.15     CIM_PROCESS_INDICATION_RESPONSE_MESSAGE,
446 kumpf          1.43     CIM_NOTIFY_PROVIDER_REGISTRATION_RESPONSE_MESSAGE,  // 70
447 kumpf          1.15     CIM_NOTIFY_PROVIDER_TERMINATION_RESPONSE_MESSAGE,
448 kumpf          1.17     CIM_HANDLE_INDICATION_RESPONSE_MESSAGE,
449 mike           1.6  
450 chip           1.25     // new
451 chip           1.26     CIM_ENABLE_INDICATIONS_RESPONSE_MESSAGE,
452                         CIM_DISABLE_INDICATIONS_RESPONSE_MESSAGE,
453 chip           1.25     CIM_CREATE_SUBSCRIPTION_RESPONSE_MESSAGE,
454                         CIM_MODIFY_SUBSCRIPTION_RESPONSE_MESSAGE,
455                         CIM_DELETE_SUBSCRIPTION_RESPONSE_MESSAGE,
456 kumpf          1.29 
457                         // new
458                         CIM_DISABLE_MODULE_RESPONSE_MESSAGE,
459                         CIM_ENABLE_MODULE_RESPONSE_MESSAGE,
460 kumpf          1.35 
461 kumpf          1.43     CIM_STOP_ALL_PROVIDERS_RESPONSE_MESSAGE,  // 80
462 chip           1.24 
463 mike           1.6      // Monitor-related messages:
464                     
465                         SOCKET_MESSAGE,
466                     
467                         // Connection-oriented messages:
468                     
469                         CLOSE_CONNECTION_MESSAGE,
470                     
471                         // HTTP messages:
472                     
473                         HTTP_MESSAGE,
474 kumpf          1.27     HTTP_ERROR_MESSAGE,
475 kumpf          1.28 
476                         // Exception messages to be passed to a CIM client application:
477                     
478                         CLIENT_EXCEPTION_MESSAGE,
479 mike           1.5  
480 mday           1.33     ASYNC_REGISTER_CIM_SERVICE,
481                         ASYNC_DEREGISTER_CIM_SERVICE,
482                         ASYNC_UPDATE_CIM_SERVICE,
483                         ASYNC_IOCTL,
484 kumpf          1.43     ASYNC_CIMSERVICE_START,  // 90
485 mday           1.33     ASYNC_CIMSERVICE_STOP,
486                         ASYNC_CIMSERVICE_PAUSE,
487                         ASYNC_CIMSERVICE_RESUME,
488                     
489                         ASYNC_ASYNC_OP_START,
490                         ASYNC_ASYNC_OP_RESULT,
491                         ASYNC_ASYNC_LEGACY_OP_START,
492 chip           1.34     ASYNC_ASYNC_LEGACY_OP_RESULT,
493                     
494 mday           1.33     ASYNC_FIND_SERVICE_Q,
495                         ASYNC_FIND_SERVICE_Q_RESULT,
496 kumpf          1.43     ASYNC_ENUMERATE_SERVICE,  // 100
497 mday           1.33     ASYNC_ENUMERATE_SERVICE_RESULT,
498 chip           1.34 
499 mday           1.33     ASYNC_REGISTERED_MODULE,
500                         ASYNC_DEREGISTERED_MODULE,
501                         ASYNC_FIND_MODULE_IN_SERVICE,
502                         ASYNC_FIND_MODULE_IN_SERVICE_RESPONSE,
503 chip           1.34 
504 mday           1.33     ASYNC_ASYNC_MODULE_OP_START,
505                         ASYNC_ASYNC_MODULE_OP_RESULT,
506                     
507 kumpf          1.53     CIM_NOTIFY_PROVIDER_ENABLE_REQUEST_MESSAGE,
508                         CIM_NOTIFY_PROVIDER_ENABLE_RESPONSE_MESSAGE,
509                     
510                         CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE,
511 w.white        1.52     CIM_INITIALIZE_PROVIDER_RESPONSE_MESSAGE,
512                     
513 kumpf          1.53     CIM_INITIALIZE_PROVIDER_AGENT_REQUEST_MESSAGE,
514                         CIM_INITIALIZE_PROVIDER_AGENT_RESPONSE_MESSAGE,
515 kumpf          1.47 
516 kumpf          1.54     CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE,
517                         CIM_NOTIFY_CONFIG_CHANGE_RESPONSE_MESSAGE,
518                     
519 mike           1.5      NUMBER_OF_MESSAGES
520                     };
521                     
522                     PEGASUS_COMMON_LINKAGE const char* MessageTypeToString(Uint32 messageType);
523 mike           1.6  
524                     /** This class implements a stack of queue-ids. Many messages must keep a
525                         stack of queue-ids of queues which they must be returned to. This provides
526                         a light efficient stack for this purpose.
527                     */
528                     class QueueIdStack
529                     {
530                     public:
531                     
532 chip           1.24     QueueIdStack() : _size(0)
533                         {
534 mike           1.6      }
535                     
536 chip           1.24     QueueIdStack(const QueueIdStack& x) : _size(x._size)
537 mike           1.6      {
538                     	memcpy(_items, x._items, sizeof(_items));
539                         }
540                     
541 chip           1.24     PEGASUS_EXPLICIT QueueIdStack(Uint32 x) : _size(0)
542                         {
543                     	push(x);
544 mike           1.6      }
545                     
546 chip           1.24     PEGASUS_EXPLICIT QueueIdStack(Uint32 x1, Uint32 x2) : _size(0)
547 mike           1.6      {
548 chip           1.24 	push(x1);
549                     	push(x2);
550 mike           1.6      }
551                     
552 chip           1.24     ~QueueIdStack()
553                         {
554 mike           1.6      }
555                     
556 chip           1.24     QueueIdStack& operator=(const QueueIdStack& x)
557 mike           1.6      {
558                     	if (this != &x)
559                     	{
560                     	    memcpy(_items, x._items, sizeof(_items));
561                     	    _size = x._size;
562                     	}
563                     	return *this;
564                         }
565                     
566 chip           1.24     Uint32 size() const
567                         {
568                     	return _size;
569 mike           1.6      }
570                     
571 chip           1.24     Boolean isEmpty() const
572                         {
573                     	return _size == 0;
574 mike           1.6      }
575                     
576 chip           1.24     void push(Uint32 x)
577 mike           1.6      {
578                     	if (_size == MAX_SIZE)
579                     	    throw StackOverflow();
580                     
581                     	_items[_size++] = x;
582                         }
583                     
584                         Uint32& top()
585                         {
586                     	if (_size == 0)
587                     	    throw StackUnderflow();
588                     
589                     	return _items[_size-1];
590                         }
591                     
592 chip           1.24     Uint32 top() const
593 mike           1.6      {
594 chip           1.24 	return ((QueueIdStack*)this)->top();
595 mike           1.6      }
596                     
597 chip           1.24     void pop()
598 mike           1.6      {
599                     	if (_size == 0)
600                     	    throw StackUnderflow();
601                     
602                     	_size--;
603                         }
604                     
605                         /** Make a copy of this stack and then pop the top element. */
606                         QueueIdStack copyAndPop() const
607                         {
608                     	return QueueIdStack(*this, 0);
609                         }
610                     
611                     private:
612                     
613                         // Copy the given stack but then pop the top element:
614 chip           1.24     QueueIdStack(const QueueIdStack& x, int) : _size(x._size)
615 mike           1.6      {
616                     	memcpy(_items, x._items, sizeof(_items));
617                     	pop();
618                         }
619                     
620                         enum { MAX_SIZE = 5 };
621                         Uint32 _items[MAX_SIZE];
622                         Uint32 _size;
623                     };
624 mike           1.4  
625                     PEGASUS_NAMESPACE_END
626                     
627                     #endif /* Pegasus_Message_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2