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

  1 mike  1.4 //%/////////////////////////////////////////////////////////////////////////////
  2           //
  3           // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
  4           //
  5           // Permission is hereby granted, free of charge, to any person obtaining a copy
  6           // of this software and associated documentation files (the "Software"), to 
  7           // deal in the Software without restriction, including without limitation the 
  8           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 
  9           // sell copies of the Software, and to permit persons to whom the Software is
 10           // furnished to do so, subject to the following conditions:
 11           // 
 12           // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN 
 13           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 14           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 15           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
 16           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 17           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
 18           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 19           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 20           //
 21           //==============================================================================
 22 mike  1.4 //
 23           // Author: Mike Brasher (mbrasher@bmc.com)
 24           //
 25           // Modified By:
 26           //
 27           //%/////////////////////////////////////////////////////////////////////////////
 28           
 29           #ifndef Pegasus_Message_h
 30           #define Pegasus_Message_h
 31           
 32           #include <iostream>
 33           #include <Pegasus/Common/Config.h>
 34           
 35           PEGASUS_NAMESPACE_BEGIN
 36           
 37           class MessageQueue;
 38           
 39           /** The Message class and derived classes are used to pass messages between 
 40               modules. Messages are passed between modules using the message queues
 41               (see MessageQueue class). Derived classes may add their own fields.
 42               This base class defines two common fields: type, which is the type of
 43 mike  1.4     the message, and key which is a key value whose meaning is defined by
 44               the derived class. The MessageQueue class provides methods for finding
 45               messages by both type and key.
 46           
 47               The Message class also provides previous and next pointers which are
 48               used to place the messages on a queue by the MessageQueue class.
 49           */
 50 mike  1.5 class PEGASUS_COMMON_LINKAGE Message
 51 mike  1.4 {
 52           public:
 53           
 54               Message(Uint32 type, Uint32 key = getNextKey()) 
 55           	: _type(type), _key(key), _next(0), _prev(0) { }
 56           
 57               virtual ~Message(); 
 58           
 59               Uint32 getType() const { return _type; }
 60           
 61               void setType(Uint32 type) { _type = type; }
 62           
 63               Uint32 getKey() const { return _key; }
 64           
 65               void setKey(Uint32 key) { _key = key; }
 66           
 67               Message* getNext() { return _next; }
 68           
 69               const Message* getNext() const { return _next; }
 70           
 71               Message* getPrevious() { return _prev; }
 72 mike  1.4 
 73               const Message* getPrevious() const { return _prev; }
 74           
 75               static Uint32 getNextKey() { return ++_nextKey; }
 76           
 77 mike  1.5     virtual void print(PEGASUS_STD(ostream)& os) const;
 78 mike  1.4 
 79           private:
 80               Uint32 _type;
 81               Uint32 _key;
 82               Message* _next;
 83               Message* _prev;
 84               MessageQueue* _owner;
 85               static Uint32 _nextKey;
 86               friend class MessageQueue;
 87           };
 88 mike  1.5 
 89           enum MessageType
 90           {
 91               DUMMY_MESSAGE,
 92           
 93               // CIM Message types:
 94           
 95               CIM_GET_CLASS_REQUEST_MESSAGE,
 96               CIM_GET_INSTANCE_REQUEST_MESSAGE,
 97               CIM_DELETE_CLASS_REQUEST_MESSAGE,
 98               CIM_DELETE_INSTANCE_REQUEST_MESSAGE,
 99               CIM_CREATE_CLASS_REQUEST_MESSAGE,
100               CIM_CREATE_INSTANCE_REQUEST_MESSAGE,
101               CIM_MODIFY_CLASS_REQUEST_MESSAGE,
102               CIM_MODIFY_INSTANCE_REQUEST_MESSAGE,
103               CIM_ENUMERATE_CLASSES_REQUEST_MESSAGE,
104               CIM_ENUMERATE_CLASS_NAMES_REQUEST_MESSAGE,
105               CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE,
106               CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE,
107               CIM_EXEC_QUERY_REQUEST_MESSAGE,
108               CIM_ASSOCIATORS_REQUEST_MESSAGE,
109 mike  1.5     CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE,
110               CIM_REFERENCES_REQUEST_MESSAGE,
111               CIM_REFERENCE_NAMES_REQUEST_MESSAGE,
112               CIM_GET_PROPERTY_REQUEST_MESSAGE,
113               CIM_SET_PROPERTY_REQUEST_MESSAGE,
114               CIM_GET_QUALIFIER_REQUEST_MESSAGE,
115               CIM_SET_QUALIFIER_REQUEST_MESSAGE,
116               CIM_DELETE_QUALIFIER_REQUEST_MESSAGE,
117               CIM_ENUMERATE_QUALIFIERS_REQUEST_MESSAGE,
118               CIM_INVOKE_METHOD_REQUEST_MESSAGE,
119               CIM_GET_CLASS_RESPONSE_MESSAGE,
120               CIM_GET_INSTANCE_RESPONSE_MESSAGE,
121               CIM_DELETE_CLASS_RESPONSE_MESSAGE,
122               CIM_DELETE_INSTANCE_RESPONSE_MESSAGE,
123               CIM_CREATE_CLASS_RESPONSE_MESSAGE,
124               CIM_CREATE_INSTANCE_RESPONSE_MESSAGE,
125               CIM_MODIFY_CLASS_RESPONSE_MESSAGE,
126               CIM_MODIFY_INSTANCE_RESPONSE_MESSAGE,
127               CIM_ENUMERATE_CLASSES_RESPONSE_MESSAGE,
128               CIM_ENUMERATE_CLASS_NAMES_RESPONSE_MESSAGE,
129               CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE,
130 mike  1.5     CIM_ENUMERATE_INSTANCE_NAMES_RESPONSE_MESSAGE,
131               CIM_EXEC_QUERY_RESPONSE_MESSAGE,
132               CIM_ASSOCIATORS_RESPONSE_MESSAGE,
133               CIM_ASSOCIATOR_NAMES_RESPONSE_MESSAGE,
134               CIM_REFERENCES_RESPONSE_MESSAGE,
135               CIM_REFERENCE_NAMES_RESPONSE_MESSAGE,
136               CIM_GET_PROPERTY_RESPONSE_MESSAGE,
137               CIM_SET_PROPERTY_RESPONSE_MESSAGE,
138               CIM_GET_QUALIFIER_RESPONSE_MESSAGE,
139               CIM_SET_QUALIFIER_RESPONSE_MESSAGE,
140               CIM_DELETE_QUALIFIER_RESPONSE_MESSAGE,
141               CIM_ENUMERATE_QUALIFIERS_RESPONSE_MESSAGE,
142               CIM_INVOKE_METHOD_RESPONSE_MESSAGE,
143           
144 mike  1.5.2.2     // Monitor-related messages:
145 mike  1.5.2.1 
146                   SOCKET_MESSAGE,
147 mike  1.5.2.2 
148                   // Connection-oriented messages:
149               
150                   CLOSE_CONNECTION_MESSAGE,
151 mike  1.5.2.4 
152                   // HTTP messages:
153               
154 mike  1.5.2.3     HTTP_MESSAGE,
155 mike  1.5.2.1 
156 mike  1.5         NUMBER_OF_MESSAGES
157               };
158               
159               PEGASUS_COMMON_LINKAGE const char* MessageTypeToString(Uint32 messageType);
160 mike  1.4     
161               PEGASUS_NAMESPACE_END
162               
163               #endif /* Pegasus_Message_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2