|
|
|
|
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 ReferenceClass Actor You can think of activation as a set of tokens passed between actors.
More...
#include <actor.h>
Inheritance diagram for NLAIAGENT::CActor:
List of all members.
Base class member method. |
virtual const NLAIC::IBasicType * | clone () 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::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 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 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 method define in the class. 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 |
( |
|
) |
|
|
NLAIAGENT::CActor::CActor |
( |
IAgent * |
, |
|
|
bool |
activated = false |
|
) |
|
|
NLAIAGENT::CActor::CActor |
( |
const CActor & |
|
) |
|
|
NLAIAGENT::CActor::~CActor |
( |
|
) |
|
|
Member Function Documentation
void NLAIAGENT::CActor::activate |
( |
|
) |
|
|
|
Adds a transition, ie a condition and a list of newly activated agents.
Definition at line 84 of file actor.cpp. |
|
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.
References CActor. |
void NLAIAGENT::CActor::forwardActivity |
( |
std::vector< CActor * > & |
, |
|
|
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.
References unActivate. |
void NLAIAGENT::CActor::forwardActivity |
( |
CActor * |
, |
|
|
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.
References unActivate.
Referenced by runMethodeMember. |
void NLAIAGENT::CActor::getDebugString |
( |
std::string & |
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.
References t.
Referenced by runMethodeMember. |
sint32 NLAIAGENT::CActor::getMethodIndexSize |
( |
|
) |
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.
References IdActor. |
bool NLAIAGENT::CActor::isActivated |
( |
|
) |
|
|
bool NLAIAGENT::CActor::isEqual |
( |
const IBasicObjectIA & |
a |
) |
const [virtual] |
|
void NLAIAGENT::CActor::onActivate |
( |
|
) |
[virtual] |
|
|
Callback called at the activation of the actor.
Definition at line 95 of file actor.cpp.
Referenced by activate. |
void NLAIAGENT::CActor::onUnActivate |
( |
|
) |
[virtual] |
|
|
Callback called when the agent is unactivated.
Definition at line 100 of file actor.cpp.
Referenced by unActivate. |
void NLAIAGENT::CActor::processMessages |
( |
|
) |
[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. |
|
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.
References activate, CActor, fid_activate, fid_forwardActivity, fid_unActivate, forwardActivity, getDebugString, id, params, r, and unActivate. |
void NLAIAGENT::CActor::unActivate |
( |
|
) |
|
|
Member Data Documentation
bool NLAIAGENT::CActor::_IsActivated [protected]
|
|
The documentation for this class was generated from the following files:
|
|