#include <trainercommandparser.h>
Inheritance diagram for TrainerCommandParser:
Public Types | |
typedef std::map< std::string, ECommandType > | TCommandMap |
typedef std::map< std::string, TTeamIndex > | TTeamIndexMap |
typedef std::map< std::string, TPlayMode > | TPlayModeMap |
enum | ECommandType { CT_PLAYER, CT_BALL, CT_PLAYMODE, CT_DROP_BALL, CT_KICK_OFF, CT_ACK } |
Public Member Functions | |
TrainerCommandParser () | |
virtual | ~TrainerCommandParser () |
bool | SendAck (std::string &reply) |
virtual void | ParseMonitorMessage (const std::string &data) |
This function will be called be called from the monitor server implementation to parse any command strings received from the monitor client process. | |
virtual void | OnLink () |
This method is called, when the hierarchy object has been linked to a parent. | |
virtual void | OnUnlink () |
This rountine is called, before the hierarchy object is removed from the parent. | |
Protected Member Functions | |
void | ParsePredicates (oxygen::PredicateList &predList) |
parses the list of predicates; returns true on success | |
bool | ParsePredicate (const oxygen::Predicate &predicate) |
parses the given predicate and calls one of the specialized parse methods given below depending the predicate name; returns true if successful | |
void | ParsePlayerCommand (const oxygen::Predicate &predicate) |
parses and executes the player command contained in the given predicate | |
void | ParseBallCommand (const oxygen::Predicate &predicate) |
parses and executes the ball command contained in the given predicate | |
void | ParsePlayModeCommand (const oxygen::Predicate &predicate) |
parses and executes the play mode command contained in the given predicate | |
void | ParseKickOffCommand (const oxygen::Predicate &predicate) |
parses and executes the kick off command contained in the given predicate | |
Protected Attributes | |
TCommandMap | mCommandMap |
TTeamIndexMap | mTeamIndexMap |
TPlayModeMap | mPlayModeMap |
boost::shared_ptr< GameStateAspect > | mGameState |
cached reference for the gamestate aspect | |
boost::shared_ptr< SoccerRuleAspect > | mSoccerRule |
cached reference for the soccer rule aspect | |
boost::shared_ptr< oxygen::BaseParser > | mSexpParser |
the parser used to create the PredicateList | |
bool | mGetAck |
std::string | mAckString |
Definition at line 36 of file trainercommandparser.h.
|
Definition at line 50 of file trainercommandparser.h. |
|
Definition at line 54 of file trainercommandparser.h. |
|
Definition at line 51 of file trainercommandparser.h. |
|
Definition at line 40 of file trainercommandparser.h. |
|
|
Definition at line 78 of file trainercommandparser.cpp. |
|
This method is called, when the hierarchy object has been linked to a parent. At that point, traversal can commence. It can be overridden to support custom 'link' behavior. Reimplemented from zeitgeist::Leaf. Definition at line 97 of file trainercommandparser.cpp. References zeitgeist::Object::GetCore(), zeitgeist::Object::GetLog(), and mSexpParser. Here is the call graph for this function: ![]() |
|
This rountine is called, before the hierarchy object is removed from the parent. It can be overridden to support custom 'unlink' behavior. Reimplemented from zeitgeist::Leaf. Definition at line 110 of file trainercommandparser.cpp. References mSexpParser. |
|
parses and executes the ball command contained in the given predicate
Definition at line 341 of file trainercommandparser.cpp. References oxygen::Predicate::FindParameter(), SoccerBase::GetBallBody(), zeitgeist::Object::GetLog(), and oxygen::Predicate::GetValue(). Referenced by ParsePredicate(). Here is the call graph for this function: ![]() |
|
parses and executes the kick off command contained in the given predicate
Definition at line 430 of file trainercommandparser.cpp. References zeitgeist::Object::GetLog(), oxygen::Predicate::GetValue(), mGameState, and mTeamIndexMap. Referenced by ParsePredicate(). Here is the call graph for this function: ![]() |
|
This function will be called be called from the monitor server implementation to parse any command strings received from the monitor client process.
Implements oxygen::MonitorCmdParser. Definition at line 115 of file trainercommandparser.cpp. References zeitgeist::Object::GetLog(), mSexpParser, and ParsePredicates(). Here is the call graph for this function: ![]() |
|
parses and executes the player command contained in the given predicate
Definition at line 196 of file trainercommandparser.cpp. References oxygen::Predicate::FindParameter(), SoccerBase::GetAgentBody(), SoccerBase::GetAgentState(), zeitgeist::Object::GetLog(), oxygen::Predicate::GetValue(), and mTeamIndexMap. Referenced by ParsePredicate(). Here is the call graph for this function: ![]() |
|
parses and executes the play mode command contained in the given predicate
Definition at line 401 of file trainercommandparser.cpp. References zeitgeist::Object::GetLog(), oxygen::Predicate::GetValue(), mGameState, and mPlayModeMap. Referenced by ParsePredicate(). Here is the call graph for this function: ![]() |
|
parses the given predicate and calls one of the specialized parse methods given below depending the predicate name; returns true if successful
Definition at line 145 of file trainercommandparser.cpp. References CT_ACK, CT_BALL, CT_DROP_BALL, CT_KICK_OFF, CT_PLAYER, CT_PLAYMODE, SoccerBase::GetGameState(), SoccerBase::GetSoccerRuleAspect(), mCommandMap, mGameState, mGetAck, mSoccerRule, oxygen::Predicate::name, ParseBallCommand(), ParseKickOffCommand(), ParsePlayerCommand(), and ParsePlayModeCommand(). Referenced by ParsePredicates(). Here is the call graph for this function: ![]() |
|
parses the list of predicates; returns true on success
Definition at line 127 of file trainercommandparser.cpp. References oxygen::PredicateList::begin(), oxygen::PredicateList::end(), and ParsePredicate(). Referenced by ParseMonitorMessage(). Here is the call graph for this function: ![]() |
|
Definition at line 84 of file trainercommandparser.cpp. References mGetAck. |
|
Definition at line 119 of file trainercommandparser.h. |
|
Definition at line 105 of file trainercommandparser.h. Referenced by ParsePredicate(), and TrainerCommandParser(). |
|
cached reference for the gamestate aspect
Definition at line 112 of file trainercommandparser.h. Referenced by ParseKickOffCommand(), ParsePlayModeCommand(), and ParsePredicate(). |
|
Definition at line 118 of file trainercommandparser.h. Referenced by ParsePredicate(), SendAck(), and TrainerCommandParser(). |
|
Definition at line 109 of file trainercommandparser.h. Referenced by ParsePlayModeCommand(), and TrainerCommandParser(). |
|
the parser used to create the PredicateList
Definition at line 116 of file trainercommandparser.h. Referenced by OnLink(), OnUnlink(), and ParseMonitorMessage(). |
|
cached reference for the soccer rule aspect
Definition at line 114 of file trainercommandparser.h. Referenced by ParsePredicate(). |
|
Definition at line 107 of file trainercommandparser.h. Referenced by ParseKickOffCommand(), ParsePlayerCommand(), and TrainerCommandParser(). |