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

Base class for an agent.Basicly an agent is an IConnectIA that we can communicate with it and an basic agent can assume the operation of an children. More...

#include <agent.h>

Inheritance diagram for NLAIAGENT::IBasicAgent:

NLAIAGENT::IConnectIA NLAIAGENT::IRefrence NLAIAGENT::IObjectIA NLAIAGENT::IBasicObjectIA NLAIC::IBasicInterface NLAIC::IBasicType NLAIC::IPointerGestion NLMISC::IStreamable NLMISC::IClassable NLAIAGENT::CMsgWaiter NLAIAGENT::CProxyAgentMail NLAIAGENT::IAgentComposite NLAIAGENT::IAgent NLAIAGENT::CActor NLAIAGENT::CLocalAgentMail NLAIAGENT::IAgentManager NLAIAGENT::CAgentScript NLAIAGENT::CActorScript NLAIAGENT::CAgentManagerTimer NLAIAGENT::CAgentOperation NLAIAGENT::CAgentWatchTimer NLAIAGENT::IMainAgent NLAIAGENT::CFsmScript NLAIAGENT::COperatorScript NLAILOGIC::CGoalPath NLAIAGENT::CAgentClockTimer NLAIAGENT::CMainAgentScript NLAIAGENT::CSeqFsmScript List of all members.

Public Methods

 IBasicAgent (const IWordNumRef *parent)
 Contruct agent with an parent. More...

 IBasicAgent (const IWordNumRef *parent, IMailBox *m)
 Contruct agent with an parent and an mail box. More...

virtual ~IBasicAgent ()
virtual const CProcessResult & getState () const
 Get the curent state of the agent. More...

virtual void setState (TProcessStatement s, IObjectIA *result)
 Set the state of an agent. More...

virtual IObjectIA::CProcessResult sendMessage (IMessageBase *msg)
 Send a message to the agent. More...

virtual IObjectIA::CProcessResult sendMessage (IMessageBase *msg, IBasicAgent &receiver)
 Send message to an receiver agent. More...

virtual IObjectIA::CProcessResult runActivity ()=0
 Run the activity process an agent. More...

virtual bool haveActivity () const=0
 allow to know if the agent have an activity process to run. More...

IMailBoxgetMail () const
 Get the mail box letter. More...

virtual std::list< IBasicAgent
* >::iterator 
addChild (IBasicAgent *p)=0
 Add a child to the agent. More...

virtual void removeChild (const IBasicAgent *p)=0
 Remove a child from the std::list<IBasicAgent *> child list. More...

virtual void removeChild (std::list< IBasicAgent * >::iterator &iter)=0
 Remove a child from the std::list<IBasicAgent *> child list. More...

virtual void runChildren ()=0
 Run all child. More...

virtual void processMessages ()=0
 The processMessages method, process the loop/Run message. More...

virtual const CProcessResult & run ()=0
 The work of an agent. More...

Some IBasicInterface method.
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...

Some IObjectIA method.
virtual sint32 getMethodIndexSize () const
 getMethodIndexSize define the nomber of method define in the class. More...

virtual tQueue isMember (const IVarName *, const IVarName *, const IObjectIA &) const
 The method isMember(nameSubClass,methodName,param) return the best method correspondent to the search. More...

virtual CProcessResult runMethodeMember (sint32, sint32, IObjectIA *)
 The methode runMethodeMember(sint32 heritance, sint32 index, IObjectIA *param) allow us to run a member method. More...

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


Protected Methods

 IBasicAgent (const IBasicAgent &a)
 Copy constructor we protect it because agent need an unique ident, and we don't wont to give this possibility to all programmer because it is dangerous. More...

virtual IObjectIArun (const IMessageBase &m)
 Run message is the message processing. More...

virtual IMessageBaserunExec (const IMessageBase &m)
 RunExec is to processing reltative to PExec Performatif. More...

virtual IMessageBaserunEven (const IMessageBase &m)
 RunExec is to processing reltative to PExec Performatif. More...

virtual IMessageBaserunAchieve (const IMessageBase &m)
 runAchieve ist to processing reltative to PAchieve Performatif. More...

virtual IMessageBaserunAsk (const IMessageBase &m)
 runAsk is to processing reltative to PAsk Performatif. More...

virtual IMessageBaserunTell (const IMessageBase &m)
 runTell is to processing reltative to PTell Performatif. More...

virtual IMessageBaserunBreak (const IMessageBase &m)
 runBreak is to processing reltative to PBreak Performatif. More...

virtual void onKill (IConnectIA *A)
 Called by an agent who's destroyed te remove its references. More...

virtual IMessageBaserunKill (const IMessageBase &m)
 runKill is to processing reltative to PKill Performatif. More...

virtual IMessageBaserunError (const IMessageBase &m)
 runError is to processing reltative to PError Performatif. More...

virtual IMessageBaserunService (const IMessageBase &m)
 runService is to processing reltative to PService Performatif. More...


Protected Attributes

CProcessResult _RunState
 Internal state of the agent. More...

IMailBox_Mail
 Box letter for communication service. More...


Static Private Attributes

CMethodCall _Method []

Detailed Description

Base class for an agent.Basicly an agent is an IConnectIA that we can communicate with it and an basic agent can assume the operation of an children.

Author:
Chafik sameh , Portier Pierre , Nevrax France
Date:
2000

Definition at line 45 of file agent.h.


Constructor & Destructor Documentation

NLAIAGENT::IBasicAgent::IBasicAgent const IBasicAgent &    a [protected]
 

Copy constructor we protect it because agent need an unique ident, and we don't wont to give this possibility to all programmer because it is dangerous.

Definition at line 288 of file agents.cpp.

References _Mail.

Referenced by NLAIAGENT::IAgentComposite::addChild, NLAIAGENT::CLocalAgentMail::addChild, NLAIAGENT::CMainAgentScript::addDynamicAgent, NLAIAGENT::CAgentScript::addDynamicAgent, NLAIAGENT::COperatorScript::checkTrigMsg, NLAIAGENT::IAgentComposite::cpyChild, NLAIAGENT::IAgentComposite::deleteListe, NLAIAGENT::CLocalAgentMail::getHost, NLAIAGENT::IAgentComposite::IAgentComposite, NLAIAGENT::IAgentManager::IAgentManager, NLAIAGENT::IAgentComposite::load, NLAIAGENT::CLocalAgentMail::load, NLAIAGENT::IAgent::newInstance, NLAIAGENT::IAgent::onKill, NLAIAGENT::IAgentComposite::removeChild, NLAIAGENT::CLocalAgentMail::removeChild, NLAIAGENT::COperatorScript::run, runAsk, NLAIAGENT::CAgentScript::runAskParentNotify, NLAIAGENT::IAgent::runChildrenStepByStep, NLAIAGENT::CActorScript::runMethodBase, runMethodeMember, and NLAIAGENT::IAgentComposite::save.

NLAIAGENT::IBasicAgent::IBasicAgent const IWordNumRef   parent
 

Contruct agent with an parent.

Definition at line 294 of file agents.cpp.

References _Mail, and NLAIAGENT::tMailBoxLettre.

NLAIAGENT::IBasicAgent::IBasicAgent const IWordNumRef   parent,
IMailBox   m
 

Contruct agent with an parent and an mail box.

Definition at line 300 of file agents.cpp.

References _Mail.

NLAIAGENT::IBasicAgent::~IBasicAgent   [virtual]
 

Definition at line 305 of file agents.cpp.

References _Mail.


Member Function Documentation

virtual std::list<IBasicAgent *>::iterator NLAIAGENT::IBasicAgent::addChild IBasicAgent *    p [pure virtual]
 

Add a child to the agent.

Child is added in a std::list<IBasicAgent *>. The method return the range of the child in the list.

Implemented in NLAIAGENT::IAgentComposite.

IMailBox * NLAIAGENT::IBasicAgent::getMail   const
 

Get the mail box letter.

Definition at line 334 of file agents.cpp.

References _Mail.

Referenced by NLAIAGENT::IAgent::processMessages, NLAIAGENT::CAgentScript::processMessages, NLAIAGENT::CMainAgentScript::run, NLAIAGENT::IAgent::run, and NLAIAGENT::IAgent::runStep.

sint32 NLAIAGENT::IBasicAgent::getMethodIndexSize   const [virtual]
 

getMethodIndexSize define the nomber of method define in the class.

Reimplemented from NLAIAGENT::IObjectIA.

Reimplemented in NLAIAGENT::CActor.

Definition at line 450 of file agents.cpp.

const IObjectIA::CProcessResult & NLAIAGENT::IBasicAgent::getState   const [virtual]
 

Get the curent state of the agent.

Implements NLAIAGENT::IConnectIA.

Definition at line 311 of file agents.cpp.

References _RunState.

Referenced by NLAIAGENT::CMainAgentScript::run, NLAIAGENT::IAgent::run, NLAIAGENT::CAgentClockTimer::runActivity, NLAIAGENT::CAgentWatchTimer::runActivity, and NLAIAGENT::IAgent::runStep.

virtual bool NLAIAGENT::IBasicAgent::haveActivity   const [pure virtual]
 

allow to know if the agent have an activity process to run.

Implemented in NLAIAGENT::IAgent.

tQueue NLAIAGENT::IBasicAgent::isMember const IVarName  ,
const IVarName  ,
const IObjectIA  
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::IObjectIA.

Reimplemented in NLAIAGENT::CLocalAgentMail.

Definition at line 455 of file agents.cpp.

References NLAIAGENT::_GetNumId, NLAIAGENT::_RunAsk, NLAIAGENT::_RunTel, NLAISCRIPT::CParam::eval, NLAISCRIPT::CMessageClass::IdMessageClass, NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass, and NLAIAGENT::tQueue.

void NLAIAGENT::IBasicAgent::load NLMISC::IStream   is [virtual]
 

Load the class from a stream.

Implements NLAIAGENT::IConnectIA.

Reimplemented in NLAIAGENT::CActor.

Definition at line 345 of file agents.cpp.

References _Mail, and id.

void NLAIAGENT::IBasicAgent::onKill IConnectIA   A [protected, virtual]
 

Called by an agent who's destroyed te remove its references.

Reimplemented from NLAIAGENT::IConnectIA.

Reimplemented in NLAIAGENT::IAgentComposite.

Definition at line 362 of file agents.cpp.

References _Mail.

virtual void NLAIAGENT::IBasicAgent::processMessages   [pure virtual]
 

The processMessages method, process the loop/Run message.

Implemented in NLAIAGENT::CActor.

virtual void NLAIAGENT::IBasicAgent::removeChild std::list< IBasicAgent * >::iterator &    iter [pure virtual]
 

Remove a child from the std::list<IBasicAgent *> child list.

Implemented in NLAIAGENT::IAgentComposite.

virtual void NLAIAGENT::IBasicAgent::removeChild const IBasicAgent *    p [pure virtual]
 

Remove a child from the std::list<IBasicAgent *> child list.

Implemented in NLAIAGENT::IAgentComposite.

virtual const CProcessResult& NLAIAGENT::IBasicAgent::run   [pure virtual]
 

The work of an agent.

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

Implements NLAIAGENT::IObjectIA.

Implemented in NLAIAGENT::CActor.

Referenced by runMethodeMember.

IObjectIA * NLAIAGENT::IBasicAgent::run const IMessageBase   m [protected, virtual]
 

Run message is the message processing.

Reimplemented in NLAIAGENT::CMsgWaiter.

Definition at line 367 of file agents.cpp.

References NLAIAGENT::IObjectIA::IObjectIA, runAchieve, runAsk, runBreak, runError, runEven, runExec, runKill, runTell, and NLAIC::stringGetBuild.

virtual IMessageBase* NLAIAGENT::IBasicAgent::runAchieve const IMessageBase   m [inline, protected, virtual]
 

runAchieve ist to processing reltative to PAchieve Performatif.

its call from the IObjectIA *run(const IMessageBase &m) method.

Definition at line 127 of file agent.h.

References NLAIC::IBasicType::getDebugString, and NLAIC::IBasicType::getType.

Referenced by run.

virtual IObjectIA::CProcessResult NLAIAGENT::IBasicAgent::runActivity   [pure virtual]
 

Run the activity process an agent.

Implemented in NLAIAGENT::IAgent.

IMessageBase * NLAIAGENT::IBasicAgent::runAsk const IMessageBase   m [protected, virtual]
 

runAsk is to processing reltative to PAsk Performatif.

its call from the IObjectIA *run(const IMessageBase &m) method.

Definition at line 549 of file agents.cpp.

References NLAIC::IBasicType::getDebugString, NLAIAGENT::IConnectIA::getParent, NLAIC::IBasicType::getType, IBasicAgent, NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass, and NLAIC::stringGetBuild.

Referenced by run.

virtual IMessageBase* NLAIAGENT::IBasicAgent::runBreak const IMessageBase   m [inline, protected, virtual]
 

runBreak is to processing reltative to PBreak Performatif.

its call from the IObjectIA *run(const IMessageBase &m) method.

Definition at line 159 of file agent.h.

References NLAIC::IBasicType::getDebugString, and NLAIC::IBasicType::getType.

Referenced by run.

virtual void NLAIAGENT::IBasicAgent::runChildren   [pure virtual]
 

Run all child.

Implemented in NLAIAGENT::IAgent.

virtual IMessageBase* NLAIAGENT::IBasicAgent::runError const IMessageBase   m [inline, protected, virtual]
 

runError is to processing reltative to PError Performatif.

its call from the IObjectIA *run(const IMessageBase &m) method.

Definition at line 206 of file agent.h.

References NLAIC::IBasicType::getDebugString, and NLAIC::IBasicType::getType.

Referenced by run.

virtual IMessageBase* NLAIAGENT::IBasicAgent::runEven const IMessageBase   m [inline, protected, virtual]
 

RunExec is to processing reltative to PExec Performatif.

its call from the IObjectIA *run(const IMessageBase &m) method.

Definition at line 105 of file agent.h.

References NLAIC::IBasicType::getDebugString, and NLAIC::IBasicType::getType.

Referenced by run.

virtual IMessageBase* NLAIAGENT::IBasicAgent::runExec const IMessageBase   m [inline, protected, virtual]
 

RunExec is to processing reltative to PExec Performatif.

its call from the IObjectIA *run(const IMessageBase &m) method.

Reimplemented in NLAIAGENT::CMainAgentScript.

Definition at line 83 of file agent.h.

References NLAIC::IBasicType::getDebugString, and NLAIC::IBasicType::getType.

Referenced by run.

virtual IMessageBase* NLAIAGENT::IBasicAgent::runKill const IMessageBase   m [inline, protected, virtual]
 

runKill is to processing reltative to PKill Performatif.

its call from the IObjectIA *run(const IMessageBase &m) method.

Reimplemented in NLAIAGENT::CAgentWatchTimer.

Definition at line 184 of file agent.h.

References NLAIC::IBasicType::getDebugString, and NLAIC::IBasicType::getType.

Referenced by run.

IObjectIA::CProcessResult NLAIAGENT::IBasicAgent::runMethodeMember sint32    index,
IObjectIA  
[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::IObjectIA.

Reimplemented in NLAIAGENT::CActor.

Definition at line 497 of file agents.cpp.

References NLAIAGENT::_Father, NLAIAGENT::_GetMailer, NLAIAGENT::_GetNumId, NLAIAGENT::_RunAsk, NLAIAGENT::_RunTel, NLAIAGENT::IConnectIA::getParent, IBasicAgent, index, NLAIAGENT::IRefrence::IRefrence, param, run, and t.

IObjectIA::CProcessResult NLAIAGENT::IBasicAgent::runMethodeMember sint32   ,
sint32   ,
IObjectIA  
[virtual]
 

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

heritance: is the id returned by the methodisClassInheritedFrom(const IVarName &). 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::IObjectIA.

Reimplemented in NLAIAGENT::CLocalAgentMail.

Definition at line 492 of file agents.cpp.

References index.

virtual IMessageBase* NLAIAGENT::IBasicAgent::runService const IMessageBase   m [inline, protected, virtual]
 

runService is to processing reltative to PService Performatif.

its call from the IObjectIA *run(const IMessageBase &m) method.

Definition at line 228 of file agent.h.

References NLAIC::IBasicType::getDebugString, and NLAIC::IBasicType::getType.

IMessageBase * NLAIAGENT::IBasicAgent::runTell const IMessageBase   m [protected, virtual]
 

runTell is to processing reltative to PTell Performatif.

its call from the IObjectIA *run(const IMessageBase &m) method.

Reimplemented in NLAIAGENT::CActorScript.

Definition at line 575 of file agents.cpp.

References NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass.

Referenced by run.

void NLAIAGENT::IBasicAgent::save NLMISC::IStream   os [virtual]
 

Save the class in a stream.

Implements NLAIAGENT::IConnectIA.

Reimplemented in NLAIAGENT::CActor.

Definition at line 339 of file agents.cpp.

References _Mail.

IObjectIA::CProcessResult NLAIAGENT::IBasicAgent::sendMessage IMessageBase   msg,
IBasicAgent &    receiver
[virtual]
 

Send message to an receiver agent.

Definition at line 328 of file agents.cpp.

IObjectIA::CProcessResult NLAIAGENT::IBasicAgent::sendMessage IMessageBase   msg [virtual]
 

Send a message to the agent.

Implements NLAIAGENT::IConnectIA.

Definition at line 322 of file agents.cpp.

References _Mail.

Referenced by NLAILOGIC::IGoal::failure, and NLAILOGIC::IGoal::success.

void NLAIAGENT::IBasicAgent::setState TProcessStatement    s,
IObjectIA   result
[virtual]
 

Set the state of an agent.

Implements NLAIAGENT::IConnectIA.

Definition at line 316 of file agents.cpp.

References _RunState, and NLAIAGENT::TProcessStatement.

Referenced by NLAIAGENT::CAgentWatchTimer::runActivity, NLAIAGENT::CAgentWatchTimer::runKill, and NLAIAGENT::CAgentWatchTimer::runTell.


Member Data Documentation

IMailBox* NLAIAGENT::IBasicAgent::_Mail [protected]
 

Box letter for communication service.

Definition at line 63 of file agent.h.

Referenced by getMail, IBasicAgent, load, onKill, save, sendMessage, and ~IBasicAgent.

IBasicAgent::CMethodCall NLAIAGENT::IBasicAgent::_Method [static, private]
 

Initial value:

 
        {
                IBasicAgent::CMethodCall(_MAILER_,_GetMailer),
                IBasicAgent::CMethodCall(_FATHER_,_Father),
                IBasicAgent::CMethodCall(_RUNTEL_,_RunTel),
                IBasicAgent::CMethodCall(_RUNASK_,_RunAsk),
                IBasicAgent::CMethodCall(_GETNUMID_,_GetNumId)
        }

Definition at line 440 of file agents.cpp.

CProcessResult NLAIAGENT::IBasicAgent::_RunState [protected]
 

Internal state of the agent.

Definition at line 61 of file agent.h.

Referenced by getState, and setState.


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