MessagingSystem::Message Class Reference

#include <Message.h>

Inheritance diagram for MessagingSystem::Message:

Inheritance graph
[legend]
Collaboration diagram for MessagingSystem::Message:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Message ()
 Message (const std::string &from, const std::string &to, int type)
virtual const char * getPlainTextRepresentation ()=0
virtual void loadPlainTextRepresentation (const char *strMessage)=0
const std::string & getFrom () const
void setFrom (const std::string &from)
const std::string & getTo () const
void setTo (const std::string &to)
int getType () const
void setType (int type)

Static Public Member Functions

static Messagefactory (const std::string &from, const std::string &to, int msgType, const std::string &msg) throw (opencog::InvalidParamException, std::bad_exception)
static MessagerouterMessageFactory (const std::string &from, const std::string &to, int encapsulateMsgType, const std::string &msg)

Static Public Attributes

static const int STRING = 1
static const int LEARN = 2
static const int REWARD = 3
static const int SCHEMA = 4
static const int LS_CMD = 5
static const int ROUTER = 6
static const int CANDIDATE_SCHEMA = 7
static const int TICK = 8
static const int FEEDBACK = 9
static const int TRY = 10
static const int STOP_LEARNING = 11

Private Attributes

std::string from
std::string to
int type


Detailed Description

Interface supposed to be implemented by classes which actually carry messages to be exchanged between NetworkElements.

Definition at line 42 of file Message.h.


Constructor & Destructor Documentation

MessagingSystem::Message::~Message (  )  [virtual]

Definition at line 42 of file Message.cc.

MessagingSystem::Message::Message ( const std::string &  from,
const std::string &  to,
int  type 
)

Default constructor which just sets state variables

Definition at line 46 of file Message.cc.


Member Function Documentation

virtual const char* MessagingSystem::Message::getPlainTextRepresentation (  )  [pure virtual]

Return A (char *) representation of the message, a c-style string terminated with ''. Returned string is a const pointer hence it shaw not be modified and there is no need to free/delete it.

Returns:
A (char *) representation of the message, a c-style string terminated with ''

Implemented in MessagingSystem::FeedbackMessage, MessagingSystem::RouterMessage, MessagingSystem::StringMessage, MessagingSystem::TickMessage, LearningServerMessages::LearnMessage, LearningServerMessages::LSCmdMessage, LearningServerMessages::RewardMessage, LearningServerMessages::SchemaMessage, LearningServerMessages::StopLearningMessage, and LearningServerMessages::TrySchemaMessage.

Here is the caller graph for this function:

virtual void MessagingSystem::Message::loadPlainTextRepresentation ( const char *  strMessage  )  [pure virtual]

Message * MessagingSystem::Message::factory ( const std::string &  from,
const std::string &  to,
int  msgType,
const std::string &  msg 
) throw (opencog::InvalidParamException, std::bad_exception) [static]

Builds Message object of given type

Returns:
A new Message of given type

Definition at line 55 of file Message.cc.

References CANDIDATE_SCHEMA, FEEDBACK, from, LEARN, LS_CMD, REWARD, SCHEMA, STOP_LEARNING, STRING, TICK, to, TRACE_INFO, and TRY.

Message * MessagingSystem::Message::routerMessageFactory ( const std::string &  from,
const std::string &  to,
int  encapsulateMsgType,
const std::string &  msg 
) [static]

Built a message object of RouterMessage type. This method should be called ONLY by Router related classes.

Returns:
A new message

Definition at line 112 of file Message.cc.

Here is the caller graph for this function:

const std::string & MessagingSystem::Message::getFrom (  )  const

Definition at line 134 of file Message.cc.

References from.

Here is the caller graph for this function:

void MessagingSystem::Message::setFrom ( const std::string &  from  ) 

Definition at line 119 of file Message.cc.

const std::string & MessagingSystem::Message::getTo (  )  const

Definition at line 139 of file Message.cc.

References to.

Here is the caller graph for this function:

void MessagingSystem::Message::setTo ( const std::string &  to  ) 

Definition at line 124 of file Message.cc.

int MessagingSystem::Message::getType (  )  const

Definition at line 144 of file Message.cc.

References type.

Here is the caller graph for this function:

void MessagingSystem::Message::setType ( int  type  ) 

Definition at line 129 of file Message.cc.

Here is the caller graph for this function:


Member Data Documentation

std::string MessagingSystem::Message::from [private]

Definition at line 47 of file Message.h.

std::string MessagingSystem::Message::to [private]

Definition at line 48 of file Message.h.

Definition at line 49 of file Message.h.

const int MessagingSystem::Message::STRING = 1 [static]

Definition at line 54 of file Message.h.

const int MessagingSystem::Message::LEARN = 2 [static]

Definition at line 55 of file Message.h.

const int MessagingSystem::Message::REWARD = 3 [static]

Definition at line 56 of file Message.h.

const int MessagingSystem::Message::SCHEMA = 4 [static]

Definition at line 57 of file Message.h.

const int MessagingSystem::Message::LS_CMD = 5 [static]

Definition at line 58 of file Message.h.

const int MessagingSystem::Message::ROUTER = 6 [static]

Definition at line 59 of file Message.h.

Definition at line 60 of file Message.h.

const int MessagingSystem::Message::TICK = 8 [static]

Definition at line 61 of file Message.h.

const int MessagingSystem::Message::FEEDBACK = 9 [static]

Definition at line 62 of file Message.h.

const int MessagingSystem::Message::TRY = 10 [static]

Definition at line 63 of file Message.h.

const int MessagingSystem::Message::STOP_LEARNING = 11 [static]

Definition at line 64 of file Message.h.


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

Generated on Fri Dec 4 23:24:28 2009 for OpenCog Framework by  doxygen 1.5.6