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

  1 karl  1.72 //%2006////////////////////////////////////////////////////////////////////////
  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 karl  1.72 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12            // EMC Corporation; Symantec Corporation; The Open Group.
 13 mike  1.4  //
 14            // Permission is hereby granted, free of charge, to any person obtaining a copy
 15 chip  1.24 // of this software and associated documentation files (the "Software"), to
 16            // deal in the Software without restriction, including without limitation the
 17            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 18 mike  1.4  // sell copies of the Software, and to permit persons to whom the Software is
 19            // furnished to do so, subject to the following conditions:
 20 kamal.locahana 1.85.14.1 //
 21 chip           1.24      // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22 mike           1.4       // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 23                          // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 24 chip           1.24      // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 25                          // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 26                          // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 27 mike           1.4       // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 28                          // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 29                          //
 30                          //==============================================================================
 31                          //
 32                          //%/////////////////////////////////////////////////////////////////////////////
 33                          
 34                          #ifndef Pegasus_Message_h
 35                          #define Pegasus_Message_h
 36                          
 37 mike           1.6       #include <Pegasus/Common/Config.h>
 38 mike           1.4       #include <iostream>
 39 mike           1.6       #include <cstring>
 40 kumpf          1.39      #include <Pegasus/Common/InternalException.h>
 41 kumpf          1.38      #include <Pegasus/Common/Linkage.h>
 42 w.white        1.68      #include <Pegasus/Common/TimeValue.h>
 43 w.white        1.63      #include <Pegasus/Common/CIMOperationType.h>
 44 kumpf          1.81      #include <Pegasus/Common/Threads.h>
 45 mike           1.76      #include <Pegasus/Common/Linkable.h>
 46 mike           1.4       
 47                          PEGASUS_NAMESPACE_BEGIN
 48                          
 49 kumpf          1.83      class PEGASUS_COMMON_LINKAGE MessageMask
 50 mike           1.6       {
 51 kumpf          1.83      public:
 52                              // Message type is indicated by the low order 20 bits.  For example:
 53                              // Uint32 messageType = flags & 0x000fffff;
 54                              static Uint32 type_legacy;
 55                              static Uint32 type_cimom;
 56                              static Uint32 type_service;
 57                          
 58                              // Message handling is indicated by the high order 12 bits.  For example:
 59                              // Uint32 messageHandling = flags & 0xfff00000;
 60                              static Uint32 ha_request;
 61                              static Uint32 ha_reply;
 62                              static Uint32 ha_async;
 63 mike           1.6       };
 64                          
 65 kumpf          1.40      enum HttpMethod
 66                          {
 67                              HTTP_METHOD__POST,
 68                              HTTP_METHOD_M_POST
 69                          };
 70                          
 71 chip           1.24      /** The Message class and derived classes are used to pass messages between
 72 mike           1.4           modules. Messages are passed between modules using the message queues
 73                              (see MessageQueue class). Derived classes may add their own fields.
 74 kumpf          1.78          This base class defines a common type field, which is the type of
 75                              the message.
 76 mike           1.4       */
 77 mike           1.76      class PEGASUS_COMMON_LINKAGE Message : public Linkable
 78 mike           1.4       {
 79 mday           1.8          public:
 80 mike           1.4       
 81 mday           1.8             Message(
 82 kamal.locahana 1.85.14.1      Uint32 type,
 83                               Uint32 destination = 0,
 84                               Uint32 mask = MessageMask::type_legacy)
 85                               :
 86                               _type(type),
 87                               _mask(mask),
 88 kumpf          1.45               _httpMethod (HTTP_METHOD__POST),
 89 kumpf          1.84               _serverStartTimeMicroseconds(0),
 90                                   _providerTimeMicroseconds(0),
 91                                   _totalServerTimeMicroseconds(0),
 92 j.alex         1.70               _close_connect(false),
 93 kamal.locahana 1.85.14.1      _last_thread_id(Threads::self()),
 94                               _async(0),
 95                               dest(destination),
 96                               _isComplete(true),
 97                               _index(0)
 98 chip           1.24            {
 99 mday           1.8             }
100 mike           1.6       
101 kumpf          1.85            virtual ~Message();
102 chip           1.34      
103 kumpf          1.85            // NOTE: The compiler default implementation of the copy constructor
104                                // is used for this class.
105 chip           1.24      
106 j.alex         1.70            Boolean getCloseConnect() const { return _close_connect; }
107                                void setCloseConnect(Boolean close_connect)
108                                {
109                                    _close_connect = close_connect;
110                                }
111 mike           1.4       
112 mday           1.8             Uint32 getType() const { return _type; }
113 mike           1.4       
114 mday           1.8             void setType(Uint32 type) { _type = type; }
115 mike           1.4       
116 mday           1.8             Uint32 getMask() const { return _mask; }
117 chip           1.24      
118 mday           1.8             void setMask(Uint32 mask) { _mask = mask; }
119 chip           1.24      
120 kumpf          1.40            HttpMethod getHttpMethod() const { return _httpMethod; }
121                          
122                                void setHttpMethod(HttpMethod httpMethod) {_httpMethod = httpMethod;}
123                          
124 kamal.locahana 1.85.14.1 
125 karl           1.61      #ifndef PEGASUS_DISABLE_PERFINST
126 sage           1.30      //
127                          // Needed for performance measurement
128                          //
129                          
130 kumpf          1.84            Uint64 getServerStartTime() const
131                                {
132                                    return _serverStartTimeMicroseconds;
133                                }
134                          
135                                void setServerStartTime(Uint64 serverStartTimeMicroseconds)
136                                {
137                                     _serverStartTimeMicroseconds = serverStartTimeMicroseconds;
138                                }
139 sage           1.30      
140                                void endServer();
141                          
142 kumpf          1.84            Uint64 getProviderTime() const
143 sage           1.30            {
144 kumpf          1.84                return _providerTimeMicroseconds;
145 sage           1.30            }
146                          
147 kumpf          1.84            void setProviderTime(Uint64 providerTimeMicroseconds)
148 sage           1.30            {
149 kumpf          1.84                _providerTimeMicroseconds = providerTimeMicroseconds;
150 sage           1.30            }
151                          
152 kumpf          1.84            Uint64 getTotalServerTime() const
153 sage           1.30            {
154 kumpf          1.84                return _totalServerTimeMicroseconds;
155 sage           1.30            }
156                          
157 kumpf          1.84            void setTotalServerTime(Uint64 totalServerTimeMicroseconds)
158 sage           1.30            {
159 kumpf          1.84                _totalServerTimeMicroseconds = totalServerTimeMicroseconds;
160 sage           1.30            }
161                          
162 sage           1.31      #endif
163 sage           1.30      
164 a.dunfey       1.67            static CIMOperationType convertMessageTypetoCIMOpType(Uint32 type);
165 w.white        1.63      
166 joyce.j        1.69      #ifdef PEGASUS_DEBUG
167 mike           1.36            virtual void print(
168 kamal.locahana 1.85.14.1       PEGASUS_STD(ostream)& os,
169                                Boolean printHeader = true) const;
170 joyce.j        1.69      #endif
171 mike           1.4       
172 mday           1.22            Message *get_async(void)
173                                {
174 kamal.locahana 1.85.14.1      Message *ret = _async;
175                               _async = 0;
176                               return ret;
177 mday           1.22            }
178 chip           1.24      
179 mday           1.22            void put_async(Message * msg)
180                                {
181 kamal.locahana 1.85.14.1      _async = msg;
182 mday           1.22            }
183 chip           1.24      
184 mday           1.44            // << Tue Jul  1 11:02:49 2003 mdd >> pep_88 and helper for i18n and l10n
185                                Boolean thread_changed(void)
186                                {
187 kamal.locahana 1.85.14.1      if (!Threads::equal(_last_thread_id, Threads::self()))
188                               {
189                                  _last_thread_id = Threads::self();
190                                  return true;
191                               }
192                          
193                               return false;
194                                }
195                          
196                                      // set the message index indicating what piece (or sequence) this is
197                                      // message indexes start at zero
198                                      void setIndex(Uint32 index) { _index = index; }
199 brian.campbell 1.55      
200 kamal.locahana 1.85.14.1             // increment the message index
201                                      void incrementIndex() { _index++; }
202 brian.campbell 1.55      
203 kamal.locahana 1.85.14.1             // set the complete flag indicating if this message piece is the
204                                      // last or not
205                                      void setComplete(Boolean isComplete)
206                                          { _isComplete = isComplete ? true:false; }
207 brian.campbell 1.55      
208 kamal.locahana 1.85.14.1             // get the message index (or sequence number)
209                                      Uint32 getIndex() const { return _index; }
210                          
211                                      // is this the first piece of the message ?
212                                      Boolean isFirst() const { return _index == 0 ? true : false; }
213                          
214                                      // is this message complete? (i.e the last in a one or more sequence)
215                                      Boolean isComplete() const { return _isComplete; }
216 chip           1.24      
217 mday           1.8          private:
218 mike           1.6             Uint32 _type;
219                                Uint32 _mask;
220 kumpf          1.40            HttpMethod _httpMethod;
221 kumpf          1.84      
222                                // Needed for performance measurement
223                                Uint64 _serverStartTimeMicroseconds;
224                                Uint64 _providerTimeMicroseconds;
225                                Uint64 _totalServerTimeMicroseconds;
226                          
227 kamal.locahana 1.85.14.1       Boolean   _close_connect;
228 j.alex         1.70      
229 mday           1.44            // << Tue Jul  1 11:02:35 2003 mdd >> pep_88 and helper for i18n and l10n
230 mike           1.80            ThreadType _last_thread_id;
231 mday           1.32      
232                             public:
233 mday           1.19            Message *_async;
234 mday           1.20            Uint32 dest;
235 w.white        1.56      
236 mday           1.19         private:
237 kumpf          1.85            Message& operator=(const Message& msg);
238                          
239 brian.campbell 1.55            Boolean _isComplete;
240                                Uint32 _index;
241 mike           1.4       };
242 mike           1.5       
243 mike           1.6       
244 mike           1.5       enum MessageType
245                          {
246                              DUMMY_MESSAGE,
247                          
248                              // CIM Message types:
249                          
250                              CIM_GET_CLASS_REQUEST_MESSAGE,
251                              CIM_GET_INSTANCE_REQUEST_MESSAGE,
252 mike           1.6           CIM_EXPORT_INDICATION_REQUEST_MESSAGE,
253 mike           1.5           CIM_DELETE_CLASS_REQUEST_MESSAGE,
254                              CIM_DELETE_INSTANCE_REQUEST_MESSAGE,
255                              CIM_CREATE_CLASS_REQUEST_MESSAGE,
256                              CIM_CREATE_INSTANCE_REQUEST_MESSAGE,
257                              CIM_MODIFY_CLASS_REQUEST_MESSAGE,
258                              CIM_MODIFY_INSTANCE_REQUEST_MESSAGE,
259 mday           1.32          CIM_ENUMERATE_CLASSES_REQUEST_MESSAGE, //10
260 mike           1.5           CIM_ENUMERATE_CLASS_NAMES_REQUEST_MESSAGE,
261                              CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE,
262                              CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE,
263                              CIM_EXEC_QUERY_REQUEST_MESSAGE,
264                              CIM_ASSOCIATORS_REQUEST_MESSAGE,
265                              CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE,
266                              CIM_REFERENCES_REQUEST_MESSAGE,
267                              CIM_REFERENCE_NAMES_REQUEST_MESSAGE,
268                              CIM_GET_PROPERTY_REQUEST_MESSAGE,
269 mday           1.32          CIM_SET_PROPERTY_REQUEST_MESSAGE, //20
270 mike           1.5           CIM_GET_QUALIFIER_REQUEST_MESSAGE,
271                              CIM_SET_QUALIFIER_REQUEST_MESSAGE,
272                              CIM_DELETE_QUALIFIER_REQUEST_MESSAGE,
273                              CIM_ENUMERATE_QUALIFIERS_REQUEST_MESSAGE,
274                              CIM_INVOKE_METHOD_REQUEST_MESSAGE,
275 kumpf          1.15          CIM_PROCESS_INDICATION_REQUEST_MESSAGE,
276 kumpf          1.73          CIM_HANDLE_INDICATION_REQUEST_MESSAGE,
277 kumpf          1.75          CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE,
278 kumpf          1.15          CIM_NOTIFY_PROVIDER_TERMINATION_REQUEST_MESSAGE,
279 kumpf          1.75          CIM_CREATE_SUBSCRIPTION_REQUEST_MESSAGE,  // 30
280 chip           1.25          CIM_MODIFY_SUBSCRIPTION_REQUEST_MESSAGE,
281                              CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE,
282 kumpf          1.29          CIM_DISABLE_MODULE_REQUEST_MESSAGE,
283                              CIM_ENABLE_MODULE_REQUEST_MESSAGE,
284 carolann.graves 1.64          CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE,
285 kumpf           1.35      
286 kumpf           1.43          CIM_GET_CLASS_RESPONSE_MESSAGE,
287 kumpf           1.73          CIM_GET_INSTANCE_RESPONSE_MESSAGE,
288 kumpf           1.75          CIM_EXPORT_INDICATION_RESPONSE_MESSAGE,
289 mike            1.5           CIM_DELETE_CLASS_RESPONSE_MESSAGE,
290 kumpf           1.75          CIM_DELETE_INSTANCE_RESPONSE_MESSAGE,  // 40
291 mike            1.5           CIM_CREATE_CLASS_RESPONSE_MESSAGE,
292                               CIM_CREATE_INSTANCE_RESPONSE_MESSAGE,
293                               CIM_MODIFY_CLASS_RESPONSE_MESSAGE,
294                               CIM_MODIFY_INSTANCE_RESPONSE_MESSAGE,
295 carolann.graves 1.64          CIM_ENUMERATE_CLASSES_RESPONSE_MESSAGE,
296 mike            1.5           CIM_ENUMERATE_CLASS_NAMES_RESPONSE_MESSAGE,
297 kumpf           1.73          CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE,
298 kumpf           1.75          CIM_ENUMERATE_INSTANCE_NAMES_RESPONSE_MESSAGE,
299 mike            1.5           CIM_EXEC_QUERY_RESPONSE_MESSAGE,
300 kumpf           1.75          CIM_ASSOCIATORS_RESPONSE_MESSAGE,  // 50
301 mike            1.5           CIM_ASSOCIATOR_NAMES_RESPONSE_MESSAGE,
302                               CIM_REFERENCES_RESPONSE_MESSAGE,
303                               CIM_REFERENCE_NAMES_RESPONSE_MESSAGE,
304                               CIM_GET_PROPERTY_RESPONSE_MESSAGE,
305 carolann.graves 1.64          CIM_SET_PROPERTY_RESPONSE_MESSAGE,
306 mike            1.5           CIM_GET_QUALIFIER_RESPONSE_MESSAGE,
307 kumpf           1.73          CIM_SET_QUALIFIER_RESPONSE_MESSAGE,
308 kumpf           1.75          CIM_DELETE_QUALIFIER_RESPONSE_MESSAGE,
309 mike            1.5           CIM_ENUMERATE_QUALIFIERS_RESPONSE_MESSAGE,
310 kumpf           1.75          CIM_INVOKE_METHOD_RESPONSE_MESSAGE,  // 60
311 kumpf           1.15          CIM_PROCESS_INDICATION_RESPONSE_MESSAGE,
312 carolann.graves 1.64          CIM_NOTIFY_PROVIDER_REGISTRATION_RESPONSE_MESSAGE,
313 kumpf           1.15          CIM_NOTIFY_PROVIDER_TERMINATION_RESPONSE_MESSAGE,
314 kumpf           1.73          CIM_HANDLE_INDICATION_RESPONSE_MESSAGE,
315 chip            1.25          CIM_CREATE_SUBSCRIPTION_RESPONSE_MESSAGE,
316 kumpf           1.75          CIM_MODIFY_SUBSCRIPTION_RESPONSE_MESSAGE,
317 chip            1.25          CIM_DELETE_SUBSCRIPTION_RESPONSE_MESSAGE,
318 kumpf           1.29          CIM_DISABLE_MODULE_RESPONSE_MESSAGE,
319                               CIM_ENABLE_MODULE_RESPONSE_MESSAGE,
320 kumpf           1.75          CIM_STOP_ALL_PROVIDERS_RESPONSE_MESSAGE,  // 70
321 chip            1.24      
322 mike            1.6           // Monitor-related messages:
323                           
324                               SOCKET_MESSAGE,
325                           
326                               // Connection-oriented messages:
327                           
328                               CLOSE_CONNECTION_MESSAGE,
329                           
330                               // HTTP messages:
331                           
332                               HTTP_MESSAGE,
333 kumpf           1.73          HTTP_ERROR_MESSAGE,
334 kumpf           1.28      
335                               // Exception messages to be passed to a CIM client application:
336                           
337                               CLIENT_EXCEPTION_MESSAGE,
338 mike            1.5       
339 kumpf           1.75          ASYNC_REGISTER_CIM_SERVICE,
340 mday            1.33          ASYNC_DEREGISTER_CIM_SERVICE,
341                               ASYNC_UPDATE_CIM_SERVICE,
342                               ASYNC_IOCTL,
343 kumpf           1.75          ASYNC_CIMSERVICE_START,  // 80
344 mday            1.33          ASYNC_CIMSERVICE_STOP,
345                               ASYNC_CIMSERVICE_PAUSE,
346                               ASYNC_CIMSERVICE_RESUME,
347                           
348 kumpf           1.73          ASYNC_ASYNC_OP_START,
349 mday            1.33          ASYNC_ASYNC_OP_RESULT,
350 kumpf           1.75          ASYNC_ASYNC_LEGACY_OP_START,
351 chip            1.34          ASYNC_ASYNC_LEGACY_OP_RESULT,
352                           
353 mday            1.33          ASYNC_FIND_SERVICE_Q,
354                               ASYNC_FIND_SERVICE_Q_RESULT,
355 kumpf           1.75          ASYNC_ENUMERATE_SERVICE,  // 90
356 mday            1.33          ASYNC_ENUMERATE_SERVICE_RESULT,
357 chip            1.34      
358 mday            1.33          ASYNC_REGISTERED_MODULE,
359                               ASYNC_DEREGISTERED_MODULE,
360 kumpf           1.73          ASYNC_FIND_MODULE_IN_SERVICE,
361 mday            1.33          ASYNC_FIND_MODULE_IN_SERVICE_RESPONSE,
362 chip            1.34      
363 kumpf           1.75          ASYNC_ASYNC_MODULE_OP_START,
364 mday            1.33          ASYNC_ASYNC_MODULE_OP_RESULT,
365                           
366 kumpf           1.53          CIM_NOTIFY_PROVIDER_ENABLE_REQUEST_MESSAGE,
367                               CIM_NOTIFY_PROVIDER_ENABLE_RESPONSE_MESSAGE,
368                           
369 kumpf           1.75          CIM_NOTIFY_PROVIDER_FAIL_REQUEST_MESSAGE,  // 100
370 carolann.graves 1.74          CIM_NOTIFY_PROVIDER_FAIL_RESPONSE_MESSAGE,
371                           
372 kumpf           1.53          CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE,
373 w.white         1.52          CIM_INITIALIZE_PROVIDER_RESPONSE_MESSAGE,
374                           
375 kumpf           1.53          CIM_INITIALIZE_PROVIDER_AGENT_REQUEST_MESSAGE,
376                               CIM_INITIALIZE_PROVIDER_AGENT_RESPONSE_MESSAGE,
377 kumpf           1.47      
378 kumpf           1.54          CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE,
379                               CIM_NOTIFY_CONFIG_CHANGE_RESPONSE_MESSAGE,
380                           
381 carolann.graves 1.64          CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE,
382                               CIM_SUBSCRIPTION_INIT_COMPLETE_RESPONSE_MESSAGE,
383                           
384 kamal.locahana  1.85.14.1 // Added for NamedPipe implementation for windows
385                           #if defined PEGASUS_OS_TYPE_WINDOWS && !defined(PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET)
386                               // Monitor-related messages:
387                               NAMEDPIPE_MESSAGE,
388                           #endif
389 mike            1.5           NUMBER_OF_MESSAGES
390                           };
391                           
392                           PEGASUS_COMMON_LINKAGE const char* MessageTypeToString(Uint32 messageType);
393 mike            1.6       
394                           /** This class implements a stack of queue-ids. Many messages must keep a
395                               stack of queue-ids of queues which they must be returned to. This provides
396                               a light efficient stack for this purpose.
397                           */
398 karl            1.60      class PEGASUS_COMMON_LINKAGE QueueIdStack
399 mike            1.6       {
400                           public:
401                           
402 chip            1.24          QueueIdStack() : _size(0)
403                               {
404 mike            1.6           }
405                           
406 karl            1.59          QueueIdStack(const QueueIdStack& x);
407 mike            1.6       
408 karl            1.59          PEGASUS_EXPLICIT QueueIdStack(Uint32 x);
409 mike            1.6       
410 karl            1.59          PEGASUS_EXPLICIT QueueIdStack(Uint32 x1, Uint32 x2);
411 mike            1.6       
412 chip            1.24          ~QueueIdStack()
413                               {
414 mike            1.6           }
415                           
416 karl            1.59          QueueIdStack& operator=(const QueueIdStack& x);
417 mike            1.6       
418 chip            1.24          Uint32 size() const
419                               {
420 kamal.locahana  1.85.14.1     return _size;
421 mike            1.6           }
422                           
423 chip            1.24          Boolean isEmpty() const
424                               {
425 kamal.locahana  1.85.14.1     return _size == 0;
426 mike            1.6           }
427                           
428 chip            1.24          void push(Uint32 x)
429 mike            1.6           {
430 karl            1.59      #ifdef PEGASUS_DEBUG
431 kamal.locahana  1.85.14.1     if (_size == MAX_SIZE)
432                                   throw StackOverflow();
433 karl            1.59      #endif
434 kamal.locahana  1.85.14.1     _items[_size++] = x;
435 mike            1.6           }
436                           
437                               Uint32& top()
438                               {
439 karl            1.59      #ifdef PEGASUS_DEBUG
440 kamal.locahana  1.85.14.1     if (_size == 0)
441                                   throw StackUnderflow();
442 karl            1.59      #endif
443 kamal.locahana  1.85.14.1     return _items[_size-1];
444 mike            1.6           }
445                           
446 chip            1.24          Uint32 top() const
447 mike            1.6           {
448 kamal.locahana  1.85.14.1     return ((QueueIdStack*)this)->top();
449 mike            1.6           }
450                           
451 chip            1.24          void pop()
452 mike            1.6           {
453 karl            1.59      #ifdef PEGASUS_DEBUG
454 kamal.locahana  1.85.14.1     if (_size == 0)
455                                   throw StackUnderflow();
456 karl            1.59      #endif
457 kamal.locahana  1.85.14.1     _size--;
458 mike            1.6           }
459                           
460                               /** Make a copy of this stack and then pop the top element. */
461 karl            1.59          QueueIdStack copyAndPop() const;
462 mike            1.6       
463                           private:
464                           
465                               // Copy the given stack but then pop the top element:
466 karl            1.59          QueueIdStack(const QueueIdStack& x, int);
467 mike            1.6       
468                               enum { MAX_SIZE = 5 };
469                               Uint32 _items[MAX_SIZE];
470                               Uint32 _size;
471                           };
472 mike            1.4       
473                           PEGASUS_NAMESPACE_END
474                           
475                           #endif /* Pegasus_Message_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2