 |
|
 |
 |
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
[legend]Collaboration diagram for NLAIAGENT::CActorScript:
[legend]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 int | getBaseMethodCount () const |
| | Return the nomber of internal C++ hard coded method that the class can process. 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 (char *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 IObjectIA::CProcessResult | runMethodBase (int heritance, int index,IObjectIA *) |
| virtual IObjectIA::CProcessResult | runMethodBase (int index,IObjectIA *) |
| virtual tQueue | isMember (const NLAIAGENT::IVarName *, const NLAIAGENT::IVarName *, const IObjectIA &) const |
| | The method isMember(nameSubClass,methodName,param) return the best method correspondent to the search. More...
|
| virtual sint32 | getMethodIndexSize () const |
| | getMethodIndexSize define the nomber of external method. More...
|
| void | getFatherComponent (IVarName &) |
| virtual void | cancel () |
| virtual void | success () |
| | 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 | failure () |
| 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...
|
Static Public Attributes |
| const NLAIC::CIdentType | IdActorScript |
Protected Types |
| enum | c_funcs_id {
fid_activate,
fid_onActivate,
fid_unActivate,
fid_onUnActivate,
fid_switch,
fid_launch,
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 |
| sint32 | _OnActivateIndex |
| sint32 | _OnUnActivateIndex |
| std::vector<CComponentHandle *> | _Actors |
| std::list<IBasicAgent *> | _Launched |
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 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_last
|
|
Definition at line 53 of file actor_script.h. |
Constructor & Destructor Documentation
|
NLAIAGENT::CActorScript::CActorScript (
|
IAgentManager * manager,
|
|
bool stay_alive = false )
|
|
|
NLAIAGENT::CActorScript::CActorScript (
|
const CActorScript & a )
|
|
|
NLAIAGENT::CActorScript::~CActorScript (
|
) [virtual]
|
|
Member Function Documentation
|
void NLAIAGENT::CActorScript::activate (
|
)
|
|
|
void NLAIAGENT::CActorScript::cancel (
|
) [virtual]
|
|
|
void NLAIAGENT::CActorScript::failure (
|
) [inline, virtual]
|
|
|
int NLAIAGENT::CActorScript::getBaseMethodCount (
|
) const [virtual]
|
|
|
void NLAIAGENT::CActorScript::getDebugString (
|
char * t ) const [virtual]
|
|
|
void NLAIAGENT::CActorScript::getFatherComponent (
|
IVarName & )
|
|
|
sint32 NLAIAGENT::CActorScript::getMethodIndexSize (
|
) const [virtual]
|
|
|
bool NLAIAGENT::CActorScript::isActivated (
|
)
|
|
|
bool NLAIAGENT::CActorScript::isEqual (
|
const IBasicObjectIA & a ) const [virtual]
|
|
|
|
The method isMember(nameSubClass,methodName,param) return the best method correspondent to the search.
remember we use the overloadind method.
NameSubClass: if this pointer is not NULL then NameSubClass is the name of the base class were the method are defined.
methodName: is the name of the class.
param: is an IObjectIA where it defined the parametre of the method. lot of method use a IObjectIA vector object with an NLAIC::CIdentType as the the template argm.
Reimplemented from NLAIAGENT::CAgentScript.
Reimplemented in NLAIAGENT::CFsmScript, and NLAIAGENT::CSeqFsmScript.
Definition at line 435 of file actor_script.cpp. |
|
const NLAIC::IBasicType * NLAIAGENT::CActorScript::newInstance (
|
void ) const [virtual]
|
|
|
void NLAIAGENT::CActorScript::onActivate (
|
) [virtual]
|
|
|
|
Callback called at the activation of the actor.
Definition at line 152 of file actor_script.cpp. |
|
void NLAIAGENT::CActorScript::onFailure (
|
IObjectIA * ) [inline, virtual]
|
|
|
void NLAIAGENT::CActorScript::onSuccess (
|
IObjectIA * ) [inline, virtual]
|
|
|
|
Dependencies failure and success notification These functions are called by other operators or goals who failed or succeeded.
Reimplemented in NLAIAGENT::CSeqFsmScript.
Definition at line 149 of file actor_script.h. |
|
void NLAIAGENT::CActorScript::onUnActivate (
|
) [virtual]
|
|
|
|
Callback called when the agent is unactivated.
Definition at line 158 of file actor_script.cpp. |
|
float NLAIAGENT::CActorScript::priority (
|
) const [virtual]
|
|
|
void NLAIAGENT::CActorScript::processMessages (
|
) [virtual]
|
|
|
void NLAIAGENT::CActorScript::success (
|
) [inline, virtual]
|
|
|
|
Own success and failure functions These function telle other operators and goals that might be waiting for the execution of this one.
Definition at line 144 of file actor_script.h. |
|
void NLAIAGENT::CActorScript::switchActor (
|
std::vector< CComponentHandle *>& handles,
|
|
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 137 of file actor_script.cpp. |
|
void NLAIAGENT::CActorScript::switchActor (
|
std::vector< CActorScript *>& actors,
|
|
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 121 of file actor_script.cpp. |
|
void NLAIAGENT::CActorScript::switchActor (
|
CActorScript * receiver,
|
|
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 110 of file actor_script.cpp. |
|
void NLAIAGENT::CActorScript::unActivate (
|
)
|
|
Member Data Documentation
bool NLAIAGENT::CActorScript::_IsActivated [protected]
|
|
std::list< IBasicAgent *> NLAIAGENT::CActorScript::_Launched [protected]
|
|
bool NLAIAGENT::CActorScript::_OnActivate [protected]
|
|
sint32 NLAIAGENT::CActorScript::_OnActivateIndex [protected]
|
|
sint32 NLAIAGENT::CActorScript::_OnUnActivateIndex [protected]
|
|
The documentation for this class was generated from the following files:
|
 |