25 #ifndef __I6ENGINE_CORE_MESSAGE_H__
26 #define __I6ENGINE_CORE_MESSAGE_H__
32 #include "boost/archive/text_iarchive.hpp"
33 #include "boost/archive/text_oarchive.hpp"
34 #include "boost/serialization/export.hpp"
66 typedef boost::shared_ptr<Message>
Ptr;
72 Message() : _messageType(), _subType(), _method(), _content(), _sender() {
82 Message(uint16_t messageType, uint16_t subtype,
const Method method,
MessageStruct * content,
Subsystem sender) : _messageType(messageType), _subType(subtype), _method(method), _content(content), _sender(sender) {
89 Message(
const Message & msg) : _messageType(msg.getMessageType()), _subType(msg.getSubtype()), _method(msg.getMethod()), _content(), _sender(msg.getSender()) {
132 #ifdef ISIXE_WITH_PROFILING
138 void insertTimestamp(
const std::string & text);
143 std::string getTimestamps();
151 _messageType = messageType;
165 std::string getMessageInfo()
const;
167 std::string Serialize()
const;
169 static Message * Deserialize(
const std::string & s);
172 friend class boost::serialization::access;
179 template <
typename Archive>
Message()
Default constructor necessary for serialization.
Method getMethod() const
Getter for the message method.
Message(const Message &msg)
Standard copy constructor.
boost::shared_ptr< Message > Ptr
virtual ~Message()
Destructor, deleting message content.
Class representing a message to be sent.
uint16_t getMessageType() const
Getter for the message type.
virtual MessageStruct * copy()
Copy method returning an exact copy of itself.
Message(uint16_t messageType, uint16_t subtype, const Method method, MessageStruct *content, Subsystem sender)
Constructor.
void serialize(Archive &ar, const unsigned int)
Prepares a Message to be sent over the Network.
Subsystem getSender() const
returns the Subsystem sending this message
void setMessageType(uint16_t messageType)
Changes the message type to the given parameter.
MessageStruct * getContent() const
Getter for the message content.
uint16_t getSubtype() const
Getter for the message subtype.
ISIXE_CORE_API std::ostream & operator<<(std::ostream &stream, const IPKey &key)