# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
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 Reference

Class CActorScript Scripted actors for the creations of FSMs and other controlers. More...

#include <actor_script.h>

Inheritance diagram for NLAIAGENT::CActorScript

Inheritance graph
[legend]
Collaboration diagram for NLAIAGENT::CActorScript:

Collaboration graph
[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::IBasicTypeclone () const
 Inherited functions. More...

virtual const NLAIC::IBasicTypenewInstance () 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::CIdentTypegetType () 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 )
 

Definition at line 31 of file actor_script.cpp.

NLAIAGENT::CActorScript::CActorScript ( const CActorScript & a )
 

Definition at line 13 of file actor_script.cpp.

NLAIAGENT::CActorScript::CActorScript ( IAgentManager * manager,
IBasicAgent * father,
std::list< IObjectIA *>& components,
NLAISCRIPT::CAgentClass * actor_class )
 

Definition at line 20 of file actor_script.cpp.

NLAIAGENT::CActorScript::~CActorScript ( ) [virtual]
 

Definition at line 38 of file actor_script.cpp.


Member Function Documentation

void NLAIAGENT::CActorScript::activate ( )
 

Activates the actor.

Definition at line 54 of file actor_script.cpp.

void NLAIAGENT::CActorScript::cancel ( ) [virtual]
 

Reimplemented in NLAIAGENT::COperatorScript.

Definition at line 496 of file actor_script.cpp.

const NLAIC::IBasicType * NLAIAGENT::CActorScript::clone ( void ) const [virtual]
 

Inherited functions.

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 163 of file actor_script.cpp.

void NLAIAGENT::CActorScript::failure ( ) [inline, virtual]
 

Definition at line 145 of file actor_script.h.

int NLAIAGENT::CActorScript::getBaseMethodCount ( ) const [virtual]
 

Return the nomber of internal C++ hard coded method that the class can process.

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript.

Definition at line 429 of file actor_script.cpp.

void NLAIAGENT::CActorScript::getDebugString ( char * t ) const [virtual]
 

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.

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 183 of file actor_script.cpp.

void NLAIAGENT::CActorScript::getFatherComponent ( IVarName & )
 

Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

sint32 NLAIAGENT::CActorScript::getMethodIndexSize ( ) const [virtual]
 

getMethodIndexSize define the nomber of external method.

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript.

Definition at line 251 of file actor_script.cpp.

const NLAIC::CIdentType & NLAIAGENT::CActorScript::getType ( void ) const [virtual]
 

getType return a unique string how represente the class, it can be the name of the class.

This function is used for the sytem regstry class (see the definition of the template class Gen::CRegistry).

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 231 of file actor_script.cpp.

bool NLAIAGENT::CActorScript::isActivated ( )
 

Returns true if the actor has a token.

Definition at line 48 of file actor_script.cpp.

bool NLAIAGENT::CActorScript::isEqual ( const IBasicObjectIA & a ) const [virtual]
 

Implementation of the isEqual of the IBasicObjectIA.

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 192 of file actor_script.cpp.

tQueue NLAIAGENT::CActorScript::isMember ( const IVarName * className,
const IVarName * name,
const IObjectIA & param ) 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.

void NLAIAGENT::CActorScript::load ( NLMISC::IStream & is ) [virtual]
 

Load the class from a stream.

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 243 of file actor_script.cpp.

const NLAIC::IBasicType * NLAIAGENT::CActorScript::newInstance ( void ) const [virtual]
 

This function allow a new instance, that mean that the class is a class factory.

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 169 of file actor_script.cpp.

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]
 

Reimplemented in NLAIAGENT::CSeqFsmScript.

Definition at line 150 of file actor_script.h.

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]
 

Priority of the operator.

Reimplemented in NLAIAGENT::COperatorScript.

Definition at line 511 of file actor_script.cpp.

void NLAIAGENT::CActorScript::processMessages ( ) [virtual]
 

The processMessages method, process the loop/Run message.

Reimplemented from NLAIAGENT::CAgentScript.

Definition at line 202 of file actor_script.cpp.

const IObjectIA::CProcessResult & NLAIAGENT::CActorScript::run ( void ) [virtual]
 

The work of an agent.

Typically agent process child message, process its message and run its activity.

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 208 of file actor_script.cpp.

IObjectIA::CProcessResult NLAIAGENT::CActorScript::runMethodBase ( int index,
IObjectIA * params ) [virtual]
 

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript, and NLAIAGENT::CSeqFsmScript.

Definition at line 322 of file actor_script.cpp.

IObjectIA::CProcessResult NLAIAGENT::CActorScript::runMethodBase ( int index,
int heritance,
IObjectIA * params ) [virtual]
 

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CSeqFsmScript.

Definition at line 259 of file actor_script.cpp.

void NLAIAGENT::CActorScript::save ( NLMISC::IStream & os ) [virtual]
 

Save the class in a stream.

Reimplemented from NLAIAGENT::CAgentScript.

Reimplemented in NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 236 of file actor_script.cpp.

IObjectIA::CProcessResult NLAIAGENT::CActorScript::sendMessage ( IObjectIA * m ) [virtual]
 

sendMessage allow agent to send a message to an ather agent.The message is a IMessageBase.

Reimplemented from NLAIAGENT::CAgentScript.

Definition at line 197 of file actor_script.cpp.

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 ( )
 

Unactivates the actor.

Definition at line 77 of file actor_script.cpp.


Member Data Documentation

const NLAIC::CIdentType NLAIAGENT::CActorScript::IdActorScript [static]
 

Definition at line 124 of file actor_script.h.

std::vector< CComponentHandle *> NLAIAGENT::CActorScript::_Actors [protected]
 

Definition at line 70 of file actor_script.h.

bool NLAIAGENT::CActorScript::_IsActivated [protected]
 

Definition at line 64 of file actor_script.h.

std::list< IBasicAgent *> NLAIAGENT::CActorScript::_Launched [protected]
 

Definition at line 72 of file actor_script.h.

bool NLAIAGENT::CActorScript::_OnActivate [protected]
 

Definition at line 65 of file actor_script.h.

sint32 NLAIAGENT::CActorScript::_OnActivateIndex [protected]
 

Definition at line 67 of file actor_script.h.

sint32 NLAIAGENT::CActorScript::_OnUnActivateIndex [protected]
 

Definition at line 68 of file actor_script.h.


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