# 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::CActor Class Reference

Class Actor You can think of activation as a set of tokens passed between actors. More...

#include <actor.h>

Inheritance diagram for NLAIAGENT::CActor

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

Collaboration graph
[legend]
List of all members.

Base class member method.

virtual const NLAIC::IBasicTypeclone () const
 This function allow a pointer copy, that mean that the new class have the sam attributs caracteristics as the owne. 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 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 tQueue isMember (const NLAIAGENT::IVarName *, const NLAIAGENT::IVarName *, const IObjectIA &) const
virtual IObjectIA::CProcessResult runMethodeMember (sint32, IObjectIA *)
 The methode runMethodeMember(sint32 index,IObjectIA *param) allow us to run a own member method. More...

virtual sint32 getMethodIndexSize () const
 getMethodIndexSize define the nomber of external method. More...

const NLAIC::CIdentType IdActor

Public Methods

 CActor ()
 Default constructor. More...

 CActor (IAgent *, bool activated = false)
 Builds and actor with its father. More...

 CActor (const CActor &)
 copy constructor. More...

 ~CActor ()
bool isActivated ()
 Returns true if the actor has a token. More...

void addTransition (NLAILOGIC::IBaseCond *, std::vector<CActor *> &, bool)
 Adds a transition, ie a condition and a list of newly activated agents. 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...


Protected Types

enum  c_funcs_id {
  fid_activate,
  fid_unActivate,
  fid_forwardActivity
}

Protected Methods

virtual void forwardActivity (CActor *, bool stay_active = false)
 Transfers activity to another actor. More...

virtual void forwardActivity (std::vector<CActor *> &, bool stay_active = false)
 Transfers activity to another actor. More...


Protected Attributes

bool _IsActivated

Detailed Description

Class Actor 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 46 of file actor.h.


Member Enumeration Documentation

enum NLAIAGENT::CActor::c_funcs_id [protected]
 

Enumeration values:
fid_activate  
fid_unActivate  
fid_forwardActivity  

Definition at line 50 of file actor.h.


Constructor & Destructor Documentation

NLAIAGENT::CActor::CActor ( )
 

Default constructor.

Definition at line 8 of file actor.cpp.

NLAIAGENT::CActor::CActor ( IAgent * father,
bool activated = false )
 

Builds and actor with its father.

Definition at line 13 of file actor.cpp.

NLAIAGENT::CActor::CActor ( const CActor & c )
 

copy constructor.

Definition at line 19 of file actor.cpp.

NLAIAGENT::CActor::~CActor ( )
 

Definition at line 24 of file actor.cpp.


Member Function Documentation

void NLAIAGENT::CActor::activate ( )
 

Activates the actor.

Definition at line 37 of file actor.cpp.

void NLAIAGENT::CActor::addTransition ( NLAILOGIC::IBaseCond * cond,
std::vector< CActor *>& outputs,
bool stay_alive )
 

Adds a transition, ie a condition and a list of newly activated agents.

Definition at line 84 of file actor.cpp.

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

This function allow a pointer copy, that mean that the new class have the sam attributs caracteristics as the owne.

Reimplemented from NLAIAGENT::IAgent.

Definition at line 105 of file actor.cpp.

void NLAIAGENT::CActor::forwardActivity ( std::vector< CActor *>& 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 70 of file actor.cpp.

void NLAIAGENT::CActor::forwardActivity ( CActor * 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 59 of file actor.cpp.

void NLAIAGENT::CActor::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::IAgent.

Definition at line 121 of file actor.cpp.

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

getMethodIndexSize define the nomber of external method.

Reimplemented from NLAIAGENT::IBasicAgent.

Definition at line 261 of file actor.cpp.

const NLAIC::CIdentType & NLAIAGENT::CActor::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::IAgent.

Definition at line 162 of file actor.cpp.

bool NLAIAGENT::CActor::isActivated ( )
 

Returns true if the actor has a token.

Definition at line 31 of file actor.cpp.

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

Implementation of the isEqual of the IBasicObjectIA.

Reimplemented from NLAIAGENT::IAgent.

Definition at line 130 of file actor.cpp.

tQueue NLAIAGENT::CActor::isMember ( const IVarName * className,
const NLAIAGENT::IVarName * name,
const IObjectIA & param ) const [virtual]
 

Definition at line 179 of file actor.cpp.

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

Load the class from a stream.

Reimplemented from NLAIAGENT::IAgent.

Definition at line 174 of file actor.cpp.

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

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

Reimplemented from NLAIAGENT::IAgent.

Definition at line 111 of file actor.cpp.

void NLAIAGENT::CActor::onActivate ( ) [virtual]
 

Callback called at the activation of the actor.

Definition at line 95 of file actor.cpp.

void NLAIAGENT::CActor::onUnActivate ( ) [virtual]
 

Callback called when the agent is unactivated.

Definition at line 100 of file actor.cpp.

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

The processMessages method, process the loop/Run message.

Reimplemented from NLAIAGENT::IAgent.

Definition at line 135 of file actor.cpp.

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

The work of an agent.

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

Reimplemented from NLAIAGENT::IAgent.

Definition at line 146 of file actor.cpp.

IObjectIA::CProcessResult NLAIAGENT::CActor::runMethodeMember ( sint32 index,
IObjectIA * param ) [virtual]
 

The methode runMethodeMember(sint32 index,IObjectIA *param) allow us to run a own member method.

index: is the method id return by the isMember(const IVarName *,const IVarName *,const IObjectIA &) const method. param: is the parametre for the method.

Reimplemented from NLAIAGENT::IBasicAgent.

Definition at line 212 of file actor.cpp.

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

Save the class in a stream.

Reimplemented from NLAIAGENT::IAgent.

Definition at line 167 of file actor.cpp.

void NLAIAGENT::CActor::unActivate ( )
 

Unactivates the actor.

Definition at line 47 of file actor.cpp.


Member Data Documentation

const NLAIC::CIdentType NLAIAGENT::CActor::IdActor [static]
 

Definition at line 105 of file actor.h.

bool NLAIAGENT::CActor::_IsActivated [protected]
 

Definition at line 57 of file actor.h.


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