# 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

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

Collaboration graph
[legend]
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.

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

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.

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

virtual void runChildren () = 0
 Run all child.

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

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 external method. 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 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(s):
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 200 of file agents.cpp.

NLAIAGENT::IBasicAgent::IBasicAgent ( const IWordNumRef * parent )
 

Contruct agent with an parent.

Definition at line 205 of file agents.cpp.

NLAIAGENT::IBasicAgent::IBasicAgent ( const IWordNumRef * parent,
IMailBox * m )
 

Contruct agent with an parent and an mail box.

Definition at line 210 of file agents.cpp.

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

Definition at line 215 of file agents.cpp.


Member Function Documentation

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.

Reimplemented in NLAIAGENT::IAgentComposite, NLAIAGENT::CLocalAgentMail, and NLAIAGENT::CProxyAgentMail.

IMailBox * NLAIAGENT::IBasicAgent::getMail ( ) const
 

Get the mail box letter.

Definition at line 244 of file agents.cpp.

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

getMethodIndexSize define the nomber of external method.

Reimplemented from NLAIAGENT::IObjectIA.

Reimplemented in NLAIAGENT::CActor, NLAIAGENT::CActorScript, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CAgentWatchTimer, and NLAIAGENT::CFsmScript.

Definition at line 354 of file agents.cpp.

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

Get the curent state of the agent.

Reimplemented from NLAIAGENT::IConnectIA.

Definition at line 221 of file agents.cpp.

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

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

Reimplemented in NLAIAGENT::IAgent, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CAgentManagerTimer, and NLAIAGENT::CAgentWatchTimer.

tQueue NLAIAGENT::IBasicAgent::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::IObjectIA.

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CFsmScript, and NLAIAGENT::CSeqFsmScript.

Definition at line 359 of file agents.cpp.

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

Load the class from a stream.

Reimplemented from NLAIAGENT::IConnectIA.

Reimplemented in NLAIAGENT::CActor, NLAIAGENT::CActorScript, NLAIAGENT::IAgentComposite, NLAIAGENT::IAgent, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CGDAgentScript, NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 255 of file agents.cpp.

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

The processMessages method, process the loop/Run message.

Reimplemented in NLAIAGENT::CActor, NLAIAGENT::CActorScript, NLAIAGENT::IAgent, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, and NLAIAGENT::CMainAgentScript.

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

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

Reimplemented in NLAIAGENT::IAgentComposite, NLAIAGENT::CLocalAgentMail, and NLAIAGENT::CProxyAgentMail.

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

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

Reimplemented in NLAIAGENT::IAgentComposite, NLAIAGENT::CLocalAgentMail, and NLAIAGENT::CProxyAgentMail.

const CProcessResult & NLAIAGENT::IBasicAgent::run ( void ) [pure virtual]
 

The work of an agent.

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

Reimplemented from NLAIAGENT::IObjectIA.

Reimplemented in NLAIAGENT::CActor, NLAIAGENT::CActorScript, NLAIAGENT::IAgent, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CGDAgentScript, NLAIAGENT::CMainAgentScript, NLAIAGENT::CFsmScript, and NLAIAGENT::COperatorScript.

Referenced by NLAIAGENT::CAgentScript::runChildren().

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

Run message is the message processing.

Definition at line 272 of file agents.cpp.

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 107 of file agent.h.

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

Run the activity process an agent.

Reimplemented in NLAIAGENT::IAgent, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentWatchTimer, and NLAIAGENT::CAgentClockTimer.

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 453 of file agents.cpp.

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 130 of file agent.h.

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

Run all child.

Reimplemented in NLAIAGENT::IAgent, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CFsmScript, and NLAIAGENT::CSeqFsmScript.

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 156 of file agent.h.

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 94 of file agent.h.

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 81 of file agent.h.

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 143 of file agent.h.

IObjectIA::CProcessResult NLAIAGENT::IBasicAgent::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::IObjectIA.

Reimplemented in NLAIAGENT::CActor, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, and NLAIAGENT::CAgentWatchTimer.

Definition at line 401 of file agents.cpp.

IObjectIA::CProcessResult NLAIAGENT::IBasicAgent::runMethodeMember ( sint32 heritance,
sint32 index,
IObjectIA * param ) [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, NLAIAGENT::CProxyAgentMail, and NLAIAGENT::CAgentScript.

Definition at line 396 of file agents.cpp.

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 169 of file agent.h.

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::CAgentWatchTimer.

Definition at line 479 of file agents.cpp.

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

Save the class in a stream.

Reimplemented from NLAIAGENT::IConnectIA.

Reimplemented in NLAIAGENT::CActor, NLAIAGENT::CActorScript, NLAIAGENT::IAgentComposite, NLAIAGENT::IAgent, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CGDAgentScript, NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 249 of file agents.cpp.

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

Send message to an receiver agent.

Definition at line 238 of file agents.cpp.

IObjectIA::CProcessResult NLAIAGENT::IBasicAgent::sendMessage ( IMessageBase * msg ) [virtual]
 

Send a message to the agent.

Reimplemented from NLAIAGENT::IConnectIA.

Definition at line 232 of file agents.cpp.

Referenced by NLAIAGENT::CAgentScript::sendMessageToDynmaicChild().

void NLAIAGENT::IBasicAgent::setState ( TProcessStatement state,
IObjectIA * result ) [virtual]
 

Set the state of an agent.

Reimplemented from NLAIAGENT::IConnectIA.

Definition at line 226 of file agents.cpp.


Member Data Documentation

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

Box letter for communication service.

Definition at line 63 of file agent.h.

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

Initializer:

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

Definition at line 344 of file agents.cpp.

CProcessResult NLAIAGENT::IBasicAgent::_RunState [protected]
 

Internal state of the agent.

Definition at line 61 of file agent.h.


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