i6engine  1.0
i6e::core::Message Class Reference

Class representing a message to be sent. More...

#include <D:/Projekte/i6engine/libs/i6engine-core/include/i6engine/core/messaging/Message.h>

Public Types

typedef boost::shared_ptr< MessagePtr
 

Public Member Functions

 Message ()
 Default constructor necessary for serialization. More...
 
 Message (uint16_t messageType, uint16_t subtype, const Method method, MessageStruct *content, Subsystem sender)
 Constructor. More...
 
 Message (const Message &msg)
 Standard copy constructor. More...
 
const Messageoperator= (const Message &)
 
virtual ~Message ()
 Destructor, deleting message content. More...
 
uint16_t getMessageType () const
 Getter for the message type. More...
 
uint16_t getSubtype () const
 Getter for the message subtype. More...
 
Method getMethod () const
 Getter for the message method. More...
 
MessageStructgetContent () const
 Getter for the message content. More...
 
void setMessageType (uint16_t messageType)
 Changes the message type to the given parameter. More...
 
Subsystem getSender () const
 returns the Subsystem sending this message More...
 
std::string getMessageInfo () const
 Gives informations about the message. More...
 
std::string Serialize () const
 

Static Public Member Functions

static MessageDeserialize (const std::string &s)
 

Protected Member Functions

template<typename Archive >
void serialize (Archive &ar, const unsigned int)
 Prepares a Message to be sent over the Network. More...
 

Protected Attributes

uint16_t _messageType
 
uint16_t _subType
 
Method _method
 
MessageStruct_content
 
Subsystem _sender
 

Friends

class boost::serialization::access
 

Detailed Description

Class representing a message to be sent.

Every message that is sent in the i6m2etis engine is an instance of this class. A message has a certain type defined by a string and several variables which can be of varying types to describe the content of the message. To learn more about sending and receiving messages please look at MessagingController.

The copies of the message are deleted automatically by the shared_ptr. So don't call the destructor on your message. This will cause a segmentation fault!

To get an overview on the usage and functionality of the whole messaging subsystem in german have a look at our wiki (topic: 'Messaging in der i6engine (Kurzbeschreibung)' )

Note

Have a look at here for an overview of typedef's in namespace i6e.

Definition at line 64 of file Message.h.

Member Typedef Documentation

typedef boost::shared_ptr<Message> i6e::core::Message::Ptr

Definition at line 66 of file Message.h.

Constructor & Destructor Documentation

i6e::core::Message::Message ( )
inline

Default constructor necessary for serialization.

Definition at line 72 of file Message.h.

i6e::core::Message::Message ( uint16_t  messageType,
uint16_t  subtype,
const Method  method,
MessageStruct content,
Subsystem  sender 
)
inline

Constructor.

Parameters
strMessageTypeMessage type.
subtypeMessage subtype.
methodMessage method.
contentMessage content.

Definition at line 82 of file Message.h.

i6e::core::Message::Message ( const Message msg)
inline

Standard copy constructor.

Parameters
msgObject to be copied.

Definition at line 89 of file Message.h.

virtual i6e::core::Message::~Message ( )
inlinevirtual

Destructor, deleting message content.

Definition at line 100 of file Message.h.

Member Function Documentation

static Message* i6e::core::Message::Deserialize ( const std::string &  s)
static
MessageStruct* i6e::core::Message::getContent ( ) const
inline

Getter for the message content.

Returns
The message content.

Definition at line 130 of file Message.h.

std::string i6e::core::Message::getMessageInfo ( ) const

Gives informations about the message.

Returns
String containing Type, SubType, Method, ID, waitForId, sender, receiver.
uint16_t i6e::core::Message::getMessageType ( ) const
inline

Getter for the message type.

Returns
The message type.

Definition at line 108 of file Message.h.

Method i6e::core::Message::getMethod ( ) const
inline

Getter for the message method.

Returns
The message method.

Definition at line 124 of file Message.h.

Subsystem i6e::core::Message::getSender ( ) const
inline

returns the Subsystem sending this message

Definition at line 157 of file Message.h.

uint16_t i6e::core::Message::getSubtype ( ) const
inline

Getter for the message subtype.

Returns
The message subtype.

Definition at line 116 of file Message.h.

const Message& i6e::core::Message::operator= ( const Message )
std::string i6e::core::Message::Serialize ( ) const
template<typename Archive >
void i6e::core::Message::serialize ( Archive &  ar,
const unsigned  int 
)
inlineprotected

Prepares a Message to be sent over the Network.

Parameters
ar
version

Definition at line 180 of file Message.h.

void i6e::core::Message::setMessageType ( uint16_t  messageType)
inline

Changes the message type to the given parameter.

Parameters
strMesageTypeNew message type.

Definition at line 150 of file Message.h.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 172 of file Message.h.

Member Data Documentation

MessageStruct* i6e::core::Message::_content
protected

Definition at line 191 of file Message.h.

uint16_t i6e::core::Message::_messageType
protected

Definition at line 187 of file Message.h.

Method i6e::core::Message::_method
protected

Definition at line 189 of file Message.h.

Subsystem i6e::core::Message::_sender
protected

Definition at line 193 of file Message.h.

uint16_t i6e::core::Message::_subType
protected

Definition at line 188 of file Message.h.


The documentation for this class was generated from the following file: