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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2