#include <Message.h>


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 Message * | factory (const std::string &from, const std::string &to, int msgType, const std::string &msg) throw (opencog::InvalidParamException, std::bad_exception) |
| static Message * | routerMessageFactory (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 |
Definition at line 42 of file Message.h.
| 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.
| 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.
Implemented in MessagingSystem::FeedbackMessage, MessagingSystem::RouterMessage, MessagingSystem::StringMessage, MessagingSystem::TickMessage, LearningServerMessages::LearnMessage, LearningServerMessages::LSCmdMessage, LearningServerMessages::RewardMessage, LearningServerMessages::SchemaMessage, LearningServerMessages::StopLearningMessage, and LearningServerMessages::TrySchemaMessage.

| virtual void MessagingSystem::Message::loadPlainTextRepresentation | ( | const char * | strMessage | ) | [pure virtual] |
Factory a message using a c-style (char *) string terminated with ``.
| strMessage | (char *) representation of the message to be built. |
Implemented in MessagingSystem::FeedbackMessage, MessagingSystem::RouterMessage, MessagingSystem::StringMessage, MessagingSystem::TickMessage, LearningServerMessages::LearnMessage, LearningServerMessages::LSCmdMessage, LearningServerMessages::RewardMessage, LearningServerMessages::SchemaMessage, LearningServerMessages::StopLearningMessage, and LearningServerMessages::TrySchemaMessage.
| 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
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.
Definition at line 112 of file Message.cc.

| const std::string & MessagingSystem::Message::getFrom | ( | ) | const |
Definition at line 134 of file Message.cc.
References from.

| 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.

| 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.

| void MessagingSystem::Message::setType | ( | int | type | ) |
std::string MessagingSystem::Message::from [private] |
std::string MessagingSystem::Message::to [private] |
int MessagingSystem::Message::type [private] |
const int MessagingSystem::Message::STRING = 1 [static] |
const int MessagingSystem::Message::LEARN = 2 [static] |
const int MessagingSystem::Message::REWARD = 3 [static] |
const int MessagingSystem::Message::SCHEMA = 4 [static] |
const int MessagingSystem::Message::LS_CMD = 5 [static] |
const int MessagingSystem::Message::ROUTER = 6 [static] |
const int MessagingSystem::Message::CANDIDATE_SCHEMA = 7 [static] |
const int MessagingSystem::Message::TICK = 8 [static] |
const int MessagingSystem::Message::FEEDBACK = 9 [static] |
const int MessagingSystem::Message::TRY = 10 [static] |
const int MessagingSystem::Message::STOP_LEARNING = 11 [static] |
1.5.6