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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2