|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLAIAGENT::CActorScript Class ReferenceClass CActorScript Scripted actors for the creations of FSMs and other controlers.
More...
#include <actor_script.h>
Inheritance diagram for NLAIAGENT::CActorScript:
List of all members.
Public Methods |
| CActorScript (IAgentManager *, bool activated=false) |
| CActorScript (const CActorScript &) |
| CActorScript (IAgentManager *, IBasicAgent *, std::list< IObjectIA * > &, NLAISCRIPT::CAgentClass *) |
virtual | ~CActorScript () |
bool | isActivated () |
| Returns true if the actor has a token. More...
|
void | activate () |
| Activates the actor. More...
|
virtual void | onActivate () |
| Callback called at the activation of the actor. More...
|
void | unActivate () |
| Unactivates the actor. More...
|
virtual void | onUnActivate () |
| Callback called when the agent is unactivated. More...
|
virtual const NLAIC::IBasicType * | clone () const |
| Inherited functions. More...
|
virtual const NLAIC::IBasicType * | newInstance () const |
| This function allow a new instance, that mean that the class is a class factory. More...
|
virtual void | getDebugString (std::string &t) const |
| This is a Debug function, text is an character pointer to receive the debug text output, the debug text containe all think sensible to interset user. More...
|
virtual bool | isEqual (const IBasicObjectIA &a) const |
| Implementation of the isEqual of the IBasicObjectIA. More...
|
virtual void | processMessages () |
| The processMessages method, process the loop/Run message. More...
|
virtual const CProcessResult & | run () |
| The work of an agent. More...
|
virtual CProcessResult | sendMessage (IObjectIA *) |
| sendMessage allow agent to send a message to an ather agent.The message is a IMessageBase. More...
|
virtual const NLAIC::CIdentType & | getType () const |
| getType return a unique string how represente the class, it can be the name of the class. More...
|
virtual void | save (NLMISC::IStream &os) |
| Save the class in a stream. More...
|
virtual void | load (NLMISC::IStream &is) |
| Load the class from a stream. More...
|
virtual int | getBaseMethodCount () const |
| Return the nomber of internal C++ hard coded method that the class can process. More...
|
virtual sint32 | getMethodIndexSize () const |
| getMethodIndexSize define the nomber of method define in the class. More...
|
virtual tQueue | getPrivateMember (const IVarName *, const IVarName *, const IObjectIA &) const |
virtual IObjectIA::CProcessResult | runMethodBase (int heritance, int index, IObjectIA *) |
virtual IObjectIA::CProcessResult | runMethodBase (int index, IObjectIA *) |
virtual void | cancel () |
virtual void | processSuccess (NLAIAGENT::IObjectIA *) |
| Own success and failure functions These function telle other operators and goals that might be waiting for the execution of this one. More...
|
virtual void | processFailure (NLAIAGENT::IObjectIA *) |
virtual void | success () |
virtual void | failure () |
void | pause () |
| Pauses the actor. More...
|
void | restart () |
| Restarts the actor. More...
|
virtual void | onPause () |
| These functions can be overloaded to have the actor execute something when paused or restarted. More...
|
virtual void | onRestart () |
virtual void | onSuccess (IObjectIA *) |
| Dependencies failure and success notification These functions are called by other operators or goals who failed or succeeded. More...
|
virtual void | onFailure (IObjectIA *) |
virtual float | priority () const |
| Priority of the operator. More...
|
virtual void | setTopLevel (CAgentScript *) |
const CAgentScript * | getTopLevel () const |
virtual IMessageBase * | runTell (const IMessageBase &m) |
| runTell is to processing reltative to PTell Performatif. More...
|
virtual void | Launch (const std::string &name, NLAIAGENT::IBasicAgent *) |
Static Public Methods |
void | initClass () |
void | releaseClass () |
Static Public Attributes |
NLAISCRIPT::COperandSimpleListOr * | ParamIdSuccessMsg = NULL |
NLAISCRIPT::CParam * | ParamSuccessMsg = NULL |
NLAISCRIPT::COperandSimpleListOr * | ParamIdFailureMsg = NULL |
NLAISCRIPT::CParam * | ParamFailureMsg = NULL |
const NLAIC::CIdentType | IdActorScript |
Protected Types |
enum | c_funcs_id {
fid_activate,
fid_onActivate,
fid_unActivate,
fid_onUnActivate,
fid_switch,
fid_launch,
fid_launch_goal,
fid_launched,
fid_pause,
fid_restart,
fid_success,
fid_msg_success,
fid_failure,
fid_msg_failure,
fid_nb_answers,
fid_toplevel,
fid_owner,
fid_isactive,
fid_last
} |
Protected Methods |
virtual void | switchActor (CActorScript *, bool stay_active=false) |
| Transfers activity to another actor. More...
|
virtual void | switchActor (std::vector< CActorScript * > &, bool stay_active=false) |
| Transfers activity to another actor. More...
|
virtual void | switchActor (std::vector< CComponentHandle * > &, bool stay_active=false) |
| Transfers activity to another actor. More...
|
Protected Attributes |
bool | _IsActivated |
bool | _OnActivate |
bool | _IsPaused |
sint32 | _OnActivateIndex |
sint32 | _OnUnActivateIndex |
sint32 | _OnPauseIndex |
sint32 | _OnRestartIndex |
sint32 | _OnSuccessIndex |
sint32 | _OnFailureIndex |
sint32 | _NbAnswers |
std::vector< CComponentHandle * > | _Actors |
std::list< IBasicAgent * > | _Launched |
CAgentScript * | _TopLevel |
Detailed Description
Class CActorScript Scripted actors for the creations of FSMs and other controlers.
You can think of activation as a set of tokens passed between actors. The number of tokens isn't fixed, which means one transition can activate more than one actor. An actor has a list of conditions under which he's going to pass activation to other actors. A simple state machine is a particular case in which there's always only one token for all actors. If a run() is defined, the activated actor becomes an active agent with an activity at each cycle.
Definition at line 49 of file actor_script.h.
Member Enumeration Documentation
enum NLAIAGENT::CActorScript::c_funcs_id [protected]
|
|
|
-
Enumeration values:
-
fid_activate |
|
fid_onActivate |
|
fid_unActivate |
|
fid_onUnActivate |
|
fid_switch |
|
fid_launch |
|
fid_launch_goal |
|
fid_launched |
|
fid_pause |
|
fid_restart |
|
fid_success |
|
fid_msg_success |
|
fid_failure |
|
fid_msg_failure |
|
fid_nb_answers |
|
fid_toplevel |
|
fid_owner |
|
fid_isactive |
|
fid_last |
|
Reimplemented in NLAIAGENT::COperatorScript.
Definition at line 53 of file actor_script.h. |
Constructor & Destructor Documentation
NLAIAGENT::CActorScript::CActorScript |
( |
IAgentManager * |
, |
|
|
bool |
activated = false |
|
) |
|
|
|
Definition at line 95 of file actor_script.cpp.
References _IsActivated, _IsPaused, _NbAnswers, _OnActivateIndex, _OnUnActivateIndex, and _TopLevel.
Referenced by clone, Launch, newInstance, pause, restart, NLAIAGENT::CFsmScript::setTopLevel, setTopLevel, switchActor, and unActivate. |
NLAIAGENT::CActorScript::CActorScript |
( |
const CActorScript & |
|
) |
|
|
NLAIAGENT::CActorScript::~CActorScript |
( |
|
) |
[virtual] |
|
Member Function Documentation
void NLAIAGENT::CActorScript::activate |
( |
|
) |
|
|
|
Activates the actor.
Definition at line 126 of file actor_script.cpp.
References NLAIAGENT::CAgentScript::_AgentClass, _IsActivated, _OnActivateIndex, NLAIAGENT::CAgentScript::CAgentScript, NLAIAGENT::IConnectIA::getParent, NLAISCRIPT::CAgentClass::isMember, onActivate, r, and NLAIAGENT::tQueue.
Referenced by NLAIAGENT::CSeqFsmScript::onSuccess, NLAIAGENT::COperatorScript::run, and runMethodBase. |
void NLAIAGENT::CActorScript::cancel |
( |
|
) |
[virtual] |
|
void NLAIAGENT::CActorScript::failure |
( |
|
) |
[virtual] |
|
int NLAIAGENT::CActorScript::getBaseMethodCount |
( |
|
) |
const [virtual] |
|
void NLAIAGENT::CActorScript::getDebugString |
( |
std::string & |
t |
) |
const [virtual] |
|
sint32 NLAIAGENT::CActorScript::getMethodIndexSize |
( |
|
) |
const [virtual] |
|
|
Reimplemented in NLAIAGENT::COperatorScript.
Definition at line 774 of file actor_script.cpp.
References fid_activate, fid_failure, fid_isactive, fid_launch, fid_launch_goal, fid_launched, fid_msg_failure, fid_msg_success, fid_nb_answers, fid_onActivate, fid_onUnActivate, fid_owner, fid_pause, fid_restart, fid_success, fid_switch, fid_toplevel, fid_unActivate, NLAIAGENT::CVectorGroupType::IdVectorGroupType, param, ParamFailureMsg, ParamSuccessMsg, NLAIAGENT::tQueue, and NLAIC::CIdentType::VoidType. |
const CAgentScript * NLAIAGENT::CActorScript::getTopLevel |
( |
|
) |
const |
|
void NLAIAGENT::CActorScript::initClass |
( |
|
) |
[static] |
|
bool NLAIAGENT::CActorScript::isActivated |
( |
|
) |
|
|
bool NLAIAGENT::CActorScript::isEqual |
( |
const IBasicObjectIA & |
a |
) |
const [virtual] |
|
void NLAIAGENT::CActorScript::onActivate |
( |
|
) |
[virtual] |
|
virtual void NLAIAGENT::CActorScript::onFailure |
( |
IObjectIA * |
|
) |
[inline, virtual] |
|
void NLAIAGENT::CActorScript::onPause |
( |
|
) |
[virtual] |
|
|
These functions can be overloaded to have the actor execute something when paused or restarted.
Definition at line 237 of file actor_script.cpp.
Referenced by pause. |
void NLAIAGENT::CActorScript::onRestart |
( |
|
) |
[virtual] |
|
virtual void NLAIAGENT::CActorScript::onSuccess |
( |
IObjectIA * |
|
) |
[inline, virtual] |
|
void NLAIAGENT::CActorScript::onUnActivate |
( |
|
) |
[virtual] |
|
void NLAIAGENT::CActorScript::pause |
( |
|
) |
|
|
|
Pauses the actor.
Definition at line 191 of file actor_script.cpp.
References NLAIAGENT::CAgentScript::_AgentClass, NLAIAGENT::CAgentScript::_Components, _IsPaused, _Launched, NLAIAGENT::CAgentScript::_NbComponents, _OnPauseIndex, CActorScript, NLAIAGENT::CAgentScript::getAgentManager, NLAISCRIPT::CAgentClass::isMember, onPause, r, NLAIAGENT::CAgentScript::runMethodeMember, NLAISCRIPT::CCodeContext::Self, NLAIC::CTypeOfObject::tActor, and NLAIAGENT::tQueue.
Referenced by NLAIAGENT::COperatorScript::checkPause, and runMethodBase. |
float NLAIAGENT::CActorScript::priority |
( |
|
) |
const [virtual] |
|
void NLAIAGENT::CActorScript::processMessages |
( |
|
) |
[virtual] |
|
void NLAIAGENT::CActorScript::releaseClass |
( |
|
) |
[static] |
|
void NLAIAGENT::CActorScript::restart |
( |
|
) |
|
|
|
Restarts the actor.
Definition at line 243 of file actor_script.cpp.
References NLAIAGENT::CAgentScript::_AgentClass, NLAIAGENT::CAgentScript::_Components, _IsPaused, _Launched, NLAIAGENT::CAgentScript::_NbComponents, _OnRestartIndex, CActorScript, NLAIAGENT::CAgentScript::getAgentManager, NLAISCRIPT::CAgentClass::isMember, onRestart, r, NLAIAGENT::CAgentScript::runMethodeMember, NLAISCRIPT::CCodeContext::Self, NLAIC::CTypeOfObject::tActor, and NLAIAGENT::tQueue.
Referenced by NLAIAGENT::COperatorScript::checkPause, and runMethodBase. |
|
Reimplemented from NLAIAGENT::CAgentScript.
Reimplemented in NLAIAGENT::CFsmScript.
Definition at line 630 of file actor_script.cpp.
References _IsActivated, _NbAnswers, activate, fid_activate, fid_failure, fid_isactive, fid_launch, fid_msg_failure, fid_msg_success, fid_nb_answers, fid_onActivate, fid_onUnActivate, fid_owner, fid_pause, fid_restart, fid_success, fid_switch, fid_toplevel, fid_unActivate, NLAIAGENT::IConnectIA::getParent, getTopLevel, NLAIAGENT::IAgent::IAgent, NLAIAGENT::IBasicAgent::IBasicAgent, index, NLAIAGENT::IObjectIA::IObjectIA, Launch, onActivate, onUnActivate, params, pause, processFailure, processSuccess, r, restart, s, switchActor, and unActivate. |
|
Reimplemented from NLAIAGENT::CAgentScript.
Reimplemented in NLAIAGENT::CSeqFsmScript.
Definition at line 454 of file actor_script.cpp.
References _IsActivated, _Launched, _NbAnswers, activate, NLAILOGIC::CGoalPath::addGoal, fid_activate, fid_failure, fid_isactive, fid_launch, fid_launch_goal, fid_launched, fid_msg_failure, fid_msg_success, fid_nb_answers, fid_onActivate, fid_onUnActivate, fid_owner, fid_pause, fid_restart, fid_success, fid_switch, fid_toplevel, fid_unActivate, NLAIAGENT::IBaseGroupType::getFront, NLAIAGENT::IConnectIA::getParent, getTopLevel, NLAIAGENT::IAgent::IAgent, NLAIAGENT::IBasicAgent::IBasicAgent, NLAIC::IPointerGestion::incRef, index, Launch, onActivate, onFailure, onSuccess, onUnActivate, params, pause, NLAIAGENT::IBaseGroupType::popFront, r, restart, s, NLAILOGIC::CGoalPath::setFather, NLAIAGENT::IBaseGroupType::size, switchActor, and unActivate. |
void NLAIAGENT::CActorScript::setTopLevel |
( |
CAgentScript * |
|
) |
[virtual] |
|
void NLAIAGENT::CActorScript::success |
( |
|
) |
[virtual] |
|
void NLAIAGENT::CActorScript::switchActor |
( |
std::vector< CComponentHandle * > & |
, |
|
|
bool |
stay_active = false |
|
) |
[protected, virtual] |
|
void NLAIAGENT::CActorScript::switchActor |
( |
std::vector< CActorScript * > & |
, |
|
|
bool |
stay_active = false |
|
) |
[protected, virtual] |
|
|
Transfers activity to another actor.
The second arg bool must be set to true for this agent to stay active, false otherwise.
Definition at line 306 of file actor_script.cpp.
References unActivate. |
void NLAIAGENT::CActorScript::switchActor |
( |
CActorScript * |
, |
|
|
bool |
stay_active = false |
|
) |
[protected, virtual] |
|
|
Transfers activity to another actor.
The second arg bool must be set to true for this agent to stay active, false otherwise.
Definition at line 295 of file actor_script.cpp.
References unActivate.
Referenced by runMethodBase. |
void NLAIAGENT::CActorScript::unActivate |
( |
|
) |
|
|
|
Unactivates the actor.
Definition at line 149 of file actor_script.cpp.
References NLAIAGENT::CAgentScript::_AgentClass, _IsActivated, _IsPaused, _Launched, _OnActivateIndex, _OnUnActivateIndex, CActorScript, NLAIAGENT::CAgentScript::CAgentScript, NLAIAGENT::IAgentManager::getAgentContext, NLAIAGENT::CAgentScript::getAgentManager, NLAIAGENT::IConnectIA::getParent, NLAISCRIPT::CAgentClass::isMember, onUnActivate, r, NLAIAGENT::CAgentScript::removeDynamic, NLAIAGENT::CAgentScript::runMethodeMember, NLAISCRIPT::CCodeContext::Self, and NLAIAGENT::tQueue.
Referenced by cancel, NLAIAGENT::COperatorScript::onFailure, NLAIAGENT::COperatorScript::onSuccess, NLAIAGENT::COperatorScript::run, runMethodBase, and switchActor. |
Member Data Documentation
bool NLAIAGENT::CActorScript::_IsActivated [protected]
|
|
bool NLAIAGENT::CActorScript::_IsPaused [protected]
|
|
sint32 NLAIAGENT::CActorScript::_NbAnswers [protected]
|
|
bool NLAIAGENT::CActorScript::_OnActivate [protected]
|
|
sint32 NLAIAGENT::CActorScript::_OnActivateIndex [protected]
|
|
sint32 NLAIAGENT::CActorScript::_OnFailureIndex [protected]
|
|
sint32 NLAIAGENT::CActorScript::_OnPauseIndex [protected]
|
|
sint32 NLAIAGENT::CActorScript::_OnRestartIndex [protected]
|
|
sint32 NLAIAGENT::CActorScript::_OnSuccessIndex [protected]
|
|
sint32 NLAIAGENT::CActorScript::_OnUnActivateIndex [protected]
|
|
CAgentScript* NLAIAGENT::CActorScript::_TopLevel [protected]
|
|
The documentation for this class was generated from the following files:
|
|