version 1.1, 2001/07/08 16:28:53
|
version 1.5.2.3, 2001/08/02 02:15:49
|
|
|
#ifndef Pegasus_Message_h | #ifndef Pegasus_Message_h |
#define Pegasus_Message_h | #define Pegasus_Message_h |
| |
|
#include <iostream> |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
|
class MessageQueue; | class MessageQueue; |
| |
/** The Message class and derived classes are used to pass messages between | /** The Message class and derived classes are used to pass messages between |
modules. Messages are passed between processes using the MessageQueue |
modules. Messages are passed between modules using the message queues |
class. |
(see MessageQueue class). Derived classes may add their own fields. |
|
This base class defines two common fields: type, which is the type of |
|
the message, and key which is a key value whose meaning is defined by |
|
the derived class. The MessageQueue class provides methods for finding |
|
messages by both type and key. |
|
|
|
The Message class also provides previous and next pointers which are |
|
used to place the messages on a queue by the MessageQueue class. |
*/ | */ |
class Message |
class PEGASUS_COMMON_LINKAGE Message |
{ | { |
public: | public: |
| |
Message(Uint32 type, Uint32 key) |
Message(Uint32 type, Uint32 key = getNextKey()) |
: _type(type), _key(key), _next(0), _prev(0) { } | : _type(type), _key(key), _next(0), _prev(0) { } |
| |
|
virtual ~Message(); |
|
|
Uint32 getType() const { return _type; } | Uint32 getType() const { return _type; } |
| |
void setType(Uint32 type) { _type = type; } | void setType(Uint32 type) { _type = type; } |
|
|
| |
void setKey(Uint32 key) { _key = key; } | void setKey(Uint32 key) { _key = key; } |
| |
|
Message* getNext() { return _next; } |
|
|
|
const Message* getNext() const { return _next; } |
|
|
|
Message* getPrevious() { return _prev; } |
|
|
|
const Message* getPrevious() const { return _prev; } |
|
|
|
static Uint32 getNextKey() { return ++_nextKey; } |
|
|
|
virtual void print(PEGASUS_STD(ostream)& os) const; |
|
|
private: | private: |
Uint32 _type; | Uint32 _type; |
Uint32 _key; | Uint32 _key; |
Message* _next; | Message* _next; |
Message* _prev; | Message* _prev; |
|
MessageQueue* _owner; |
|
static Uint32 _nextKey; |
friend class MessageQueue; | friend class MessageQueue; |
}; | }; |
| |
|
enum MessageType |
|
{ |
|
DUMMY_MESSAGE, |
|
|
|
// CIM Message types: |
|
|
|
CIM_GET_CLASS_REQUEST_MESSAGE, |
|
CIM_GET_INSTANCE_REQUEST_MESSAGE, |
|
CIM_DELETE_CLASS_REQUEST_MESSAGE, |
|
CIM_DELETE_INSTANCE_REQUEST_MESSAGE, |
|
CIM_CREATE_CLASS_REQUEST_MESSAGE, |
|
CIM_CREATE_INSTANCE_REQUEST_MESSAGE, |
|
CIM_MODIFY_CLASS_REQUEST_MESSAGE, |
|
CIM_MODIFY_INSTANCE_REQUEST_MESSAGE, |
|
CIM_ENUMERATE_CLASSES_REQUEST_MESSAGE, |
|
CIM_ENUMERATE_CLASS_NAMES_REQUEST_MESSAGE, |
|
CIM_ENUMERATE_INSTANCES_REQUEST_MESSAGE, |
|
CIM_ENUMERATE_INSTANCE_NAMES_REQUEST_MESSAGE, |
|
CIM_EXEC_QUERY_REQUEST_MESSAGE, |
|
CIM_ASSOCIATORS_REQUEST_MESSAGE, |
|
CIM_ASSOCIATOR_NAMES_REQUEST_MESSAGE, |
|
CIM_REFERENCES_REQUEST_MESSAGE, |
|
CIM_REFERENCE_NAMES_REQUEST_MESSAGE, |
|
CIM_GET_PROPERTY_REQUEST_MESSAGE, |
|
CIM_SET_PROPERTY_REQUEST_MESSAGE, |
|
CIM_GET_QUALIFIER_REQUEST_MESSAGE, |
|
CIM_SET_QUALIFIER_REQUEST_MESSAGE, |
|
CIM_DELETE_QUALIFIER_REQUEST_MESSAGE, |
|
CIM_ENUMERATE_QUALIFIERS_REQUEST_MESSAGE, |
|
CIM_INVOKE_METHOD_REQUEST_MESSAGE, |
|
CIM_GET_CLASS_RESPONSE_MESSAGE, |
|
CIM_GET_INSTANCE_RESPONSE_MESSAGE, |
|
CIM_DELETE_CLASS_RESPONSE_MESSAGE, |
|
CIM_DELETE_INSTANCE_RESPONSE_MESSAGE, |
|
CIM_CREATE_CLASS_RESPONSE_MESSAGE, |
|
CIM_CREATE_INSTANCE_RESPONSE_MESSAGE, |
|
CIM_MODIFY_CLASS_RESPONSE_MESSAGE, |
|
CIM_MODIFY_INSTANCE_RESPONSE_MESSAGE, |
|
CIM_ENUMERATE_CLASSES_RESPONSE_MESSAGE, |
|
CIM_ENUMERATE_CLASS_NAMES_RESPONSE_MESSAGE, |
|
CIM_ENUMERATE_INSTANCES_RESPONSE_MESSAGE, |
|
CIM_ENUMERATE_INSTANCE_NAMES_RESPONSE_MESSAGE, |
|
CIM_EXEC_QUERY_RESPONSE_MESSAGE, |
|
CIM_ASSOCIATORS_RESPONSE_MESSAGE, |
|
CIM_ASSOCIATOR_NAMES_RESPONSE_MESSAGE, |
|
CIM_REFERENCES_RESPONSE_MESSAGE, |
|
CIM_REFERENCE_NAMES_RESPONSE_MESSAGE, |
|
CIM_GET_PROPERTY_RESPONSE_MESSAGE, |
|
CIM_SET_PROPERTY_RESPONSE_MESSAGE, |
|
CIM_GET_QUALIFIER_RESPONSE_MESSAGE, |
|
CIM_SET_QUALIFIER_RESPONSE_MESSAGE, |
|
CIM_DELETE_QUALIFIER_RESPONSE_MESSAGE, |
|
CIM_ENUMERATE_QUALIFIERS_RESPONSE_MESSAGE, |
|
CIM_INVOKE_METHOD_RESPONSE_MESSAGE, |
|
|
|
// Monitor-related messages: |
|
|
|
SOCKET_MESSAGE, |
|
|
|
// Connection-oriented messages: |
|
|
|
CLOSE_CONNECTION_MESSAGE, |
|
HTTP_MESSAGE, |
|
|
|
NUMBER_OF_MESSAGES |
|
}; |
|
|
|
PEGASUS_COMMON_LINKAGE const char* MessageTypeToString(Uint32 messageType); |
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
#endif /* Pegasus_Message_h */ | #endif /* Pegasus_Message_h */ |