NLAIAGENT::CAgentScript Class Reference

#include <agent_script.h>

Inheritance diagram for NLAIAGENT::CAgentScript:

NLAIAGENT::IAgentManager NLAIAGENT::IAgent NLAIAGENT::IAgentComposite NLAIAGENT::IBasicAgent NLAIAGENT::IConnectIA NLAIAGENT::IRefrence NLAIAGENT::IObjectIA NLAIAGENT::IBasicObjectIA NLAIC::IBasicInterface NLAIC::IBasicType NLAIC::IPointerGestion NLMISC::IStreamable NLMISC::IClassable NLAIAGENT::CActorScript NLAIAGENT::CAgentManagerTimer NLAIAGENT::CAgentOperation NLAIAGENT::CAgentWatchTimer NLAIAGENT::IMainAgent NLAIAGENT::CFsmScript NLAIAGENT::COperatorScript NLAILOGIC::CGoalPath NLAIAGENT::CAgentClockTimer NLAIAGENT::CMainAgentScript NLAIAGENT::CSeqFsmScript

Detailed Description

Class for managing script agent.

Author:
Chafik sameh

Nevrax France

Date:
2000

Definition at line 64 of file agent_script.h.

NLAIC::IBasicInterface base class method.

virtual const NLAIC::IBasicTypeclone () const
virtual void getDebugString (std::string &t) const
virtual const NLAIC::CIdentTypegetType () const
virtual void load (NLMISC::IStream &is)
virtual const NLAIC::IBasicTypenewInstance () const
virtual void save (NLMISC::IStream &os)

IAgentManager member method.

virtual const IObjectIAgetAgentContext () const
 Get an valid context for this instance.

virtual int getBaseMethodCount () const
 Get an valid context for this instance.


[NOHEADER]

virtual const NLAILOGIC::CFactBasegetFactBase ()
 Get the fact base of the agent, if not exist it return NULL.

virtual void removeGoal (NLAILOGIC::CGoal *)
 remove a goal, it hapend when it neaded by user, when the priorty is down or when the goal is satisfay.

virtual IObjectIA::CProcessResult runCancelGoalMsg (IBaseGroupType *)
 Cancel a goal, it call by message manager when a cancel goal message is occure.

virtual IObjectIA::CProcessResult runFactMsg (IBaseGroupType *)
 Add a fact on the fact base, it occur when a fact message hapend.

virtual IObjectIA::CProcessResult runGoalMsg (IBaseGroupType *)
 Run all goal message, it call by message manager when a goal message is occure.

virtual void setTopLevel (NLAIAGENT::CAgentScript *)
 Set the top level agent of this one.


Base class member method.

virtual std::string getMethodeMemberDebugString (sint32, sint32) const
virtual sint32 getMethodIndexSize () const
virtual TQueue getPrivateMember (const IVarName *, const NLAIAGENT::IVarName *, const IObjectIA &) const
virtual const IObjectIAgetStaticMember (sint32) const
virtual sint32 getStaticMemberIndex (const IVarName &) const
virtual sint32 getStaticMemberSize () const
virtual bool haveActivity () const
 allow to know if the agent have an activity process to run.

virtual sint32 isClassInheritedFrom (const NLAIAGENT::IVarName &) const
virtual TQueue isDeflautProccessMsg (const IVarName *, const NLAIAGENT::IVarName *, const IObjectIA &) const
virtual bool isEqual (const IBasicObjectIA &a) const
 Implementation of the isEqual of the IBasicObjectIA.

virtual TQueue isMember (const IVarName *, const NLAIAGENT::IVarName *, const IObjectIA &) const
virtual void onKill (IConnectIA *A)
 Called by an agent who's destroyed te remove its references.

virtual void processContinuation (IMessageBase *, IMessageBase *)
virtual void processMessages (IMessageBase *, IObjectIA *)
virtual void processMessages ()
virtual const IObjectIA::CProcessResultrun ()
virtual IObjectIA::CProcessResult runActivity ()
 Mailer do'nt have own activity.

virtual void runChildren ()
virtual bool runChildrenStepByStep ()
 Activates the child agents.

virtual IObjectIA::CProcessResult runMethodBase (int index, IObjectIA *)
virtual IObjectIA::CProcessResult runMethodBase (int heritance, int index, IObjectIA *)
virtual IObjectIA::CProcessResult runMethodeMember (sint32 index, IObjectIA *)
virtual IObjectIA::CProcessResult runMethodeMember (sint32 heritance, sint32 index, IObjectIA *)
virtual const CProcessResult & runStep ()
virtual CProcessResult sendMessage (const IVarName &, IObjectIA *)
virtual CProcessResult sendMessage (IObjectIA *)
CProcessResult sendMessageToDynmaicChild (const IVarName &, IObjectIA *)
IObjectIA::CProcessResult sendMethod (IObjectIA *)
IObjectIA::CProcessResult sendMethodCompoment (IObjectIA *)
virtual bool setStaticMember (sint32, IObjectIA *)

Public Types

enum  TMethodNumDef {
  TSend, TSendComponent, TGetChildTag, TAddChildTag,
  TRemoveChild, TFather, TSelf, TGetName,
  TIsInherited, TGetClassName, TRunTellComponent, TRunAskComponent,
  TRunAskParentNotify, TRunTellParentNotify, TRunAskDebugString, TSetStatic,
  TGetValue, TSetValue, TDeflautProccessMsg, TInitComponent,
  TIsEUU, TAddSet, TLastM
}
 This enum define ident for hard coded method that we have to import its under the script. More...

enum  TTypeCheck { CheckAll, CheckCount, DoNotCheck }

Public Member Functions

virtual void addSet (const std::string &)
 Add a set for the agent.

virtual std::set< std::string
>::const_iterator 
beginSet () const
 CAgentScript (IAgentManager *, IBasicAgent *, std::list< IObjectIA * > &, NLAISCRIPT::CAgentClass *)
 Build with an knowning manager and a list of static compoment. Generally this contructor is called by the script.

 CAgentScript (IAgentManager *)
 Build with an knowning manager.

 CAgentScript (const CAgentScript &)
 Construct with copy constructor.

virtual void callConstructor ()
virtual void callFunction (std::string &, NLAIAGENT::IObjectIA *p=NULL)
virtual TQueue canProcessMessage (const IVarName &)
void connect (IConnectIA *b)
sint32 decRef ()
 Decrement the reference of an object.

virtual std::set< std::string
>::const_iterator 
endSet () const
virtual sint getChildCoun () const
const NLAISCRIPT::CAgentClassgetClass () const
virtual const NLAIAGENT::IVarNamegetClassName () const
 Returns the name of the class in the registry.

virtual const std::vector<
NLAILOGIC::CGoal * > * 
getGoalStack ()
virtual const CIdent getIdentType () const
virtual const std::string getInfo ()
IMailBoxgetMail () const
 Get the mail box letter.

virtual const IRefrencegetOwner () const
 To get the top level parent of this agent.

IConnectIAgetParent () const
 to get the agent parents

const sint32getRef () const
 get the refence count.

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

const IObjectIAgetStaticMember (const IVarName &compName) const
virtual NLAILOGIC::CGoalgetTopGoal ()
void incRef ()
 Inc a reference. We use this when we have to conserve a pointer memeory for exemple in a list.

virtual void init (IObjectIA *)
virtual bool isa (const std::string &) const
 Test the set of the agent.

virtual sint32 isClassInheritedFrom (const IVarName &) const
virtual bool isLocal ()
 If the result is true the object is loclal else its a representation of an object on the server. By the method return true.

virtual void Kill ()
 Call this function to destroy an agent including its referneces in other agents and its childs.

 operator const IWordNumRef & () const
 to get a word num ref of the agents.

 operator const IWordNumRef * () const
 to get a word num ref pointer of the agents.

bool operator== (const IBasicObjectIA &classType) const
virtual void release ()
 Release allow to release the pointer. The last release when the _Ref is nul delete the object.

void removeConnection (IConnectIA *Agent)
 To release a connection.

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

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

virtual void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
virtual void setParent (const IWordNumRef *parent)
 to set the parent of the agents.

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

bool setStaticMember (const IVarName &compName, IObjectIA *change)
void setTypeAt (uint64 t)
 That function allow user to change the 7 bit of the type field in the sid agent number;.

virtual ~CAgentScript ()

Static Public Member Functions

void initAgentScript ()
void releaseAgentScript ()

Static Public Attributes

const NLAIC::CIdentTypeIdAgent = NULL
const NLAIC::CIdentType IdAgentScript
NLAISCRIPT::COperandSimpleListOrIdMsgNotifyParent = NULL
NLAISCRIPT::COperandSimpleIdMsgNotifyParentClass = NULL
NLAISCRIPT::COperandSimpleListOrmsgPerf = NULL
NLAISCRIPT::COperandSimpleListOrmsgType = NULL
NLAISCRIPT::CParamParamGetValueMsg = NULL
NLAISCRIPT::COperandSimpleListOrParamIdGetValueMsg = NULL
NLAISCRIPT::COperandSimpleListOrParamIdInitComponentMsg = NULL
NLAISCRIPT::COperandSimpleListOrParamIdSetValueMsg = NULL
NLAISCRIPT::COperandSimpleListOrParamIdTellComponentMsg = NULL
NLAISCRIPT::CParamParamInitComponentMsg = NULL
NLAISCRIPT::CParamParamRunParentNotify = NULL
NLAISCRIPT::CParamParamSetStatic
NLAISCRIPT::CParamParamSetValueMsg = NULL
NLAISCRIPT::CParamParamTellComponentMsg = NULL
TProcessStatement ProcessBuzzy = processBuzzy
TProcessStatement ProcessEnd = processEnd
TProcessStatement ProcessError = processError
TProcessStatement ProcessIdle = processIdle
TProcessStatement ProcessLocked = processLocked
CProcessResult ProcessNotComplit = IObjectIA::CProcessResult(processNotComplete)
CProcessResult ProcessRun = IObjectIA::CProcessResult()
NLAISCRIPT::CParamSendCompParamMessageScript = NULL
NLAISCRIPT::CParamSendParamMessageScript = NULL
CMethodCall ** StaticMethod = NULL

Protected Member Functions

void connectLoadStream (NLMISC::IStream &is)
void createComponents (std::list< IObjectIA * > &)
void refLoadStream (NLMISC::IStream &is)
 the loader of the class.

virtual IObjectIArun (const IMessageBase &m)
virtual IMessageBaserunAchieve (const IMessageBase &m)
virtual IMessageBaserunAsk (const IMessageBase &m)
virtual IMessageBaserunBreak (const IMessageBase &m)
virtual IMessageBaserunError (const IMessageBase &m)
virtual IMessageBaserunEven (const IMessageBase &m)
virtual IMessageBaserunExec (const IMessageBase &m)
virtual IMessageBaserunKill (const IMessageBase &m)
virtual IMessageBaserunService (const IMessageBase &m)
virtual IMessageBaserunTell (const IMessageBase &m)
virtual CProcessResult sendBroadCast (IObjectIA *)
void setNumRef (const IWordNumRef &ref)

Protected Attributes

NLAISCRIPT::CAgentClass_AgentClass
 The creator of this instance. This useful for find scripted method entry point.

TBasicList _AgentList
IAgentManager_AgentManager
 The manager where the agent is run this manager have the agent script context.

IObjectIA ** _Components
 Table of static compoments.

TListIBasic _Connected
TListIBasic _Connection
TSetDefNameAgent _DynamicAgentName
 Map for store agent added in the dynamic child container.

sint _iComponents
IMailBox_Mail
 Box letter for communication service.

int _NbComponents
 Nomber of static compoment.

CProcessResult _RunState
 Internal state of the agent.

sint _SizeChild
std::set< std::string > mapSet

Private Types

typedef std::multiset< CKeyAgentTSetDefNameAgent
 Type def for the map witch store the name of dynamic agent store in the agent.


Member Typedef Documentation

typedef std::multiset<CKeyAgent> NLAIAGENT::CAgentScript::TSetDefNameAgent [private]
 

Type def for the map witch store the name of dynamic agent store in the agent.

Definition at line 159 of file agent_script.h.


Member Enumeration Documentation

enum NLAIAGENT::CAgentScript::TMethodNumDef
 

This enum define ident for hard coded method that we have to import its under the script.

Enumeration values:
TSend 
TSendComponent  Index of the send method.
TGetChildTag  Index of the send with continuation method.
TAddChildTag  Index of the getChild method.
TRemoveChild  Index of the addChild method.
TFather  Index of the removeDynamic method.
TSelf  Get the father of the agent.
TGetName  Get The self pointer.
TIsInherited  Get the name of the agent in the manager child list.
TGetClassName 
TRunTellComponent  Returns the name of the class in the registry.
TRunAskComponent  transmit Message to an compoment.
TRunAskParentNotify  transmit Message to an compoment.
TRunTellParentNotify  the offest of the runAskParentNotify method.
TRunAskDebugString  the offest of the runTellParentNotify method.
TSetStatic  Process msg debug string, that is to have a string that represente the agent statue at a time.
TGetValue  Method to assign a new value to a static component.
TSetValue  Processes the "Ask(GetValueMsg)" msg to obtain a public value of the agent.
TDeflautProccessMsg  Processes the "Tell(SetValueMsg)" msg to connect to the value of a distant object.
TInitComponent 
TIsEUU 
TAddSet 
TLastM  The count of export method.

Definition at line 69 of file agent_script.h.

00069                                     {                   
00070                         TSend, 
00071                         TSendComponent, 
00072                         TGetChildTag, 
00073                         TAddChildTag,
00074                         TRemoveChild,
00075                         TFather, 
00076                         TSelf, 
00077                         TGetName, 
00078                         TIsInherited,
00079                         TGetClassName, 
00080                         TRunTellComponent, 
00081                         TRunAskComponent, 
00082                         TRunAskParentNotify, 
00083                         TRunTellParentNotify, 
00084                         TRunAskDebugString, 
00085                         TSetStatic,     
00086                         TGetValue,      
00087                         TSetValue,      
00088 //                      TGetValueReturn,        /// Processes the "Tell(GetValueMsg)" msg resulting from a "Ask(GetValueMsg)" message sent.
00089                         TDeflautProccessMsg,
00090                         TInitComponent,
00091                         TIsEUU,
00092                         TAddSet,
00093                         TLastM 
00094                 };

enum NLAIAGENT::CAgentScript::TTypeCheck
 

Enumeration values:
CheckAll 
CheckCount 
DoNotCheck 

Definition at line 96 of file agent_script.h.

00096                                {
00097                         CheckAll,
00098                         CheckCount,
00099                         DoNotCheck
00100                 };


Constructor & Destructor Documentation

NLAIAGENT::CAgentScript::CAgentScript const CAgentScript  ) 
 

Construct with copy constructor.

Definition at line 377 of file agent_script.cpp.

References _AgentClass, _AgentManager, _Components, _iComponents, _NbComponents, NLAIC::IBasicType::clone(), NLAIC::IBasicType::getType(), mapSet, t, and uint.

Referenced by clone(), and newInstance().

00377                                                        : IAgentManager(a)
00378         {
00379                 _iComponents = 0;
00380 
00381                 _AgentClass = a._AgentClass;
00382                 /*if ( a._AgentClass )
00383                 {                       
00384                         a._AgentClass->incRef();
00385                 }*/
00386 
00387                 _NbComponents = a._NbComponents;
00388                 if ( _NbComponents != 0 )
00389                 {
00390                         _Components = new IObjectIA *[ _NbComponents ];
00391 
00392                         //sint32 nb_scripted = 0;
00393                         for ( int i = 0; i < _NbComponents; i++ )
00394                         {
00395                                 _Components[i] = (IObjectIA *)a._Components[i]->clone();                
00396 
00397                                 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent;
00398                                 const NLAIC::CTypeOfObject &t = (const NLAIC::CTypeOfObject &)_Components[i]->getType();
00399                                 if( (t.getValue() & b ) == b)
00400                                 {                                       
00401                                         ((CAgentScript *)_Components[i])->setParent( (const IWordNumRef *) *this);
00402                                 }
00403                         }
00404                 }
00405                 else
00406                         _Components = NULL;
00407 
00408                 _AgentManager = a._AgentManager;
00409 
00410                 mapSet = a.mapSet;
00411                 //if(_AgentManager) _AgentManager->incRef();
00412 
00413 /*              std::vector<NLAILOGIC::IBaseOperator *>::const_iterator it_o = a._Operators.begin();
00414                 while ( it_o != a._Operators.end() )
00415                 {
00416                         addOperator( *it_o );
00417                         it_o++;
00418                 }*/
00419         }

NLAIAGENT::CAgentScript::CAgentScript IAgentManager  ) 
 

Build with an knowning manager.

Definition at line 421 of file agent_script.cpp.

References _AgentManager, _Components, _iComponents, and _NbComponents.

00421                                                          : IAgentManager( NULL ), _AgentClass( NULL )
00422         {
00423                 _iComponents = 0;
00424                 _Components = NULL;
00425                 _NbComponents = 0;              
00426                 _AgentManager = manager;
00427         }

NLAIAGENT::CAgentScript::CAgentScript IAgentManager ,
IBasicAgent ,
std::list< IObjectIA * > &  ,
NLAISCRIPT::CAgentClass
 

Build with an knowning manager and a list of static compoment. Generally this contructor is called by the script.

Definition at line 429 of file agent_script.cpp.

References _AgentManager, _iComponents, components, and createComponents().

00433         : IAgentManager(father), _AgentClass( agent_class )
00434         {       
00435                 /*if ( _AgentClass )
00436                         _AgentClass->incRef();*/
00437 
00438                 _iComponents = 0;
00439 
00440                 _AgentManager = manager;
00441                 // Creates the static components array
00442 //              _NbComponents = components.size();
00443 /*
00444                 if ( _NbComponents )
00445                 {
00446                         _Components = new IObjectIA *[ _NbComponents ];
00447                         std::list<IObjectIA *>::iterator it_c = components.begin();
00448                         int id_c = 0;
00449                         //sint32 nb_scripted = 0;
00450                         while ( it_c != components.end() )
00451                         {
00452                                 IObjectIA *o = (IObjectIA *)*it_c;
00453                                 _Components[id_c] = o;
00454 
00455                                 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent;
00456                                 const NLAIC::CTypeOfObject &t = o->getType();
00457 
00458                                 if((t.getValue() & b) == b)
00459                                 {
00460                                         ((CAgentScript *)o)->setParent( (const IWordNumRef *) *this);
00461                                 }
00462 
00463                                 it_c++;
00464                                 id_c++;
00465                         }               
00466                 }
00467                 else
00468                 {
00469                         _Components =NULL;
00470                         _AgentManager = manager;
00471                 }
00472                 */
00473                 createComponents( components );
00474         }       

NLAIAGENT::CAgentScript::~CAgentScript  )  [virtual]
 

Definition at line 476 of file agent_script.cpp.

References _Components, _NbComponents, NLAIAGENT::IAgent::Kill(), and NLAIC::IPointerGestion::release().

00477         {
00478                 Kill();
00479                 /*if ( _AgentClass )
00480                         _AgentClass->release();*/
00481 
00482                 // destruction of static components
00483                 if(_Components != NULL)
00484                 {
00485                         for ( int i = 0; i < _NbComponents; i++ )
00486                         {
00487 #ifdef NL_DEBUG
00488                                 const IObjectIA *o = _Components[i];
00489 #endif
00490                                 _Components[i]->release();
00491                         }
00492                         delete[] _Components;
00493                 }               
00494         }


Member Function Documentation

std::list< IBasicAgent * >::iterator NLAIAGENT::IAgentComposite::addChild IBasicAgent p  )  [virtual, inherited]
 

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.

Implements NLAIAGENT::IBasicAgent.

Reimplemented in NLAIAGENT::CLocalAgentMail.

Definition at line 67 of file basic_agent.cpp.

References NLAIAGENT::IAgentComposite::_AgentList, NLAIAGENT::IAgentComposite::_SizeChild, NLAIAGENT::IMailBox::addMailBox(), NLAIAGENT::IBasicAgent::getMail(), and NLAIC::IPointerGestion::incRef().

Referenced by addDynamicAgent(), NLAIAGENT::IAgentComposite::IAgentComposite(), and NLAIAGENT::IAgentComposite::load().

00068         {                       
00069                 p->incRef();
00070                 _AgentList.push_front((IBasicAgent *)p);
00071                 // Donne au fils accès à la boite aux lettres du père
00072                 p->getMail()->addMailBox( this->getMail() );
00073                 _SizeChild ++;
00074 
00075                 return _AgentList.begin();
00076         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::addDynamicAgent const CStringType ,
IBasicAgent
[virtual]
 

that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g);

Reimplemented in NLAIAGENT::CMainAgentScript.

Definition at line 811 of file agent_script.cpp.

References _DynamicAgentName, NLAIAGENT::IAgentComposite::addChild(), NLAIAGENT::CStringType::getDebugString(), NLAIC::IBasicType::getType(), r, NLAIAGENT::IConnectIA::setParent(), NLAIAGENT::IMessageBase::setPerformatif(), NLAIAGENT::IMessageBase::setSender(), t, type, and uint.

00812         {
00813 #ifdef NL_DEBUG
00814                 std::string dbg_name;
00815                 const char *type;
00816                 name.getDebugString( dbg_name );
00817                 type = (const char *)agent->getType();
00818                 const char *tname = dbg_name.c_str();
00819 #endif
00820                 IObjectIA::CProcessResult r;
00821                 r.ResultState = IObjectIA::ProcessIdle;
00822 
00823                 agent->setParent( (const IWordNumRef *) *this );
00824                 CNotifyParentScript *m = new CNotifyParentScript(this);
00825                 m->setSender(this);
00826                 m->setPerformatif(IMessageBase::PTell);
00827                 ((IObjectIA *) agent )->sendMessage(m);
00828                 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent;
00829                 const NLAIC::CTypeOfObject &t = agent->getType();
00830                 if((t.getValue() & b) == b)
00831                 {
00832                         ((CAgentScript *) agent )->setAgentManager(this);
00833                 }
00834                 _DynamicAgentName.insert(CKeyAgent(name,addChild( agent )));
00835                 
00836                 r.Result = NULL;
00837                 return r;
00838         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::addDynamicAgent NLAIAGENT::IBaseGroupType g  )  [virtual]
 

Add an agent to the dynamic agent child. Method have an IBaseGroupType argument, this argument must store an CStringType first and an IObjectIA pointer memory next. The CStringType is the name of the agent. The IObjectIA pointer memory is the agent. Not that in generally this method is called by the script

Reimplemented in NLAIAGENT::CMainAgentScript.

Definition at line 761 of file agent_script.cpp.

References _DynamicAgentName, NLAIAGENT::IAgentComposite::addChild(), NLAIC::IBasicType::clone(), NLAIAGENT::IBaseGroupType::getIterator(), NLAIC::IBasicType::getType(), NLAIAGENT::CConstIteratorContener::isInEnd(), r, s, NLAIAGENT::IConnectIA::setParent(), NLAIAGENT::IMessageBase::setPerformatif(), NLAIAGENT::IMessageBase::setSender(), sint, t, type, and uint.

Referenced by NLAIAGENT::CActorScript::Launch(), and runMethodBase().

00762         {
00763                 CIteratorContener i = g->getIterator();
00764                 CStringType &s = (CStringType &)*i++;
00765                 IBasicAgent *a = (IBasicAgent *)i++;
00766                 IBasicAgent *o = a;
00767                 sint n = 1;
00768 
00769 #ifdef NL_DEBUG
00770                 std::string name;
00771                 const char *type;
00772                 s.getDebugString(name);
00773 
00774                 type = (const char *)a->getType();
00775                 const char *tname = name.c_str();
00776 #endif
00777                 if(!i.isInEnd())
00778                 {
00779                         n = (sint)((NLAIAGENT::INombreDefine *)i++)->getNumber();
00780                 }
00781 
00782                 IObjectIA::CProcessResult r;
00783                 r.ResultState = IObjectIA::ProcessIdle;
00784 
00785                 while(n --)
00786                 {
00787                         o->setParent( (const IWordNumRef *) *this );
00788                         CNotifyParentScript *m = new CNotifyParentScript(this);
00789                         //this->incRef();
00790                         m->setSender(this);
00791                         m->setPerformatif(IMessageBase::PTell);
00792                         ((IObjectIA *)o)->sendMessage(m);
00793 
00794                         uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent;
00795                         const NLAIC::CTypeOfObject &t = o->getType();
00796 
00797                         if((t.getValue() & b) == b)
00798                         {
00799                                 ((CAgentScript *)o)->setAgentManager(this);
00800                         }
00801 
00802                         _DynamicAgentName.insert(CKeyAgent(s,addChild(o)));
00803                         if(n) o = (IBasicAgent *)a->clone();
00804                 }
00805                 
00806                 r.Result = NULL;
00807 
00808                 return r;
00809         }

void NLAIAGENT::IConnectIA::addInConnectedList const IConnectIA a  )  [protected, inherited]
 

Definition at line 595 of file baseai.cpp.

References NLAIAGENT::IConnectIA::_Connected.

Referenced by NLAIAGENT::IConnectIA::connect(), and NLAIAGENT::IConnectIA::connectLoadStream().

00596         {
00597                 _Connected.insert(a);
00598         }

void NLAIAGENT::IConnectIA::addInConnectionList const IConnectIA a  )  [protected, inherited]
 

Definition at line 572 of file baseai.cpp.

References NLAIAGENT::IConnectIA::_Connection.

Referenced by NLAIAGENT::IConnectIA::connect(), and NLAIAGENT::IConnectIA::connectLoadStream().

00573         {
00574                 _Connection.insert(a);
00575         }

void NLAIAGENT::CAgentScript::addOperator NLAILOGIC::IBaseOperator  )  [virtual]
 

Method for adding operator.

Definition at line 1667 of file agent_script.cpp.

01668         {
01669 //              _Operators.push_back(op);
01670         }

void NLAIAGENT::CAgentScript::addSet const std::string &   )  [virtual]
 

Add a set for the agent.

Definition at line 756 of file agent_script.cpp.

References mapSet, and s.

Referenced by runMethodBase().

00757         {
00758                 mapSet.insert(s);
00759         }

virtual std::set<std::string>::const_iterator NLAIAGENT::CAgentScript::beginSet  )  const [inline, virtual]
 

Definition at line 362 of file agent_script.h.

References mapSet.

00363                 {
00364                         return mapSet.begin();
00365                 }

void NLAIAGENT::CAgentScript::callConstructor  )  [virtual]
 

Definition at line 2420 of file agent_script.cpp.

References NLAISCRIPT::CCodeContext::Code, NLAISCRIPT::CAgentClass::findMethod(), NLAISCRIPT::CAgentClass::getBrancheCode(), getClass(), getType(), NLAISCRIPT::CCodeBrancheRun::run(), NLAISCRIPT::CCodeContext::Self, sint32, and uint32.

02421         {
02422                 NLAIAGENT::CStringVarName constructor_func_name("Constructor");
02423                 sint32 id_func = getClass()->findMethod( constructor_func_name, NLAISCRIPT::CParam() );
02424 
02425 #ifdef NL_DEBUG
02426 
02427                 const char * ttt = (const char *) getType();
02428 #endif
02429                 if ( id_func != -1 )
02430                 {       
02431                         NLAISCRIPT::CStackPointer stack;
02432                         NLAISCRIPT::CStackPointer heap;
02433                         NLAISCRIPT::CCodeContext codeContext(stack, heap, NULL, this, NLAISCRIPT::CCallPrint::inputOutput);
02434                         codeContext.Self = this;
02435                         NLAISCRIPT::CCodeBrancheRun *o = (NLAISCRIPT::CCodeBrancheRun *) getClass()->getBrancheCode( id_func ).getCode();                       
02436                         codeContext.Code = o;
02437                         int ip;
02438                         if(codeContext.Code != NULL) ip = (uint32)*codeContext.Code;
02439                         else ip =0;
02440 
02441                         *codeContext.Code = 0;
02442 
02443                         (void)o->run(codeContext);
02444 
02445                         *codeContext.Code = ip;
02446 
02447                 }
02448         }

void NLAIAGENT::CAgentScript::callFunction std::string &  ,
NLAIAGENT::IObjectIA p = NULL
[virtual]
 

Definition at line 2450 of file agent_script.cpp.

References NLAISCRIPT::CCodeContext::Code, NLAISCRIPT::CAgentClass::findMethod(), NLAISCRIPT::CAgentClass::getBrancheCode(), getClass(), getType(), NLAISCRIPT::CCodeBrancheRun::run(), NLAISCRIPT::CCodeContext::Self, sint32, and uint32.

02451         {
02452                 NLAIAGENT::CStringVarName func_name( f_name.c_str() );
02453                 sint32 id_func = getClass()->findMethod( func_name, NLAISCRIPT::CParam() );
02454 
02455 #ifdef NL_DEBUG
02456                 const char * ttt = (const char *) getType();
02457 #endif
02458                 if ( id_func != -1 )
02459                 {       
02460                         NLAISCRIPT::CStackPointer stack;
02461                         NLAISCRIPT::CStackPointer heap;
02462                         NLAISCRIPT::CCodeContext codeContext(stack, heap, NULL, this, NLAISCRIPT::CCallPrint::inputOutput);
02463                         codeContext.Self = this;
02464                         NLAISCRIPT::CCodeBrancheRun *o = (NLAISCRIPT::CCodeBrancheRun *) getClass()->getBrancheCode( id_func ).getCode();                       
02465                         codeContext.Code = o;
02466                         int ip;
02467                         if(codeContext.Code != NULL) ip = (uint32)*codeContext.Code;
02468                         else ip =0;
02469 
02470                         *codeContext.Code = 0;
02471 
02472                         (void)o->run(codeContext);
02473 
02474                         *codeContext.Code = ip;
02475 
02476                 }
02477         }

TQueue NLAIAGENT::IObjectIA::canProcessMessage const IVarName  )  [virtual, inherited]
 

The method canProcessMessage(const IVarName &msgName) allow us to know if agent can preocess given by msgName.

TQueue contain the liste of method (same as a run(msg)) that coud process the msg.

Reimplemented in NLAIAGENT::CLocalAgentMail.

Definition at line 350 of file baseai.cpp.

References NLAIAGENT::TQueue.

Referenced by NLAIAGENT::CLocalAgentMail::canProcessMessage().

00351         {
00352                 return TQueue();
00353         }

const NLAIC::IBasicType * NLAIAGENT::CAgentScript::clone  )  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.

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentClockTimer, NLAIAGENT::CMainAgentScript, NLAIAGENT::CAgentOperation, NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript.

Definition at line 644 of file agent_script.cpp.

References CAgentScript().

00645         {               
00646                 CAgentScript *result = new CAgentScript(*this);
00647                 return result;
00648         }

void NLAIAGENT::IConnectIA::connect IConnectIA b  )  [inherited]
 

When agent want to make connection he have to call this method to connect to an agent. When it call the B object is added in the connection list.

Definition at line 555 of file baseai.cpp.

References NLAIAGENT::IConnectIA::addInConnectedList(), and NLAIAGENT::IConnectIA::addInConnectionList().

Referenced by NLAIAGENT::CAgentWatchTimer::addAttrib(), NLAIAGENT::IAgentInput::addInputConnection(), NLAIAGENT::CLocalMailBox::addMailBox(), NLAIAGENT::CAgentWatchTimer::CAgentWatchTimer(), NLAIAGENT::CLocalAgentMail::CLocalAgentMail(), NLAIAGENT::CAgentOperation::connectOnChange(), and NLAIAGENT::IConnectIA::setParent().

00556         {
00557                 b->addInConnectedList(this);
00558                 addInConnectionList(b);
00559         }

void NLAIAGENT::IConnectIA::connectLoadStream NLMISC::IStream is  )  [protected, inherited]
 

Definition at line 521 of file baseai.cpp.

References NLAIAGENT::IConnectIA::addInConnectedList(), NLAIAGENT::IConnectIA::addInConnectionList(), num, NLMISC::IStream::serial(), and sint32.

Referenced by NLAIAGENT::IConnectIA::IConnectIA(), and NLAIAGENT::IConnectIA::load().

00522         {
00523                 IRefrence::refLoadStream(is);
00524                 NLAIC::CIdentTypeAlloc id;
00525                 sint32 i;
00526                 is.serial( i );
00527 
00528                 if(i)
00529                 {
00530                         while(i --)
00531                         {                                       
00532                                 is >> id;
00533                                 IWordNumRef *num = (IWordNumRef *)id.allocClass();
00534                                 num->load(is);
00535                                 addInConnectionList((IConnectIA *)((const IRefrence *)*num));
00536                                 delete num; 
00537                         }
00538                 }
00539 
00540                 
00541                 is.serial(i);
00542                 if(i)
00543                 {
00544                         while(i--)
00545                         {
00546                                 is >> id;                                       
00547                                 IWordNumRef *num = (IWordNumRef *)id.allocClass();
00548                                 num->load(is);
00549                                 addInConnectedList((IConnectIA *)((const IRefrence *)*num));
00550                                 delete num;
00551                         }
00552                 }
00553         }

void NLAIAGENT::IAgentComposite::cpyChild const IBasicAgent p  )  [inherited]
 

Definition at line 78 of file basic_agent.cpp.

References NLAIAGENT::IAgentComposite::_AgentList, NLAIAGENT::IAgentComposite::_SizeChild, and NLAIC::IBasicType::clone().

00079         {
00080                 _AgentList.push_front((IBasicAgent *)p.clone());
00081                 _SizeChild ++;
00082         }

void NLAIAGENT::CAgentScript::createComponents std::list< IObjectIA * > &   )  [protected]
 

Definition at line 2391 of file agent_script.cpp.

References _Components, _NbComponents, components, t, and uint.

Referenced by CAgentScript().

02392         {
02393                 _NbComponents = components.size();
02394                 if ( _NbComponents )
02395                 {
02396                         _Components = new IObjectIA *[ _NbComponents ];
02397                         std::list<IObjectIA *>::iterator it_c = components.begin();
02398                         int id_c = 0;
02399                         while ( it_c != components.end() )
02400                         {
02401                                 IObjectIA *o = (IObjectIA *)*it_c;
02402                                 _Components[id_c] = o;
02403 
02404                                 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent;
02405                                 const NLAIC::CTypeOfObject &t = o->getType();
02406 
02407                                 if((t.getValue() & b) == b)
02408                                 {
02409                                         ((CAgentScript *)o)->setParent( (const IWordNumRef *) *this);
02410                                 }
02411 
02412                                 it_c++;
02413                                 id_c++;
02414                         }               
02415                 }
02416                 else
02417                         _Components = NULL;
02418         }

sint32 NLAIC::IPointerGestion::decRef  )  [inline, inherited]
 

Decrement the reference of an object.

Definition at line 93 of file abstract_interface.h.

References NLAIC::IPointerGestion::_Ref, and sint32.

Referenced by NLAIC::IPointerGestion::release(), and NLAIAGENT::CAgentTimerHandle::~CAgentTimerHandle().

00094                 {
00095                         return --_Ref;
00096                 }

virtual std::set<std::string>::const_iterator NLAIAGENT::CAgentScript::endSet  )  const [inline, virtual]
 

Definition at line 367 of file agent_script.h.

References mapSet.

00368                 {
00369                         return mapSet.end();
00370                 }

virtual const IObjectIA* NLAIAGENT::CAgentScript::getAgentContext  )  const [inline, virtual]
 

Get an valid context for this instance.

Implements NLAIAGENT::IAgentManager.

Reimplemented in NLAIAGENT::CMainAgentScript.

Definition at line 296 of file agent_script.h.

References NLAIAGENT::IAgentManager::getAgentContext(), and getAgentManager().

00297                 {
00298                         return getAgentManager()->getAgentContext();
00299                 }

const IAgentManager* NLAIAGENT::CAgentScript::getAgentManager  )  const [inline]
 

Get the manager of the instance.

Definition at line 271 of file agent_script.h.

References _AgentManager.

Referenced by NLAIAGENT::COperatorScript::checkPreconditions(), NLAIAGENT::COperatorScript::execOnActivate(), NLAIAGENT::CActorScript::failure(), getAgentContext(), NLAIAGENT::CActorScript::pause(), NLAIAGENT::CActorScript::restart(), NLAIAGENT::CActorScript::run(), NLAIAGENT::CActorScript::success(), and NLAIAGENT::CActorScript::unActivate().

00272                 {
00273                         return _AgentManager;
00274                 }

int NLAIAGENT::CAgentScript::getBaseMethodCount  )  const [virtual]
 

Get an valid context for this instance.

Reimplemented from NLAIAGENT::IAgentManager.

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CMainAgentScript, NLAIAGENT::CAgentOperation, NLAIAGENT::CFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript.

Definition at line 2107 of file agent_script.cpp.

Referenced by NLAIAGENT::CAgentWatchTimer::getBaseMethodCount(), NLAIAGENT::CActorScript::getBaseMethodCount(), getMethodeMemberDebugString(), processMessages(), and runMethodeMember().

02108         {
02109                 return IAgentManager::getBaseMethodCount() + CAgentScript::TLastM;
02110         }

virtual sint NLAIAGENT::IAgentComposite::getChildCoun  )  const [inline, virtual, inherited]
 

Definition at line 358 of file agent.h.

References NLAIAGENT::IAgentComposite::_SizeChild, and sint.

00359                         {
00360                                 return _SizeChild;
00361                         }

sint32 NLAIAGENT::CAgentScript::getChildMessageIndex const IMessageBase ,
sint32 
[virtual]
 

get the mail boxe for scripted message.

Definition at line 512 of file agent_script.cpp.

References _AgentClass, NLAISCRIPT::CAgentClass::getChildMessageIndex(), and sint32.

00513         {
00514                 return _AgentClass->getChildMessageIndex( msg, child_index );
00515         }

const NLAISCRIPT::CAgentClass* NLAIAGENT::CAgentScript::getClass  )  const [inline]
 

Definition at line 421 of file agent_script.h.

References _AgentClass.

Referenced by NLAIAGENT::CActorScript::activate(), callConstructor(), callFunction(), and NLAIAGENT::CActorScript::unActivate().

00422                 {
00423                         return _AgentClass;
00424                 }

virtual std::string NLAIC::IPointerGestion::getClassName  )  [inline, virtual, inherited]
 

Implements NLMISC::IClassable.

Reimplemented in NLAIC::CIdentType.

Definition at line 116 of file abstract_interface.h.

Referenced by NLAISCRIPT::CAgentClass::isClassInheritedFrom().

00117                 {
00118                         return std::string("<unnamed>");
00119                 }

const NLAIAGENT::IVarName * NLAIAGENT::CAgentScript::getClassName  )  const [virtual]
 

Returns the name of the class in the registry.

Definition at line 79 of file agent_script.cpp.

References _AgentClass, and NLAISCRIPT::IClassInterpret::getClassName().

Referenced by runMethodBase().

00080         {
00081                 const NLAIAGENT::IVarName *classname;
00082                 if ( _AgentClass != NULL )
00083                 {
00084                         classname = _AgentClass->getClassName();
00085                 }
00086                 else
00087                         classname = new CStringVarName("<unknown>"); // Memory leak ?
00088 
00089                 return classname;
00090         }

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

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentOperation, NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 664 of file agent_script.cpp.

References _AgentClass, _AgentManager, _Components, _NbComponents, NLAIC::IBasicType::clone(), NLAIAGENT::IAgentManager::getAgentContext(), NLAISCRIPT::CAgentClass::getComponentName(), NLAIC::IBasicType::getDebugString(), NLAIAGENT::CStringType::getStr(), NLAIAGENT::IVarName::getString(), NLAISCRIPT::IClassInterpret::getType(), getType(), NLAIAGENT::CIdMethod::Index, isMember(), param, r, NLAIC::IPointerGestion::release(), NLAISCRIPT::CCallMethod::runOpCode(), NLAISCRIPT::CCodeContext::Self, NLAISCRIPT::CCodeContext::Stack, NLAIC::stringGetBuild(), t, and NLAIAGENT::TQueue.

Referenced by runAskDebugString().

00665         {               
00666 
00667                 if( _AgentManager != NULL)
00668                 {
00669                         const NLAISCRIPT::CParam p;
00670                         static CStringVarName debugStringF("GetDebugString");
00671 
00672                         TQueue r = isMember(NULL,&debugStringF,p);
00673                         if(r.size())
00674                         {
00675                                 NLAISCRIPT::CCodeContext *c = (NLAISCRIPT::CCodeContext *)_AgentManager->getAgentContext()->clone();
00676                                 NLAIAGENT::CIdMethod m = r.top();
00677                                 //msg->setMethodIndex(0,m.Index);       
00678                                 c->Self = this;
00679 
00680                                 IBaseGroupType *param = new CGroupType();                                                               
00681                                 (*c).Stack ++;
00682                                 (*c).Stack[(int)(*c).Stack] = param;
00683                                 NLAISCRIPT::IMethodContext *methodContex = new NLAISCRIPT::CMethodContext();
00684                                 NLAISCRIPT::CCallMethod opCall(methodContex,0,m.Index);
00685                                 opCall.runOpCode(*c);                                                                                           
00686                                 const NLAIAGENT::CStringType *returnMsg = (const NLAIAGENT::CStringType *)c->Stack[(int)(*c).Stack];                            
00687                                 t += returnMsg->getStr().getString();
00688                                 (*c).Stack--;
00689                                 c->release();
00690                                 return;
00691                         }
00692                 }
00693                 
00694                 t += NLAIC::stringGetBuild("class type <%s> ",(const char *)getType());
00695                 if ( _AgentClass )
00696                         t += NLAIC::stringGetBuild("<%s> (scripted)  -StaticComponents:\n",(const char *)_AgentClass->getType());
00697                 else
00698                         t += "<undefined_class> (scripted) -StaticComponents:\n";
00699                 for (int i = 0; i < _NbComponents; i++ )
00700                 {
00701                         std::string buf;
00702                         t += "\t\t";
00703                         if ( _AgentClass->getComponentName(i) )
00704                         {
00705                                 t += _AgentClass->getComponentName(i);
00706                         }
00707                         else
00708                                 t += "<unnamed>";
00709 
00710                         t += "\t\t";
00711                         _Components[i]->getDebugString(buf);
00712                         t += "[ ";
00713                         t += buf;
00714                         t += " ]";
00715                         if(i != (_NbComponents-1)) t += "\n";
00716                 }
00717                 
00718         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::getDynamicAgent NLAIAGENT::IBaseGroupType g  )  [virtual]
 

Get agent from the dynamic agent child. Method have an IBaseGroupType argument where he must store an CStringType representative of the name of the agent.

Definition at line 884 of file agent_script.cpp.

References _DynamicAgentName, NLAIAGENT::IBaseGroupType::get(), r, s, sint, size, and x.

Referenced by runMethodBase().

00885         {               
00886                 CStringType *s = (CStringType *)g->get();
00887                 IObjectIA::CProcessResult r;
00888                 r.ResultState = IObjectIA::ProcessIdle;
00889                 std::pair<TSetDefNameAgent::iterator,TSetDefNameAgent::iterator>  p = _DynamicAgentName.equal_range(CKeyAgent(*s));
00890                 
00891                 if(p.first != p.second)
00892                 {                       
00893                         sint size = _DynamicAgentName.count(CKeyAgent(*s));
00894                         sint n = 0;
00895                         CVectorGroupManager *x;
00896                         x = new CVectorGroupManager(size);
00897                         while(p.first != p.second)
00898                         {                               
00899                                 (*p.first->Itr)->incRef();
00900                                 x->set(n++, *p.first->Itr);
00901                                 p.first++;
00902                         }
00903 
00904                         r.Result = x;                   
00905                         return r;
00906                         
00907                 }
00908                 r.Result = new CVectorGroupManager();           
00909                 return r;
00910         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::getDynamicName NLAIAGENT::IBaseGroupType g  )  [virtual]
 

Get the instance name of the agent in its manager

Definition at line 1155 of file agent_script.cpp.

References _DynamicAgentName, NLAIAGENT::IBaseGroupType::get(), NLAIAGENT::CKeyAgent::Itr, NLAIAGENT::CKeyAgent::Name, r, and s.

01156         {
01157 
01158                 IObjectIA::CProcessResult r;
01159                 const IObjectIA *o = ((CLocalAgentMail *)g->get())->getHost();
01160                 TSetDefNameAgent::iterator i = _DynamicAgentName.begin();
01161 
01162                 while(i != _DynamicAgentName.end())
01163                 {
01164                         CKeyAgent key = *i;
01165                         if( o == *key.Itr )
01166                         {
01167                                 CStringType *s = new CStringType(key.Name);
01168                                 r.Result = s;
01169                                 return r;
01170                         }
01171                         i ++;
01172                 }
01173                 r.Result = new CStringType(CStringVarName("Unknown"));
01174                 return r;
01175         }

virtual const NLAILOGIC::CFactBase* NLAIAGENT::CAgentScript::getFactBase  )  [inline, virtual]
 

Get the fact base of the agent, if not exist it return NULL.

Definition at line 386 of file agent_script.h.

00387                 {
00388                         return NULL;
00389                 }

const NLAISCRIPT::CAgentClass* NLAIAGENT::CAgentScript::getFactoryClass  )  const [inline]
 

Get the creator of this instance.

Definition at line 277 of file agent_script.h.

References _AgentClass.

Referenced by NLAIAGENT::COperatorScript::getType(), and NLAIAGENT::CMainAgentScript::run().

00278                 {
00279                         return _AgentClass;
00280                 }

virtual const std::vector<NLAILOGIC::CGoal *>* NLAIAGENT::CAgentScript::getGoalStack  )  [inline, virtual]
 

Definition at line 434 of file agent_script.h.

Referenced by NLAIAGENT::COperatorScript::lookForGoals().

00435                 {
00436                         return NULL;
00437                 }

const CIdent NLAIAGENT::IRefrence::getIdentType  )  const [virtual, inherited]
 

Definition at line 480 of file baseai.cpp.

References NLAIAGENT::IRefrence::_NumRef, NLAIAGENT::CNumericIndex::getId(), and NLAIAGENT::IWordNumRef::getNumIdent().

00481         {
00482                 return CIdent(0,_NumRef->getNumIdent().getId());
00483         }

virtual const std::string NLAIC::IBasicType::getInfo  )  [inline, virtual, inherited]
 

Definition at line 292 of file abstract_interface.h.

References NLAIC::IBasicType::getDebugString(), and s.

00293                 {
00294                         std::string s;
00295                         getDebugString(s);
00296                         return s;
00297                 }

IMailBox * NLAIAGENT::IBasicAgent::getMail  )  const [inherited]
 

Get the mail box letter.

Definition at line 332 of file agents.cpp.

References NLAIAGENT::IBasicAgent::_Mail.

Referenced by NLAIAGENT::IAgentComposite::addChild(), NLAIAGENT::COperatorScript::checkTrigMsg(), NLAIAGENT::IAgent::processMessages(), processMessages(), NLAIAGENT::IAgentComposite::removeChild(), NLAIAGENT::CMainAgentScript::run(), NLAIAGENT::IAgent::run(), NLAIAGENT::IAgent::runStep(), and NLAIAGENT::IBasicAgent::sendMessage().

00333         {
00334                 return _Mail;
00335         }

NLAISCRIPT::IOpCode * NLAIAGENT::CAgentScript::getMethode sint32  index  ) 
 

get the closure correspondent of the method indexed by index.

Definition at line 574 of file agent_script.cpp.

References _AgentClass, NLAISCRIPT::CAgentClass::getBrancheCode(), NLAISCRIPT::CAgentClass::getMethodIndexSize(), NLAISCRIPT::IClassInterpret::getType(), getType(), index, and sint32.

00575         {
00576                 if ( _AgentClass != NULL )
00577                 {
00578 #ifdef NL_DEBUG         
00579                         const char *dbg_class_name = (const char *) getType();
00580                         const char *dbg_base_class_name = (const char *) _AgentClass->getType();
00581 
00582                         if ( index >= _AgentClass->getMethodIndexSize())
00583                         {
00584                                 throw NLAIE::CExceptionIndexError();
00585                         }
00586 #endif
00587                         return (NLAISCRIPT::IOpCode *)_AgentClass->getBrancheCode(index).getCode();
00588                 }
00589                 else 
00590                         return NULL;
00591         }

NLAISCRIPT::IOpCode * NLAIAGENT::CAgentScript::getMethode sint32  inheritance,
sint32  index
 

get the closure correspondent of the method indexed by index in the base class inheritance.

Definition at line 558 of file agent_script.cpp.

References _AgentClass, NLAISCRIPT::CAgentClass::getBrancheCode(), NLAISCRIPT::CAgentClass::getMethodIndexSize(), index, sint32, and NLAISCRIPT::CAgentClass::sizeVTable().

Referenced by processMessages(), and runMethodeMember().

00559         {
00560 #ifdef NL_DEBUG
00561                 if ( index >= _AgentClass->getMethodIndexSize())
00562                 {
00563                         throw NLAIE::CExceptionIndexError();
00564                 }
00565 
00566                 if ( inheritance >= _AgentClass->sizeVTable())
00567                 {
00568                         throw NLAIE::CExceptionIndexError();
00569                 }
00570 #endif
00571                 return (NLAISCRIPT::IOpCode *)_AgentClass->getBrancheCode(inheritance,index).getCode();
00572         }

std::string NLAIAGENT::CAgentScript::getMethodeMemberDebugString sint32  ,
sint32 
const [virtual]
 

The methode getMethodeMemberDebugString(sint32 heritance, sint32 index) return a string that define the name and the argument of the method

Reimplemented from NLAIAGENT::IObjectIA.

Definition at line 2012 of file agent_script.cpp.

References _AgentClass, getBaseMethodCount(), NLAISCRIPT::CAgentClass::getBrancheCode(), NLAIAGENT::IBasicAgent::getMethodIndexSize(), sint32, TAddChildTag, TFather, TGetChildTag, TGetName, TGetValue, TInitComponent, TRunAskComponent, TRunAskParentNotify, TRunTellComponent, TRunTellParentNotify, TSelf, TSend, TSendComponent, TSetStatic, and TSetValue.

02013         {
02014                 int i = id - getBaseMethodCount();
02015                 if(i >= 0)
02016                 {
02017                         std::string name;
02018                         if(h)
02019                         {
02020                                 _AgentClass->getBrancheCode(h,i).getName().getDebugString(name);
02021                                 _AgentClass->getBrancheCode(h,i).getParam().getDebugString(name);
02022                         }
02023                         else
02024                         {
02025                                 _AgentClass->getBrancheCode(i).getName().getDebugString(name);
02026                                 _AgentClass->getBrancheCode(i).getParam().getDebugString(name);
02027                         }
02028                         return name;
02029                 }
02030 
02031                 switch(id - IAgent::getMethodIndexSize())
02032                 {
02033                 case TSend:
02034                         {
02035                                 return std::string("CAgentScript::sendMessage(IMessage)");
02036                         }
02037 
02038                 case TSendComponent:
02039                         {
02040                                 return std::string("CAgentScript::sendMessage(String,IMessage)");                               
02041                         }
02042 
02043                 case TGetChildTag:
02044                         {
02045                                 return std::string("CAgentScript::getDynamicAgent(String)");
02046                         }
02047 
02048                 case TAddChildTag:
02049                         {
02050                                 return std::string("CAgentScript::addDynamicAgent(String,IAgent)");                             
02051                         }
02052                 case TFather:
02053                         {
02054                                 return std::string("CAgentScript::Father()");                           
02055                         }
02056 
02057                 case TSelf:
02058                         {
02059                                 return std::string("CAgentScript::Self()");
02060                         }
02061                 case TGetName:
02062                         {                               
02063                                 return std::string("CAgentScript::GetAgentName()");
02064                         }
02065 
02066                 case TRunAskParentNotify:
02067                         {       
02068                                 return std::string("CAgentScript::runAskParentNotify(CNotifyParent)");
02069                         }
02070 
02071                 case TRunTellParentNotify:
02072                         {                               
02073                                 return std::string("CAgentScript::runTellarentNotify(CNotifyParent)");
02074                         }
02075 
02076                 case TRunAskComponent:
02077                 case TRunTellComponent:
02078                         {                               
02079                                 return std::string("CAgentScript::runTell/AskCompoment(MsgTellCompoment)");
02080                         }
02081                 case TSetStatic:
02082                         {                                                               
02083                                 return std::string("CAgentScript::updateStaticMember(String, IObjectIA *)");                            
02084                         }
02085 
02086                 case TGetValue:
02087                         {                               
02088                                 return std::string("CAgentScript::runAskGetValue(MsgGetValue)");
02089                         }
02090 
02091                 case TSetValue:
02092                         {                               
02093                                 return std::string("CAgentScript::runTellSetValue(MsgGetValue)");
02094                         }
02095 
02096                 case TInitComponent:
02097                         {                               
02098                                 return std::string("CAgentScript::runInitComponent(MsgGetValue)");
02099                         }
02100 
02101 
02102                 default:
02103                         return IAgentManager::getMethodeMemberDebugString(h,id);                
02104                 }               
02105         }

sint32 NLAIAGENT::CAgentScript::getMethodIndexSize  )  const [virtual]
 

getMethodIndexSize define the nomber of method define in the class.

Reimplemented from NLAIAGENT::IBasicAgent.

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentOperation, NLAIAGENT::CFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript.

Definition at line 632 of file agent_script.cpp.

References NLAIAGENT::IBasicAgent::getMethodIndexSize(), and sint32.

Referenced by NLAIAGENT::CAgentWatchTimer::getMethodIndexSize(), NLAIAGENT::CActorScript::getMethodIndexSize(), NLAIAGENT::CAgentWatchTimer::runMethodBase(), and NLAIAGENT::CActorScript::runMethodBase().

00633         {
00634                 /*if(_AgentClass)
00635                 {
00636                         return _AgentClass->getMethodIndexSize();
00637                 }
00638                 else*/
00639                 {
00640                         return IAgent::getMethodIndexSize() + TLastM;
00641                 }
00642         }

const IRefrence * NLAIAGENT::IRefrence::getOwner  )  const [virtual, inherited]
 

To get the top level parent of this agent.

Definition at line 402 of file baseai.cpp.

References NLAIAGENT::IRefrence::getParent().

00403         {
00404                 const IRefrence *p = getParent();
00405 
00406                 if(p == NULL) return this;
00407 
00408                 while( true )
00409                 {
00410                         if(p->getParent() == NULL) return p;
00411                 }
00412         }

IConnectIA * NLAIAGENT::IConnectIA::getParent  )  const [inherited]
 

to get the agent parents

Reimplemented from NLAIAGENT::IRefrence.

Definition at line 511 of file baseai.cpp.

Referenced by NLAIAGENT::CActorScript::activate(), NLAIAGENT::COperatorScript::calcPriority(), NLAIAGENT::COperatorScript::checkTrigMsg(), NLAIAGENT::IConnectIA::Kill(), NLAIAGENT::COperatorScript::lookForGoals(), NLAIAGENT::CLocalMailBox::newInstance(), NLAIAGENT::IAgent::newInstance(), NLAIAGENT::CActor::newInstance(), NLAIAGENT::IConnectIA::onKill(), NLAIAGENT::IBasicAgent::runAsk(), runAskDebugString(), runAskParentNotify(), runMethodBase(), NLAIAGENT::CActorScript::runMethodBase(), NLAIAGENT::IBasicAgent::runMethodeMember(), runTellParentNotify(), NLAIAGENT::IConnectIA::setParent(), and NLAIAGENT::CActorScript::unActivate().

00512         {
00513                 return (IConnectIA *)IRefrence::getParent();
00514         }       

TQueue NLAIAGENT::CAgentScript::getPrivateMember const IVarName ,
const NLAIAGENT::IVarName ,
const IObjectIA
const [virtual]
 

Definition at line 2228 of file agent_script.cpp.

References NLAIAGENT::IVarName::getString(), NLAIAGENT::isTemplateMember(), param, and NLAIAGENT::TQueue.

Referenced by NLAIAGENT::CActorScript::getPrivateMember(), and isMember().

02229         {               
02230 
02231 #ifdef NL_DEBUG
02232                 const char *dgb_meth_name = methodName->getString();
02233 #endif
02234                 return isTemplateMember(CAgentScript::StaticMethod,CAgentScript::TLastM,IAgent::getMethodIndexSize(),className,methodName,param);               
02235         }

const sint32& NLAIC::IPointerGestion::getRef  )  const [inline, inherited]
 

get the refence count.

Definition at line 99 of file abstract_interface.h.

References NLAIC::IPointerGestion::_Ref, and sint32.

Referenced by NLAIAGENT::CAgentTimerHandle::~CAgentTimerHandle().

00100                 {
00101                         return _Ref;
00102                 }

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

Get the curent state of the agent.

Implements NLAIAGENT::IConnectIA.

Definition at line 309 of file agents.cpp.

References NLAIAGENT::IBasicAgent::_RunState.

Referenced by NLAIAGENT::CMainAgentScript::run(), NLAIAGENT::IAgent::run(), NLAIAGENT::CAgentClockTimer::runActivity(), NLAIAGENT::CAgentWatchTimer::runActivity(), NLAIAGENT::IAgent::runChildren(), NLAIAGENT::IAgent::runChildrenStepByStep(), and NLAIAGENT::IAgent::runStep().

00310         {
00311                 return _RunState;
00312         }

const IObjectIA* NLAIAGENT::IObjectIA::getStaticMember const IVarName compName  )  const [inline, inherited]
 

to get the pointer of a given components referened by an string.

Definition at line 261 of file baseai.h.

References NLAIAGENT::IObjectIA::getStaticMember(), and NLAIAGENT::IObjectIA::getStaticMemberIndex().

00262                 {
00263                         return getStaticMember(getStaticMemberIndex(compName));
00264                 }

const IObjectIA * NLAIAGENT::CAgentScript::getStaticMember sint32   )  const [virtual]
 

to get the pointer of a given components referened by an index.

Reimplemented from NLAIAGENT::IObjectIA.

Definition at line 547 of file agent_script.cpp.

References _Components, _NbComponents, index, and sint32.

Referenced by sendMessage().

00548         {
00549 #ifdef NL_DEBUG
00550                 if ( index >= _NbComponents )
00551                 {
00552                         throw NLAIE::CExceptionIndexError();
00553                 }
00554 #endif
00555                 return _Components[ index ];
00556         }

sint32 NLAIAGENT::CAgentScript::getStaticMemberIndex const IVarName  )  const [virtual]
 

to get the index of a given components name.

Reimplemented from NLAIAGENT::IObjectIA.

Definition at line 2319 of file agent_script.cpp.

References _AgentClass, NLAISCRIPT::CAgentClass::getInheritedStaticMemberIndex(), and sint32.

Referenced by runInitComponent(), runTellSetValue(), and sendMessage().

02320         {
02321                 return _AgentClass->getInheritedStaticMemberIndex(name);
02322         }

sint32 NLAIAGENT::CAgentScript::getStaticMemberSize  )  const [virtual]
 

Static member is the component that the agent is create and die with. getStaticMemberSize to get the size of the static member components

Reimplemented from NLAIAGENT::IObjectIA.

Definition at line 542 of file agent_script.cpp.

References _NbComponents, and sint32.

00543         {
00544                 return _NbComponents;//_AgentClass->getStaticMemberSize();
00545         }

virtual NLAILOGIC::CGoal* NLAIAGENT::CAgentScript::getTopGoal  )  [inline, virtual]
 

Definition at line 429 of file agent_script.h.

00430                 {
00431                         return NULL;
00432                 }

const NLAIC::CIdentType & NLAIAGENT::CAgentScript::getType  )  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.

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentClockTimer, NLAIAGENT::CMainAgentScript, NLAIAGENT::CAgentOperation, NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript.

Definition at line 1690 of file agent_script.cpp.

References _AgentClass, NLAISCRIPT::IClassInterpret::getType(), and IdAgentScript.

Referenced by callConstructor(), callFunction(), getDebugString(), getMethode(), isa(), processMessages(), run(), runAskDebugString(), runChildren(), runStep(), runTellParentNotify(), save(), and sendMessage().

01691         {
01692                 if ( _AgentClass ) 
01693                         return _AgentClass->getType();
01694                 else
01695                         return IdAgentScript;
01696         }

bool NLAIAGENT::CAgentScript::haveActivity  )  const [virtual]
 

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

Reimplemented from NLAIAGENT::IAgent.

Reimplemented in NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentWatchTimer, and NLAIAGENT::CAgentOperation.

Definition at line 1617 of file agent_script.cpp.

References _AgentClass, and NLAISCRIPT::CAgentClass::getRunMethod().

Referenced by NLAIAGENT::CMainAgentScript::run().

01618         {
01619                 return _AgentClass != NULL && (_AgentClass->getRunMethod() >= 0);
01620         }

void NLAIC::IPointerGestion::incRef  )  [inline, inherited]
 

Inc a reference. We use this when we have to conserve a pointer memeory for exemple in a list.

Definition at line 80 of file abstract_interface.h.

References NLAIC::IPointerGestion::_Ref.

Referenced by NLAIAGENT::CSeqFsmScript::activate(), NLAILOGIC::CFactBase::addAssert(), NLAIAGENT::IAgentComposite::addChild(), NLAILOGIC::IBaseAssert::addInput(), NLAILOGIC::CBoolOperator::addPostcondition(), NLAILOGIC::CBoolOperator::addPrecondition(), NLAILOGIC::CInternalGoal::addPredecessor(), NLAILOGIC::CGoal::addPredecessor(), NLAIFUZZY::CFuzzyVar::addSet(), NLAISCRIPT::CCompilateur::affectation(), NLAILOGIC::CFact::asValueSet(), NLAIAGENT::CAgentWatchTimer::attach(), NLAISCRIPT::CCompilateur::buildObject(), NLAISCRIPT::CAgentClass::buildVMethode(), NLAIAGENT::CAgentOperation::CAgentOperation(), NLAIAGENT::CAgentTimerHandle::CAgentTimerHandle(), NLAISCRIPT::CCompilateur::callFunction(), NLAISCRIPT::CClassInterpretFactory::CClassInterpretFactory(), NLAISCRIPT::CCodeBrancheRunDebug::CCodeBrancheRunDebug(), NLAISCRIPT::CCompilateur::CCompilateur(), NLAISCRIPT::CFactorType::CFactorType(), NLAISCRIPT::CFunctionTag::CFunctionTag(), NLAIAGENT::COperatorScript::checkTrigMsg(), NLAIC::CIdentType::CIdentType(), NLAIAGENT::CIdMethod::CIdMethod(), NLAIAGENT::CKeyObject::CKeyObject(), NLAISCRIPT::CFindRunMsg::clone(), NLAISCRIPT::CObjectUnknown::clone(), NLAISCRIPT::CConstraintStackComp::clone(), NLAISCRIPT::CConstraintFindRun::clone(), NLAISCRIPT::CConstraintMethode::clone(), NLAILINK::IOTrace::clone(), NLAISCRIPT::CMethodeName::CMethodeName(), NLAISCRIPT::CAgentClass::CMethodType::CMethodType(), NLAISCRIPT::CObjectUnknown::CObjectUnknown(), NLAIAGENT::CPairType::CPairType(), NLAISCRIPT::CAgentClass::createComponents(), NLAILOGIC::CValueSet::CValueSet(), NLAILOGIC::CVar::CVar(), NLAILOGIC::CValueSet::forward(), NLAIAGENT::IMessageBase::IMessageBase(), initAgentScript(), NLAISCRIPT::CCompilateur::initMessageManager(), NLAISCRIPT::COperatorClass::isValidFonc(), NLAILOGIC::CValueSet::load(), NLAILOGIC::IBaseOperator::load(), NLAISCRIPT::CAgentClass::load(), NLAISCRIPT::CComponent::load(), NLAISCRIPT::CMethodeName::load(), NLAIAGENT::CVectorGroupType::operator+(), NLAIAGENT::CGroupType::operator+(), NLAISCRIPT::CPramContainer::operator+=(), NLAIAGENT::IMessageBase::operator=(), NLAIAGENT::CKeyObject::operator=(), NLAISCRIPT::CAgentClass::CMethodType::operator=(), NLAISCRIPT::CFunctionTag::operator=(), NLAIAGENT::CIdMethod::operator=(), NLAISCRIPT::CCompilateur::processingVar(), processMessages(), NLAISCRIPT::CCompilateur::pushParamExpression(), NLAISCRIPT::CConstraintFindRun::run(), NLAIAGENT::IBasicAgent::run(), runAskGetValue(), NLAIAGENT::IAgent::runChildren(), NLAIAGENT::CMainAgentScript::runExec(), runInitComponent(), NLAIAGENT::CAgentOperation::runMethodBase(), NLAIAGENT::CAgentWatchTimer::runMethodBase(), runMethodBase(), NLAIAGENT::CActorScript::runMethodBase(), NLAIAGENT::IMessageBase::runMethodeMember(), NLAIAGENT::IBaseGroupType::runMethodeMember(), NLAIAGENT::IBasicAgent::runMethodeMember(), NLAISCRIPT::CLdbRefOpCode::runOpCode(), NLAISCRIPT::CLdbMemberiOpCode::runOpCode(), NLAISCRIPT::CLdbHeapMemberiOpCode::runOpCode(), NLAISCRIPT::CLdbStackMemberiOpCode::runOpCode(), NLAISCRIPT::CCallStackMethodi::runOpCode(), NLAISCRIPT::CCallStackNewMethodi::runOpCode(), NLAISCRIPT::CLibStackNewMemberMethod::runOpCode(), NLAISCRIPT::CLibStackMemberMethod::runOpCode(), NLAISCRIPT::CAffOpCode::runOpCode(), NLAISCRIPT::CAddParamNameDebug::runOpCode(), NLAISCRIPT::CAffOpCodeDebug::runOpCode(), NLAISCRIPT::CAffHeapMemberiOpCode::runOpCode(), NLAISCRIPT::CAffMemberOpCode::runOpCode(), NLAISCRIPT::CAffMemberiOpCode::runOpCode(), runTellComponent(), runTellSetValue(), NLAISCRIPT::CMethodContextDebug::saveContext(), NLAISCRIPT::CMethodContext::saveContext(), sendBroadCast(), NLAIAGENT::IListManager::sendMessage(), sendMethodCompoment(), NLAIAGENT::CVolatilMemmory::sendUpdateMessage(), NLAISCRIPT::CFactorType::set(), NLAILOGIC::IBaseOperator::setGoal(), NLAISCRIPT::CCompilateur::setImediateVarNill(), NLAISCRIPT::CCompilateur::setMethodVar(), NLAISCRIPT::CCompilateur::setParamVarName(), NLAISCRIPT::CFunctionTag::setTypeObject(), NLAILOGIC::CVar::setValue(), NLAILOGIC::CValueSet::setValue(), NLAIAGENT::CAgentWatchTimer::tellBroker(), NLAISCRIPT::CCompilateur::typeOfMethod(), NLAILOGIC::CVar::unify(), NLAILOGIC::CValueSet::unify(), and NLAIAGENT::CAgentOperation::update().

00081                 {
00082                         _Ref ++;
00083                 }

void NLAIAGENT::IObjectIA::init IObjectIA  )  [virtual, inherited]
 

Init method alows to init the attribut of an object. the maparmetre is in more time a list of IObjectIA.

Reimplemented in NLAIFUZZY::CSimpleFuzzyCond, NLAIFUZZY::CFuzzyRule, NLAIFUZZY::CFuzzyRuleSet, NLAIFUZZY::CFuzzyInterval, NLAIFUZZY::CRightFuzzySet, NLAIFUZZY::CTriangleFuzzySet, NLAIFUZZY::CTrapezeFuzzySet, NLAIFUZZY::CLeftFuzzySet, NLAIFUZZY::CFuzzyVar, NLAILOGIC::CFirstOrderAssert, NLAILOGIC::CRule, and NLAILOGIC::CFactPattern.

Definition at line 116 of file baseai.cpp.

Referenced by NLAIFUZZY::IFuzzySet::runMethodeMember(), and NLAISCRIPT::CLdbNewOpCode::runOpCode().

00117         {
00118                 
00119         }

void NLAIAGENT::CAgentScript::initAgentScript  )  [static]
 

Definition at line 92 of file agent_script.cpp.

References _ADD_SET_, _ADDCHILD_, _FATHER_, _GETCHILD_, _GETNAME_, _ISA_, _REMOVECHILD_, _RUNASK_, _RUNTEL_, _SELF_, _SEND_, _SETSTATIC_, NLAILINK::buildScript(), IdMsgNotifyParent, NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass, IdMsgNotifyParentClass, NLAIC::IPointerGestion::incRef(), msgPerf, msgType, ParamGetValueMsg, ParamIdGetValueMsg, ParamIdInitComponentMsg, ParamIdSetValueMsg, ParamInitComponentMsg, ParamRunParentNotify, ParamSetValueMsg, ParamTellComponentMsg, SendCompParamMessageScript, and SendParamMessageScript.

Referenced by NLAILINK::initIALib().

00093         {
00094 
00095                 std::string msgStr;
00096                 std::string scriptName("MsgAgentScript");
00097                 msgStr = std::string("From Message : Define MsgTellComponent\n{");
00098                 msgStr += std::string("Component:\n");          
00099                 msgStr += std::string("\tString<'CompomentName'>;\n");
00100                 msgStr += std::string("\tMessage<'MsgType'>;\n");
00101                 msgStr += std::string("End\n");
00102 
00103 
00104                 msgStr += std::string("Constructor(String i; Message msg)\n");
00105                 msgStr += std::string("\tCompomentName = i;\n");
00106                 msgStr += std::string("\tMsgType = msg;\n");
00107                 msgStr += std::string("End\n");
00108                 msgStr += std::string("}\n");
00109                 //NLAILINK::buildScript(msgStr,scriptName);
00110 
00111                 msgStr += std::string("From Message : Define MsgInitCompoment\n{");
00112                 msgStr += std::string("Component:\n");                          
00113                 msgStr += std::string("End\n}\n");
00114 
00115                 msgStr += std::string("From Message : Define MsgDebugString\n{");
00116                 msgStr += std::string("Component:\n");
00117                 msgStr += std::string("End\n}\n");
00118 
00119                 
00120                 NLAILINK::buildScript(msgStr,scriptName);
00121 
00122                 static NLAIC::CIdentType idMsgTellComponentType ("MsgTellComponent");
00123                 static NLAIC::CIdentType idMsgInitComponentType ("MsgInitCompoment");
00124                 static NLAIC::CIdentType idMsgDebugString ("MsgDebugString");
00125 
00126                 msgType = new NLAISCRIPT::COperandSimpleListOr(3,       
00127                                                                                                                 new NLAIC::CIdentType(CMessageList::IdMessage),
00128                                                                                                                 new NLAIC::CIdentType(CMessageVector::IdMessageVector),
00129                                                                                                                 new NLAIC::CIdentType(NLAISCRIPT::CMessageClass::IdMessageClass));
00130 
00131                 msgPerf = new NLAISCRIPT::COperandSimpleListOr(7,       
00132                                                                                                                 new NLAIC::CIdentType(CPExec::IdPExec),
00133                                                                                                                 new NLAIC::CIdentType(CPAchieve::IdPAchieve),
00134                                                                                                                 new NLAIC::CIdentType(CPAsk::IdPAsk),
00135                                                                                                                 new NLAIC::CIdentType(CPBreak::IdPBreak),
00136                                                                                                                 new NLAIC::CIdentType(CPTell::IdPTell),
00137                                                                                                                 new NLAIC::CIdentType(CPKill::IdPKill),
00138                                                                                                                 new NLAIC::CIdentType(CPError::IdPError));
00139 
00140 
00141                 SendParamMessageScript = new NLAISCRIPT::CParam(2,msgPerf, msgType);
00142 
00143                 msgPerf->incRef();
00144                 msgType->incRef();
00145 
00146                 SendCompParamMessageScript = new NLAISCRIPT::CParam(3,new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(CStringType::IdStringType)),
00147                                                                                                                 msgPerf, msgType);
00148 
00149                 IdMsgNotifyParentClass = new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass));
00150 
00151                 IdMsgNotifyParent = new NLAISCRIPT::COperandSimpleListOr(2,
00152                                                                                                                                 new NLAIC::CIdentType(NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass),
00153                                                                                                                                 new NLAIC::CIdentType(CNotifyParentScript::IdNotifyParentScript));
00154 
00155                 ParamRunParentNotify = new NLAISCRIPT::CParam(1,IdMsgNotifyParent); 
00156                 
00157                 NLAISCRIPT::COperandSimple *idMsgTellComponent = new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(idMsgTellComponentType));
00158                 NLAISCRIPT::CParam *ParamTellComponentMsg = new NLAISCRIPT::CParam(1,idMsgTellComponent);
00159 
00160                 NLAISCRIPT::COperandSimple *idOpMsgDebugString = new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(idMsgDebugString));
00161                 NLAISCRIPT::CParam *ParamMsgDebugString = new NLAISCRIPT::CParam(1,idOpMsgDebugString);
00162 
00163                 CAgentScript::ParamIdGetValueMsg = new NLAISCRIPT::COperandSimpleListOr(2,
00164                                                                                                                                   new NLAIC::CIdentType(NLAIAGENT::CGetValueMsg::IdGetValueMsg),
00165                                                                                                                                   new NLAIC::CIdentType(NLAISCRIPT::CGetValueMsgClass::IdGetValueMsgClass)      );
00166 
00167                 CAgentScript::ParamGetValueMsg = new NLAISCRIPT::CParam(1,ParamIdGetValueMsg);
00168 
00169                 CAgentScript::ParamIdSetValueMsg = new NLAISCRIPT::COperandSimpleListOr(2,
00170                                                                                                                                   new NLAIC::CIdentType(NLAIAGENT::CSetValueMsg::IdSetValueMsg),
00171                                                                                                                                   new NLAIC::CIdentType(NLAISCRIPT::CSetValueMsgClass::IdSetValueMsgClass)      );
00172 
00173                 CAgentScript::ParamSetValueMsg = new NLAISCRIPT::CParam(1,ParamIdSetValueMsg);
00174 
00176                 CAgentScript::ParamIdInitComponentMsg = new NLAISCRIPT::COperandSimpleListOr(2,
00177                                                                                                                                   new NLAIC::CIdentType(idMsgInitComponentType),
00178                                                                                                                                   new NLAIC::CIdentType(idMsgInitComponentType) );
00179 
00180                 CAgentScript::ParamInitComponentMsg = new NLAISCRIPT::CParam(1,ParamIdInitComponentMsg);
00182 
00183                 StaticMethod = new CAgentScript::CMethodCall *[CAgentScript::TLastM];
00184 
00185                 StaticMethod[CAgentScript::TRunAskParentNotify] = new CAgentScript::CMethodCall(        _RUNASK_, 
00186                                                                                                                                                                                 CAgentScript::TRunAskParentNotify, ParamRunParentNotify,
00187                                                                                                                                                                                 CAgentScript::CheckAll,
00188                                                                                                                                                                                 1,
00189                                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(IdMsgNotifyParentClass));
00190 
00191                 IdMsgNotifyParentClass->incRef();               
00192                 ParamRunParentNotify->incRef();
00193                 StaticMethod[CAgentScript::TRunTellParentNotify] = new CAgentScript::CMethodCall(       _RUNTEL_, 
00194                                                                                                                                                                                 CAgentScript::TRunTellParentNotify, ParamRunParentNotify,
00195                                                                                                                                                                                 CAgentScript::CheckAll,
00196                                                                                                                                                                                 1,
00197                                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(IdMsgNotifyParentClass));
00198                 
00199                 idMsgTellComponent->incRef();
00200                 StaticMethod[CAgentScript::TRunTellComponent] = new CAgentScript::CMethodCall(  _RUNTEL_, 
00201                                                                                                                                                                                 CAgentScript::TRunTellComponent, ParamTellComponentMsg,
00202                                                                                                                                                                                 CAgentScript::CheckAll,
00203                                                                                                                                                                                 1,
00204                                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(idMsgTellComponent));
00205 
00206                 idOpMsgDebugString->incRef();
00207                 StaticMethod[CAgentScript::TRunAskDebugString] = new CAgentScript::CMethodCall( _RUNASK_, 
00208                                                                                                                                                                                 CAgentScript::TRunAskDebugString, ParamMsgDebugString,
00209                                                                                                                                                                                 CAgentScript::CheckAll,
00210                                                                                                                                                                                 1,
00211                                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(idOpMsgDebugString));
00212 
00213                 /*idOpMsgDebugString->incRef();
00214                 ParamMsgDebugString->incRef();
00215                 StaticMethod[CAgentScript::TRunAskDebugString] = new CAgentScript::CMethodCall( _RUNTEL_, 
00216                                                                                                                                                                                 CAgentScript::TRunTellComponent, ParamMsgDebugString,
00217                                                                                                                                                                                 CAgentScript::CheckAll,
00218                                                                                                                                                                                 1,
00219                                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(idOpMsgDebugString));*/
00220 
00221                 ParamTellComponentMsg->incRef();
00222                 idMsgTellComponent->incRef();
00223                 StaticMethod[CAgentScript::TRunAskComponent] = new CAgentScript::CMethodCall(   _RUNASK_, 
00224                                                                                                                                                                                 CAgentScript::TRunAskComponent, ParamTellComponentMsg,
00225                                                                                                                                                                                 CAgentScript::CheckAll,
00226                                                                                                                                                                                 1,
00227                                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(idMsgTellComponent));
00228 
00229                 StaticMethod[CAgentScript::TSend] = new CAgentScript::CMethodCall(      _SEND_, 
00230                                                                                                                                                 CAgentScript::TSend, SendParamMessageScript,
00231                                                                                                                                                 CAgentScript::CheckAll,
00232                                                                                                                                                 2,
00233                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid));
00234 
00235                 StaticMethod[CAgentScript::TSendComponent] = new CAgentScript::CMethodCall(     _SEND_, 
00236                                                                                                                                                 CAgentScript::TSendComponent, 
00237                                                                                                                                                 SendCompParamMessageScript,CAgentScript::CheckAll,
00238                                                                                                                                                 3,
00239                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid));
00240 
00241                 StaticMethod[CAgentScript::TGetChildTag] = new CAgentScript::CMethodCall(       _GETCHILD_,
00242                                                                                                                                                                 CAgentScript::TGetChildTag, 
00243                                                                                                                                                                 NULL,
00244                                                                                                                                                                 CAgentScript::CheckCount,
00245                                                                                                                                                                 1,
00246                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(new 
00247                                                                                                                                                                 NLAISCRIPT::COperandSimple(
00248                                                                                                                                                                 new NLAIC::CIdentType(CVectorGroupManager::IdVectorGroupManager))));
00249 
00250                 StaticMethod[CAgentScript::TAddChildTag] = new CAgentScript::CMethodCall(       _ADDCHILD_, 
00251                                                                                                                                                                                 CAgentScript::TAddChildTag, 
00252                                                                                                                                                                                 NULL,CAgentScript::DoNotCheck,
00253                                                                                                                                                                                 2,
00254                                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(
00255                                                                                                                                                                                 new NLAISCRIPT::COperandSimple(
00256                                                                                                                                                                                 new NLAIC::CIdentType(DigitalType::IdDigitalType))));
00257 
00258                 StaticMethod[CAgentScript::TFather] = new CAgentScript::CMethodCall(    _FATHER_, 
00259                                                                                                                                                         CAgentScript::TFather, 
00260                                                                                                                                                         NULL,CAgentScript::CheckCount,
00261                                                                                                                                                         0,
00262                                                                                                                                                         new NLAISCRIPT::CObjectUnknown(
00263                                                                                                                                                         new NLAISCRIPT::COperandSimple(
00264                                                                                                                                                         //check if correct
00265                                                                                                                                                         new NLAIC::CIdentType(*IAgent::IdAgent))));     
00266 
00267 
00268                 StaticMethod[CAgentScript::TSelf] = new CAgentScript::CMethodCall(      _SELF_, 
00269                                                                                                                                                 CAgentScript::TSelf, 
00270                                                                                                                                                 NULL,CAgentScript::CheckCount,
00271                                                                                                                                                 0,
00272                                                                                                                                                 new NLAISCRIPT::CObjectUnknown( new NLAISCRIPT::COperandSimple(
00273                                                                                                                                                 new NLAIC::CIdentType(CAgentScript::IdAgentScript))));
00274 
00275                 StaticMethod[CAgentScript::TGetName] = new CAgentScript::CMethodCall(   _GETNAME_, 
00276                                                                                                                                                         CAgentScript::TGetName, 
00277                                                                                                                                                         NULL,CAgentScript::CheckCount,
00278                                                                                                                                                         0,
00279                                                                                                                                                         new NLAISCRIPT::CObjectUnknown(
00280                                                                                                                                                         new NLAISCRIPT::COperandSimple(
00281                                                                                                                                                         new NLAIC::CIdentType(CStringType::IdStringType))));
00282 
00283                 StaticMethod[CAgentScript::TGetClassName] = new CAgentScript::CMethodCall(      "GetClassName", 
00284                                                                                                                                                         CAgentScript::TGetClassName, 
00285                                                                                                                                                         NULL,CAgentScript::CheckCount,
00286                                                                                                                                                         0,
00287                                                                                                                                                         new NLAISCRIPT::CObjectUnknown(
00288                                                                                                                                                         new NLAISCRIPT::COperandSimple(
00289                                                                                                                                                         new NLAIC::CIdentType(CStringType::IdStringType))));
00290 
00291                 StaticMethod[CAgentScript::TIsInherited] = new CAgentScript::CMethodCall(       "IsInherited", 
00292                                                                                                                                                         CAgentScript::TIsInherited, 
00293                                                                                                                                                         NULL,CAgentScript::CheckCount,
00294                                                                                                                                                         1,
00295                                                                                                                                                         new NLAISCRIPT::CObjectUnknown(
00296                                                                                                                                                         new NLAISCRIPT::COperandSimple(
00297                                                                                                                                                         new NLAIC::CIdentType(NLAILOGIC::CBoolType::IdBoolType))));
00298 
00299                 StaticMethod[CAgentScript::TRemoveChild] = new CAgentScript::CMethodCall(       _REMOVECHILD_, 
00300                                                                                                                                                                 CAgentScript::TRemoveChild, 
00301                                                                                                                                                                 NULL,CAgentScript::CheckCount,
00302                                                                                                                                                                 0,
00303                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(
00304                                                                                                                                                                 new NLAISCRIPT::COperandSimple(                                                                                                                         
00305                                                                                                                                                                 new NLAIC::CIdentType(DigitalType::IdDigitalType))));           
00306 
00307                 StaticMethod[CAgentScript::TSetStatic] = new CAgentScript::CMethodCall( _SETSTATIC_, 
00308                                                                                                                                                                 CAgentScript::TSetStatic, NULL,
00309                                                                                                                                                                 CAgentScript::CheckCount,
00310                                                                                                                                                                 2,
00311                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid)) ;
00312 
00313 
00314                 StaticMethod[CAgentScript::TGetValue] = new CAgentScript::CMethodCall(  _RUNASK_, 
00315                                                                                                                                                                 CAgentScript::TGetValue, ParamGetValueMsg,
00316                                                                                                                                                                 CAgentScript::CheckAll,
00317                                                                                                                                                                 1,
00318                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid)) ;
00319 
00320                 StaticMethod[CAgentScript::TSetValue] = new CAgentScript::CMethodCall(  _RUNTEL_, 
00321                                                                                                                                                                 CAgentScript::TSetValue, ParamSetValueMsg,
00322                                                                                                                                                                 CAgentScript::CheckAll,
00323                                                                                                                                                                 1,
00324                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid)) ;
00325 
00326                 ParamIdInitComponentMsg->incRef();
00327                 StaticMethod[CAgentScript::TInitComponent] = new CAgentScript::CMethodCall(     _RUNTEL_, 
00328                                                                                                                                                                 CAgentScript::TInitComponent, ParamInitComponentMsg,
00329                                                                                                                                                                 CAgentScript::CheckAll,
00330                                                                                                                                                                 1,
00331                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(ParamIdInitComponentMsg)) ;
00332 
00333                 NLAISCRIPT::CParam *ParamString =  new NLAISCRIPT::CParam(1,new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(CStringType::IdStringType)));
00334                 StaticMethod[CAgentScript::TIsEUU] = new CAgentScript::CMethodCall(     _ISA_,
00335                                                                                                                                                 CAgentScript::TIsEUU,
00336                                                                                                                                                 ParamString,CAgentScript::CheckAll,
00337                                                                                                                                                 0, new NLAISCRIPT::CObjectUnknown(      new NLAISCRIPT::COperandSimple(
00338                                                                                                                                                    new NLAIC::CIdentType(NLAIAGENT::UInt32Type::IdUInt32Type))));
00339                 ParamString->incRef();
00340                 StaticMethod[CAgentScript::TAddSet] = new CAgentScript::CMethodCall(_ADD_SET_,
00341                                                                                                                                                         CAgentScript::TAddSet,
00342                                                                                                                                                         ParamString,CAgentScript::CheckAll,
00343                                                                                                                                                         0, new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid));               
00344 
00345 
00346                 StaticMethod[CAgentScript::TDeflautProccessMsg] = new CAgentScript::CMethodCall("DeflautProccessMsg",
00347                                                                                                                                                                                 CAgentScript::TDeflautProccessMsg, NULL,
00348                                                                                                                                                                                 CAgentScript::CheckCount,
00349                                                                                                                                                                                 1,
00350                                                                                                                                                                                 new NLAISCRIPT::CObjectUnknown(new NLAISCRIPT::COperandVoid));
00351 
00352         }

bool NLAIAGENT::CAgentScript::isa const std::string &   )  const [virtual]
 

Test the set of the agent.

Definition at line 741 of file agent_script.cpp.

References getType(), isClassInheritedFrom(), mapSet, and s.

Referenced by runMethodBase().

00742         {
00743                 std::set<std::string>::iterator it = mapSet.find(s);
00744                 if(it != mapSet.end()) return true;
00745                 else
00746                 if(isClassInheritedFrom(CStringVarName(s.c_str())) >= 0) 
00747                         return true;
00748                 else
00749                         if(s == (const char *) getType()) 
00750                                 return true;
00751                 
00752                 return false;
00753         }

sint32 NLAIAGENT::IObjectIA::isClassInheritedFrom const IVarName  )  const [virtual, inherited]
 

isClassInheritedFrom(className) allow us to known if this class have a base class with the name className.

If true the method return the range of the base class, this range is an arbitrary reference id define by the programmer or bay the scrypt. the false return is define by -1.

Reimplemented in NLAIAGENT::IVector, NLAIAGENT::CLocalAgentMail, NLAIAGENT::INombreDefine, NLAIAGENT::IBaseGroupType, and NLAIAGENT::CMessageScript.

Definition at line 246 of file baseai.cpp.

References sint32.

Referenced by NLAISCRIPT::CCompilateur::getValidateHierarchyBase(), NLAIAGENT::CLocalAgentMail::isClassInheritedFrom(), NLAIAGENT::CActorScript::Launch(), NLAIAGENT::CFsmScript::setTopLevel(), and NLAIAGENT::CActorScript::setTopLevel().

00247         {
00248                 return -1;
00249         }       

sint32 NLAIAGENT::CAgentScript::isClassInheritedFrom const NLAIAGENT::IVarName  )  const [virtual]
 

Definition at line 2314 of file agent_script.cpp.

References _AgentClass, NLAISCRIPT::CAgentClass::isClassInheritedFrom(), and sint32.

Referenced by isa(), and runMethodBase().

02315         {
02316                 return _AgentClass->isClassInheritedFrom( name );
02317         }       

TQueue NLAIAGENT::CAgentScript::isDeflautProccessMsg const IVarName ,
const NLAIAGENT::IVarName ,
const IObjectIA
const [virtual]
 

Definition at line 2292 of file agent_script.cpp.

References NLAIAGENT::IVarName::getString(), param, r, sint, TDeflautProccessMsg, and NLAIAGENT::TQueue.

Referenced by isMember().

02293         {
02294                 const char *name = methodName->getString();
02295                 if(name[0] == 'R' && name[1] == 'u' && name[2] == 'n')
02296                 {
02297                         static CStringVarName runMsgName[7] = {"RunTell", "RunAchieve", "RunAsk", "RunExec", "RunBreak", "RunKill", "RunError"};
02298                         sint i;
02299                         for(i = 0; i < 7; i ++)
02300                         {
02301                                 if(*methodName == runMsgName[i])
02302                                 {
02303                                         TQueue r;                       
02304                                         CObjectType *c = new CObjectType(new NLAIC::CIdentType(NLAIC::CIdentType::VoidType));
02305                                         r.push(CIdMethod(TDeflautProccessMsg + IAgent::getMethodIndexSize(),0.0,NULL,c));
02306                                         return r;
02307                                 }
02308                         }
02309                 }
02310 
02311                 return TQueue();
02312         }

bool NLAIAGENT::CAgentScript::isEqual const IBasicObjectIA a  )  const [virtual]
 

Implementation of the isEqual of the IBasicObjectIA.

Reimplemented from NLAIAGENT::IAgent.

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

Definition at line 720 of file agent_script.cpp.

00721         {
00722                 return false;
00723         }

bool NLAIAGENT::IObjectIA::isLocal  )  [virtual, inherited]
 

If the result is true the object is loclal else its a representation of an object on the server. By the method return true.

Definition at line 356 of file baseai.cpp.

00357         {
00358                 return true;
00359         }

TQueue NLAIAGENT::IBasicAgent::isMember const IVarName ,
const IVarName ,
const IObjectIA
const [virtual, inherited]
 

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, and NLAIAGENT::CProxyAgentMail.

Definition at line 452 of file agents.cpp.

References NLAIAGENT::_GetNumId, NLAIAGENT::_RunAsk, NLAIAGENT::_RunTel, NLAISCRIPT::CParam::eval(), and NLAIAGENT::TQueue.

Referenced by isMember(), NLAIAGENT::CLocalAgentMail::isMember(), and NLAIAGENT::CActor::isMember().

00453         {                       
00454                 if(className == NULL)
00455                 {
00456                         TQueue a;
00457                         for(int i = 0; i < _LastM; i++)
00458                         {
00459                                 if(*methodName == IBasicAgent::_Method[i].MethodName)
00460                                 {       
00461                                         CObjectType *c;
00462                                         if(i == _RunTel || i == _RunAsk)
00463                                         {
00464                                                 static NLAISCRIPT::CParam paramMsg(1,new NLAISCRIPT::COperandSimple (new NLAIC::CIdentType(NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass)));
00465 
00466                                                 if(paramMsg.eval((NLAISCRIPT::CParam &)p) < 0.0) continue;
00467                                                 c = new CObjectType(new NLAIC::CIdentType(NLAISCRIPT::CMessageClass::IdMessageClass));
00468                                         }
00469                                         else
00470                                         if (i == _GetNumId)
00471                                         {
00472                                                 c = new CObjectType(new NLAIC::CIdentType(CStringType::IdStringType));
00473                                         }
00474                                         else
00475                                         {
00476                                                 c = new CObjectType(new NLAIC::CIdentType(CLocalAgentMail::LocalAgentMail));
00477                                         }
00478                                         a.push(CIdMethod(IBasicAgent::_Method[i].Index + IObjectIA::getMethodIndexSize(),0.0,NULL,c));                                  
00479                                         break;
00480                                 }
00481                         }
00482 
00483                         if(a.size()) return a;
00484                         else return IConnectIA::isMember(className,methodName,p);
00485                 }
00486                 return IConnectIA::isMember(className,methodName,p);
00487         }

TQueue NLAIAGENT::CAgentScript::isMember const IVarName ,
const NLAIAGENT::IVarName ,
const IObjectIA
const [virtual]
 

Definition at line 2237 of file agent_script.cpp.

References _AgentClass, getPrivateMember(), NLAISCRIPT::CAgentClass::getPrivateMember(), isDeflautProccessMsg(), NLAIAGENT::IBasicAgent::isMember(), param, r, and NLAIAGENT::TQueue.

Referenced by NLAIAGENT::COperatorScript::getDebugString(), getDebugString(), NLAIAGENT::CAgentWatchTimer::isMember(), and sendMessage().

02238         {
02239                 
02240 
02241                 if(className == NULL)
02242                 {
02243 
02244                         TQueue r;
02245                         if(_AgentClass != NULL) 
02246                                 r = _AgentClass->getPrivateMember(className,methodName,param);                  
02247 
02248                         if(r.size()) 
02249                                 return r;
02250                         else
02251                         {
02252                                 r = getPrivateMember(className,methodName,param);
02253                                 if(r.size()) return r;
02254                                 else
02255                                 {
02256                                         r = IAgent::isMember(className,methodName,param);
02257                                         if(r.size())
02258                                                 return r;
02259                                         else
02260                                                 return isDeflautProccessMsg(className,methodName,param);
02261                                 }
02262                         }
02263                 
02264                 }               
02265                 else 
02266                 if(*className == CStringVarName("Agent"))
02267                 {                                       
02268                         TQueue r;
02269                         r = getPrivateMember(className,methodName,param);
02270                         if(r.size()) 
02271                                 return r;
02272                         else
02273                         {
02274                                 r = _AgentClass->getPrivateMember(className,methodName,param);                  
02275 
02276                                 if ( r.size() ) 
02277                                         return r;
02278                                 else
02279                                 {                       
02280                                         r = IAgent::isMember(className,methodName,param);
02281                                         if(r.size())
02282                                                 return r;
02283                                         else
02284                                                 return isDeflautProccessMsg(className,methodName,param);
02285                                 }
02286                         }
02287                         
02288                 }
02289                 return TQueue();
02290         }

void NLAIAGENT::IAgent::Kill  )  [virtual, inherited]
 

Call this function to destroy an agent including its referneces in other agents and its childs.

Reimplemented from NLAIAGENT::IConnectIA.

Definition at line 57 of file agents.cpp.

References NLAIAGENT::IConnectIA::onKill(), NLAIC::IPointerGestion::release(), and sint.

Referenced by ~CAgentScript(), NLAIAGENT::CMainAgentScript::~CMainAgentScript(), NLAIAGENT::IAgent::~IAgent(), and NLAIAGENT::IMainAgent::~IMainAgent().

00058         {
00059 //sint n = _SizeChild;
00060 
00061 #ifdef NL_DEBUG
00062                 if(_SizeChild != (sint)_AgentList.size())
00063                 {
00064                         sint i = (sint)_AgentList.size();
00065                         throw;
00066                 }       
00067 
00068 #endif
00069                 sint n = _SizeChild ;
00070                 while ( /*_AgentList.begin() !=  _AgentList.end()*/ n--)
00071                 {                                       
00072                         IConnectIA *c = _AgentList.front();
00073                         _AgentList.pop_front();
00074                         c->onKill(this);
00075                         c->release();                   
00076                 }
00077                 _SizeChild = 0;
00078                 IAgentComposite::Kill();
00079         }

void NLAIAGENT::CAgentScript::load NLMISC::IStream is  )  [virtual]
 

Load the class from a stream.

Reimplemented from NLAIAGENT::IAgent.

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentOperation, NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 605 of file agent_script.cpp.

References _Components, _NbComponents, NLAIC::IBasicInterface::load(), NLAIC::IPointerGestion::release(), NLMISC::IStream::serial(), sint32, and size.

Referenced by NLAIAGENT::CActorScript::load().

00606         {
00607                 IBasicAgent::load(is);
00608                 
00609                 // Loads static components
00610                 sint32 size;
00611                 is.serial( size );
00612                 _NbComponents = size;
00613 
00614                 if(_Components)
00615                 {
00616                         for ( int i = 0; i < _NbComponents; i++ )
00617                                                         _Components[i]->release();
00618                         delete[] _Components;
00619                 }
00620                 _Components = new IObjectIA *[ _NbComponents ];
00621 
00622                 for ( int i = 0; i < _NbComponents; i++ )
00623                 {
00624                         NLAIC::CIdentTypeAlloc id;
00625                         is.serial( id );
00626                         IObjectIA *tmp_c = (IObjectIA *)id.allocClass();
00627                         tmp_c->load(is);
00628                         _Components[i] = tmp_c;
00629                 }
00630         }

const NLAIC::IBasicType * NLAIAGENT::CAgentScript::newInstance  )  const [virtual]
 

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

Reimplemented from NLAIAGENT::IAgent.

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentClockTimer, NLAIAGENT::CMainAgentScript, NLAIAGENT::CAgentOperation, NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript.

Definition at line 650 of file agent_script.cpp.

References _AgentClass, NLAISCRIPT::CAgentClass::buildNewInstance(), and CAgentScript().

00651         {
00652                 CAgentScript *instance;
00653                 if ( _AgentClass )
00654                 {
00655                         instance = (CAgentScript *) _AgentClass->buildNewInstance();
00656                 }
00657                 else 
00658                 {                       
00659                         instance = new CAgentScript(NULL);
00660                 }
00661                 return instance;
00662         }

void NLAIAGENT::CAgentScript::onKill IConnectIA A  )  [virtual]
 

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

Reimplemented from NLAIAGENT::IAgent.

Reimplemented in NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentOperation, and NLAIAGENT::COperatorScript.

Definition at line 725 of file agent_script.cpp.

References _DynamicAgentName, and NLAIAGENT::IAgent::onKill().

Referenced by NLAIAGENT::CAgentWatchTimer::onKill().

00726         {               
00727                 TSetDefNameAgent::iterator iter = _DynamicAgentName.begin();
00728                 while( iter != _DynamicAgentName.end() )
00729                 {                       
00730                         if((*(*iter).Itr) == a)
00731                         {
00732                                 _DynamicAgentName.erase(iter);
00733                                 break;
00734                         }
00735                         iter++;
00736                 }
00737                 IAgent::onKill(a);
00738         }

NLAIAGENT::IRefrence::operator const IWordNumRef &  )  const [inherited]
 

to get a word num ref of the agents.

Definition at line 380 of file baseai.cpp.

References NLAIAGENT::IRefrence::_NumRef.

00381         {
00382                 return *_NumRef;
00383         }

NLAIAGENT::IRefrence::operator const IWordNumRef *  )  const [inherited]
 

to get a word num ref pointer of the agents.

Definition at line 385 of file baseai.cpp.

References NLAIAGENT::IRefrence::_NumRef.

00386         {
00387                 return _NumRef;
00388         }

bool NLAIAGENT::IBasicObjectIA::operator== const IBasicObjectIA classType  )  const [inherited]
 

Lot of algo use this function to determine the equality between 2 class, in particular the extraction from stl list. the == operator call the bool isEqual(const IBasicObjectIA &a) const member method to determine the equality between tow class.

Definition at line 134 of file baseai.cpp.

References NLAIC::IBasicType::getType(), and NLAIAGENT::IBasicObjectIA::isEqual().

00135         {                                               
00136                 if(a.getType() == getType() ) return isEqual(a);                        
00137                 return false;
00138         }               

void NLAIAGENT::CAgentScript::processContinuation IMessageBase ,
IMessageBase
[virtual]
 

Definition at line 1461 of file agent_script.cpp.

References NLAIC::IBasicType::clone(), NLAIAGENT::IMessageBase::getContinuation(), NLAIAGENT::IMessageBase::getPerformatif(), NLAIAGENT::IMessageBase::getSender(), NLAIAGENT::IMessageBase::setMethodIndex(), NLAIAGENT::IMessageBase::setPerformatif(), NLAIAGENT::IMessageBase::setReceiver(), and NLAIAGENT::IMessageBase::setSender().

Referenced by processMessages().

01462         {
01463                 switch(msg->getPerformatif())
01464                 {
01465                 case IMessageBase::PExec:
01466                         if(msg->getContinuation() != NULL)
01467                         {
01468                                 IMessageBase *o = (IMessageBase *)returnMsg->clone();
01469                                 o->setMethodIndex(-1,-1);
01470                                 //this->incRef();
01471                                 o->setSender(this);
01472                                 //((IObjectIA *)msg->getContinuation())->incRef();
01473                                 o->setReceiver((IObjectIA *)msg->getContinuation());
01474                                 ((IObjectIA *)msg->getContinuation())->sendMessage(o);
01475                         }
01476                         break;
01477                 case IMessageBase::PAchieve:
01478                         if(msg->getContinuation() != NULL)
01479                         {
01480                                 IMessageBase *o = (IMessageBase *)returnMsg->clone();
01481                                 o->setMethodIndex(-1,-1);
01482                                 //this->incRef();
01483                                 o->setSender(this);
01484                                 //((IObjectIA *)msg->getContinuation())->incRef();
01485                                 o->setReceiver((IObjectIA *)msg->getContinuation());
01486                                 ((IObjectIA *)msg->getContinuation())->sendMessage(o);
01487                         }
01488                         break;
01489                 case IMessageBase::PAsk:
01490                         {
01491                                 IMessageBase *o = (IMessageBase *)returnMsg->clone();
01492                                 o->setMethodIndex(-1,-1);
01493                                 //this->incRef();
01494                                 o->setSender(this);
01495                                 o->setPerformatif(IMessageBase::PTell);
01496                                 //if(returnMsg->getSender() != NULL) ((IObjectIA *)returnMsg->getSender())->incRef();
01497                                 o->setReceiver((IObjectIA *)returnMsg->getSender());
01498                                 ((IObjectIA *)msg->getSender())->sendMessage(o);
01499 
01500 
01501                                 if(msg->getContinuation() != NULL)
01502                                 {
01503                                         IMessageBase *o = (IMessageBase *)returnMsg->clone();
01504                                         o->setMethodIndex(-1,-1);
01505                                         //this->incRef();
01506                                         o->setSender(this);
01507                                         //if(msg->getContinuation() != NULL) ((IObjectIA *)msg->getContinuation())->incRef();
01508                                         o->setReceiver((IObjectIA *)msg->getContinuation());
01509                                         o->setPerformatif(IMessageBase::PTell);
01510                                         ((IObjectIA *)msg->getContinuation())->sendMessage(o);
01511                                 }
01512                         }
01513                         break;
01514                 case IMessageBase::PTell:
01515                         if(msg->getContinuation() != NULL)
01516                         {
01517                                 IMessageBase *o = (IMessageBase *)returnMsg->clone();
01518                                 o->setMethodIndex(-1,-1);
01519                                 //this->incRef();
01520                                 o->setSender(this);
01521                                 //if(msg->getContinuation() != NULL) ((IObjectIA *)msg->getContinuation())->incRef();
01522                                 o->setReceiver((IObjectIA *)msg->getContinuation());
01523                                 ((IObjectIA *)msg->getContinuation())->sendMessage(o);
01524                         }
01525                         break;
01526                 case IMessageBase::PBreak:
01527                         if(msg->getContinuation() != NULL)
01528                         {
01529                                 IMessageBase *o = (IMessageBase *)returnMsg->clone();
01530                                 o->setMethodIndex(-1,-1);
01531                                 //this->incRef();
01532                                 o->setSender(this);
01533                                 //if(msg->getContinuation() != NULL) ((IObjectIA *)msg->getContinuation())->incRef();
01534                                 o->setReceiver((IObjectIA *)msg->getContinuation());
01535                                 ((IObjectIA *)msg->getContinuation())->sendMessage(o);
01536                         }
01537                         break;
01538                 case IMessageBase::PKill:
01539                         if(msg->getContinuation() != NULL)
01540                         {
01541                                 IMessageBase *o = (IMessageBase *)returnMsg->clone();
01542                                 o->setMethodIndex(-1,-1);
01543                                 //this->incRef();
01544                                 o->setSender(this);
01545                                 //if(msg->getContinuation() != NULL) ((IObjectIA *)msg->getContinuation())->incRef();
01546                                 o->setReceiver((IObjectIA *)msg->getContinuation());
01547                                 ((IObjectIA *)msg->getContinuation())->sendMessage(o);
01548                         }
01549                         break;
01550                         default: break;
01551                 }
01552         }

void NLAIAGENT::CAgentScript::processMessages IMessageBase ,
IObjectIA
[virtual]
 

Reimplemented in NLAIAGENT::COperatorScript.

Definition at line 1412 of file agent_script.cpp.

References NLAISCRIPT::CCodeContext::ContextDebug, getBaseMethodCount(), NLAIAGENT::IMessageBase::getHeritanceIndex(), NLAIAGENT::IBasicAgent::getMail(), getMethode(), NLAIAGENT::IMessageBase::getMethodIndex(), NLAIC::IBasicType::getType(), NLAIC::IPointerGestion::incRef(), param, NLAIAGENT::IMailBox::popMessage(), processContinuation(), NLAIC::IPointerGestion::release(), NLAISCRIPT::CCallMethod::runOpCode(), NLAISCRIPT::CCodeContext::Self, and NLAISCRIPT::CCodeContext::Stack.

01413         {
01414 #ifdef NL_DEBUG
01415         const char *txt = (const char *)msg->getType(); 
01416         bool dbugB = false;     
01417 #endif
01418                 NLAISCRIPT::CCodeContext &context = (NLAISCRIPT::CCodeContext &)*c;
01419                 IBaseGroupType *param = new CGroupType();
01420                 msg->incRef();
01421                 param->push(msg);
01422                 context.Stack ++;
01423                 context.Stack[(int)context.Stack] = param;
01424 
01425                 int indexM = msg->getMethodIndex() - getBaseMethodCount();
01426                 if(indexM >= 0)
01427                 {
01428                         IObjectIA *code = getMethode(indexM);
01429                         if(code == NULL)
01430                         {
01431                                 getMail()->popMessage();
01432                                 return;
01433                         }
01434                 }
01435 
01436                 NLAISCRIPT::IMethodContext *methodContex;
01437 
01438                 if (context.ContextDebug.Active)
01439                 {
01440                         /*context.ContextDebug.Param.push_back(&listBidon);                                     
01441                         listBidon.incRef();*/
01442                         methodContex = new NLAISCRIPT::CMethodContextDebug();
01443                 }                               
01444                 else
01445                 {
01446                         methodContex = new NLAISCRIPT::CMethodContext();
01447                 }
01448                 const IObjectIA *self = context.Self;
01449                 context.Self = this;
01450                 NLAISCRIPT::CCallMethod opCall(methodContex,msg->getHeritanceIndex(),msg->getMethodIndex());
01451                 opCall.runOpCode(context);
01452                 context.Self = self;
01453                 IMessageBase *returnMsg = (IMessageBase *)context.Stack[(int)context.Stack];
01454                 returnMsg->incRef();
01455                 context.Stack--;
01456                 processContinuation(msg, returnMsg);
01457 
01458                 returnMsg->release();
01459         }

void NLAIAGENT::CAgentScript::processMessages  )  [virtual]
 

The processMessages method, process the loop/Run message.

Reimplemented from NLAIAGENT::IAgent.

Reimplemented in NLAIAGENT::CActorScript.

Definition at line 1554 of file agent_script.cpp.

References _AgentManager, NLAIAGENT::IAgentManager::getAgentContext(), NLAIAGENT::IBasicAgent::getMail(), NLAIAGENT::IMailBox::getMessage(), NLAIAGENT::IMailBox::getMessageCount(), NLAIAGENT::IMessageBase::getMethodIndex(), NLAIAGENT::IBasicAgent::getMethodIndexSize(), NLAIC::IBasicType::getType(), getType(), NLAIAGENT::IMailBox::popMessage(), NLAIC::IPointerGestion::release(), and sint.

Referenced by NLAIAGENT::CActorScript::processMessages(), and NLAIAGENT::CMainAgentScript::run().

01555         {
01556                 IObjectIA *c = NULL;
01557                 if( _AgentManager != NULL) 
01558                         c = (IObjectIA *)_AgentManager->getAgentContext();
01559                 else 
01560                         c = NULL;
01561 
01562                 IMailBox *mail = getMail();
01563 
01564                 
01565                 //const IMailBox::TListMessage &l = mail->getMesseageListe();
01566                 sint n = mail->getMessageCount();
01567 
01568                 while(/*l.begin() != l.end()*/n--)
01569                 {
01570                         IMessageBase &msg = (IMessageBase &)mail->getMessage();
01571 #ifdef NL_DEBUG
01572                 const char *dbg_this = (const char *) getType();
01573                 const char *dbg_msg = (const char *) msg.getType();
01574 #endif
01575                         
01576                         if(msg.getMethodIndex() >= 0 && c != NULL)
01577                         {
01578                                 sint indexM = msg.getMethodIndex() - IAgent::getMethodIndexSize();
01579                                 IObjectIA *o;
01580                                 if(indexM != CAgentScript::TDeflautProccessMsg) processMessages(&msg,c);
01581                                 else 
01582                                 {
01583                                         o = IBasicAgent::run( msg );
01584                                         if(o != NULL) o->release();
01585                                 }
01586                                 if ( mail->getMessageCount() != 0 )
01587                                         mail->popMessage();
01588                         }
01589                         else 
01590                         {
01591                                 try
01592                                 {
01593                                         IObjectIA *o = IBasicAgent::run( msg );
01594                                         if (o != NULL) 
01595                                                 o->release();
01596                                         mail->popMessage();
01597                                 }
01598                                 catch(NLAIE::CExceptionNotImplemented &e)
01599                                 {
01600                                         mail->popMessage();
01601                                         throw NLAIE::CExceptionNotImplemented(e.what());
01602                                 }
01603                         }                       
01604                 }
01605         }

void NLAIAGENT::IRefrence::refLoadStream NLMISC::IStream is  )  [protected, inherited]
 

the loader of the class.

Definition at line 433 of file baseai.cpp.

References NLAIAGENT::IRefrence::_NumRef, NLAIC::IBasicInterface::load(), NLAIC::IPointerGestion::release(), and NLMISC::IStream::serial().

Referenced by NLAIAGENT::IRefrence::IRefrence(), and NLAIAGENT::IRefrence::load().

00434         {
00435                 IObjectIA::load(is);
00436                 _NumRef->release();
00437                 NLAIC::CIdentTypeAlloc id;
00438                 is >> id;
00439                 _NumRef = (IWordNumRef *)id.allocClass();
00440                 _NumRef->load(is);
00441                 bool k;
00442                 is.serial( k );
00443                 if ( k ) 
00444                 {
00445                         if(_Parent) _Parent->release();
00446                         is >> id;
00447                         _Parent = (IWordNumRef *)id.allocClass();
00448                         _Parent->load(is);
00449                 }
00450                 else 
00451                 {
00452                         _Parent = NULL;
00453                 }
00454         }

virtual void NLAIC::IPointerGestion::release void   )  [inline, virtual, inherited]
 

Release allow to release the pointer. The last release when the _Ref is nul delete the object.

Definition at line 86 of file abstract_interface.h.

References NLAIC::IPointerGestion::decRef().

Referenced by NLAIAGENT::CSeqFsmScript::activate(), NLAISCRIPT::CAgentClass::addBrancheCode(), NLAISCRIPT::CConstraintDebug::addIndex(), NLAISCRIPT::CCompilateur::affectation(), NLAISCRIPT::CCompilateur::affectationMember(), NLAISCRIPT::COperatorClass::backward(), NLAILOGIC::CFirstOrderOperator::backward(), NLAILOGIC::CFirstOrderAssert::backward(), NLAISCRIPT::CCompilateur::buildObject(), NLAILINK::buildScript(), NLAISCRIPT::CCompilateur::callFunction(), NLAIC::CIdentType::CIdentType(), NLAISCRIPT::CCompilateur::clean(), NLAISCRIPT::CParam::clear(), NLAIAGENT::CVectorGroupType::clear(), NLAIAGENT::CGroupType::clear(), NLAIAGENT::CVolatilMemmory::CVolatilMemmory(), NLAISCRIPT::CFactorType::del(), NLAIAGENT::IAgentComposite::deleteListe(), NLAIPYSERVER::endPythonInterface(), NLAIAGENT::CVectorGroupType::erase(), NLAIAGENT::CGroupType::erase(), NLAIAGENT::CVectorGroupType::eraseAll(), NLAIAGENT::CGroupType::eraseAll(), NLAISCRIPT::CCompilateur::errorMethodConstraint(), NLAISCRIPT::CCompilateur::errorTypeConstraint(), NLAISCRIPT::CCompilateur::findMethode(), NLAISCRIPT::COperatorClass::forward(), NLAILOGIC::CFirstOrderOperator::forward(), NLAIAGENT::CComponentHandle::getComponent(), NLAIAGENT::COperatorScript::getDebugString(), getDebugString(), NLAILOGIC::IBaseOperator::IBaseOperator(), NLAISCRIPT::CCompilateur::ifInterrogation(), NLAISCRIPT::CCompilateur::ifInterrogationEnd(), NLAILOGIC::CFactPattern::init(), NLAILOGIC::CRule::init(), NLAIFUZZY::CTrapezeFuzzySet::init(), NLAIFUZZY::CLeftFuzzySet::init(), NLAIFUZZY::CTriangleFuzzySet::init(), NLAIFUZZY::CRightFuzzySet::init(), NLAIFUZZY::CFuzzyInterval::init(), NLAIFUZZY::CFuzzyRule::init(), NLAIFUZZY::CSimpleFuzzyCond::init(), NLAISCRIPT::CCompilateur::interrogationEnd(), NLAISCRIPT::COperatorClass::isValidFonc(), NLAIAGENT::IAgent::Kill(), NLAILOGIC::CVar::load(), NLAILOGIC::CValueSet::load(), NLAISCRIPT::CLdbOpCode::load(), NLAISCRIPT::CLibCallMethodi::load(), NLAISCRIPT::CLibCallInheritedMethod::load(), NLAISCRIPT::CLibCallMethod::load(), NLAISCRIPT::CLdbNewOpCode::load(), NLAISCRIPT::CAddParamNameDebug::load(), NLAISCRIPT::CFindRunMsg::load(), NLAIAGENT::IListBasicManager::load(), NLAIAGENT::CVectorGroupType::load(), NLAIAGENT::CGroupType::load(), load(), NLAIAGENT::CStringType::load(), NLAIAGENT::CLocalAgentMail::load(), NLAISCRIPT::CMethodContextDebug::loadContext(), NLAISCRIPT::CCompilateur::onEndClass(), NLAIAGENT::CLocalMailBox::onKill(), NLAIAGENT::IAgent::onKill(), NLAIAGENT::CLocalAgentMail::onKill(), NLAIAGENT::CVectorGroupType::operator-(), NLAIAGENT::CGroupType::operator-(), NLAIAGENT::CKeyObject::operator=(), NLAISCRIPT::CFunctionTag::operator=(), NLAIAGENT::CIdMethod::operator=(), NLAISCRIPT::CCompilateur::PrivateError(), NLAISCRIPT::CCompilateur::processingVar(), processMessages(), NLAIAGENT::IRefrence::refLoadStream(), NLAISCRIPT::CCompilateur::registerMethod(), NLAIAGENT::IAgentComposite::removeChild(), NLAILOGIC::CFirstOrderAssert::removeFact(), NLAISCRIPT::CConstraintStackComp::run(), NLAISCRIPT::CConstraintFindRun::run(), NLAISCRIPT::CConstraintMethode::run(), NLAIAGENT::IBasicAgent::run(), runInitComponent(), NLAIAGENT::CVolatilMemmory::runMessage(), NLAIAGENT::CAgentOperation::runMethodBase(), NLAISCRIPT::CCompilateur::runMethodConstraint(), NLAILOGIC::CInternalGoal::runMethodeMember(), NLAILOGIC::CGoal::runMethodeMember(), NLAILOGIC::CFact::runMethodeMember(), NLAIAGENT::IObjectIA::runMethodeMember(), NLAISCRIPT::CLdbStackMemberiOpCode::runOpCode(), NLAISCRIPT::CCallStackMethodi::runOpCode(), NLAISCRIPT::CLibHeapMemberMethod::runOpCode(), NLAISCRIPT::CAffOpCode::runOpCode(), NLAISCRIPT::CJFalseOpCode::runOpCode(), NLAISCRIPT::CAffOpCodeDebug::runOpCode(), NLAISCRIPT::CDiffOpCode::runOpCode(), NLAISCRIPT::CInfEqOpCode::runOpCode(), NLAISCRIPT::CSupEqOpCode::runOpCode(), NLAISCRIPT::CEqOpCode::runOpCode(), NLAISCRIPT::CInfOpCode::runOpCode(), NLAISCRIPT::CSupOpCode::runOpCode(), NLAISCRIPT::CMulOpCode::runOpCode(), NLAISCRIPT::CDivOpCode::runOpCode(), NLAISCRIPT::CSubOpCode::runOpCode(), NLAISCRIPT::CAddOpCode::runOpCode(), NLAISCRIPT::CNegOpCode::runOpCode(), runTellParentNotify(), NLAISCRIPT::CCompilateur::runTypeConstraint(), NLAIAGENT::CHashTimerManager::sendMessage(), NLAIAGENT::CVolatilMemmory::sendMessage(), NLAIAGENT::CLocalMailBox::sendMessage(), NLAIAGENT::IListManager::sendMessage(), NLAIAGENT::CAgentTimerHandle::sendMessage(), sendMessage(), sendMethod(), NLAISCRIPT::COperandSimple::serial(), NLAISCRIPT::CObjectUnknown::setBaseType(), NLAISCRIPT::CCompilateur::setChaineVar(), NLAISCRIPT::CClassInterpretFactory::setClass(), NLAIC::CSelfClassFactory::setClass(), NLAISCRIPT::IClassInterpret::setClassName(), NLAISCRIPT::CObjectUnknown::setClassType(), NLAIAGENT::IMessageBase::setContinuation(), NLAILOGIC::IBaseOperator::setGoal(), NLAISCRIPT::COperatorClass::setGoal(), NLAISCRIPT::CCompilateur::setImediateVar(), NLAISCRIPT::CCompilateur::setImediateVarNill(), NLAISCRIPT::CParam::setInfo(), NLAISCRIPT::CAgentClass::setInheritanceName(), NLAISCRIPT::CCompilateur::setListVar(), NLAIAGENT::IMessageBase::setMessageGroup(), NLAISCRIPT::CCompilateur::setMethodVar(), NLAILOGIC::IBaseVar::setName(), NLAIAGENT::CAgentOperation::setName(), NLAISCRIPT::CMethodeName::setName(), NLAIAGENT::IRefrence::setNumRef(), NLAISCRIPT::CConstraintFindRun::setOpCode(), NLAISCRIPT::CConstraintMethode::setOpCode(), NLAISCRIPT::CCompilateur::setPerformative(), NLAILOGIC::CInternalGoal::setProperty(), NLAIAGENT::IMessageBase::setReceiver(), NLAIAGENT::IMessageBase::setSender(), NLAILOGIC::CValueSet::setSize(), NLAISCRIPT::CCompilateur::setStackVar(), NLAIAGENT::CMessageScript::setStaticMember(), setStaticMember(), NLAISCRIPT::IClassInterpret::setType(), NLAISCRIPT::CFunctionTag::setTypeObject(), NLAISCRIPT::CMethodeName::setTypeOfMethode(), NLAILOGIC::CVar::setValue(), NLAIAGENT::CAgentOperation::setValue(), NLAIAGENT::IAgentInput::setValue(), NLAILOGIC::CValueSet::unify(), NLAISCRIPT::COperatorClass::unifyBackward(), NLAILOGIC::CFirstOrderOperator::unifyBackward(), NLAISCRIPT::COperatorClass::unifyForward(), NLAILOGIC::CFirstOrderOperator::unifyForward(), NLAILOGIC::CRule::unifyLiaisonBack(), NLAISCRIPT::CAddParamNameDebug::~CAddParamNameDebug(), NLAISCRIPT::CAgentClass::~CAgentClass(), NLAIAGENT::CAgentOperation::~CAgentOperation(), ~CAgentScript(), NLAIAGENT::CAgentTimerHandle::~CAgentTimerHandle(), NLAIAGENT::CAgentWatchTimer::~CAgentWatchTimer(), NLAISCRIPT::CClassInterpretFactory::~CClassInterpretFactory(), NLAISCRIPT::CCodeBrancheRunDebug::~CCodeBrancheRunDebug(), NLAISCRIPT::CCompilateur::~CCompilateur(), NLAIAGENT::CComponentHandle::~CComponentHandle(), NLAISCRIPT::CConstraintChkMethodeType::~CConstraintChkMethodeType(), NLAISCRIPT::CConstraintMethode::~CConstraintMethode(), NLAISCRIPT::CConstraintStackComp::~CConstraintStackComp(), NLAILOGIC::CFact::~CFact(), NLAISCRIPT::CFindRunMsg::~CFindRunMsg(), NLAILOGIC::CFirstOrderAssert::~CFirstOrderAssert(), NLAISCRIPT::CFunctionTag::~CFunctionTag(), NLAIC::CIdentType::~CIdentType(), NLAIAGENT::CIdMethod::~CIdMethod(), NLAILOGIC::CInternalGoal::~CInternalGoal(), NLAIAGENT::CKeyObject::~CKeyObject(), NLAISCRIPT::CLdbNewOpCode::~CLdbNewOpCode(), NLAISCRIPT::CLdbOpCode::~CLdbOpCode(), NLAISCRIPT::CLibCallInheritedMethod::~CLibCallInheritedMethod(), NLAISCRIPT::CLibCallMethod::~CLibCallMethod(), NLAISCRIPT::CLibCallMethodi::~CLibCallMethodi(), NLAIAGENT::CLocalMailBox::~CLocalMailBox(), NLAIAGENT::CMainAgentScript::~CMainAgentScript(), NLAISCRIPT::CLibTest::CMethodCall::~CMethodCall(), NLAIAGENT::CAgentScript::CMethodCall::~CMethodCall(), NLAISCRIPT::CMethodeName::~CMethodeName(), NLAISCRIPT::CAgentClass::CMethodType::~CMethodType(), NLAISCRIPT::CObjectUnknown::~CObjectUnknown(), NLAISCRIPT::COperandSimple::~COperandSimple(), NLAISCRIPT::COperandUnknown::~COperandUnknown(), NLAISCRIPT::COperationType::~COperationType(), NLAISCRIPT::COperationTypeGD::~COperationTypeGD(), NLAISCRIPT::COperatorClass::~COperatorClass(), NLAIAGENT::CPairType::~CPairType(), NLAIC::CSelfClassFactory::~CSelfClassFactory(), NLAIAGENT::CStringType::~CStringType(), NLAILOGIC::CValueSet::~CValueSet(), NLAILOGIC::CVar::~CVar(), NLAIAGENT::CVolatilMemmory::~CVolatilMemmory(), NLAIAGENT::IAgentInput::~IAgentInput(), NLAILOGIC::IBaseAssert::~IBaseAssert(), NLAILOGIC::IBaseOperator::~IBaseOperator(), NLAILOGIC::IBaseVar::~IBaseVar(), NLAIAGENT::IBasicAgent::~IBasicAgent(), NLAISCRIPT::IBlock::~IBlock(), NLAISCRIPT::IClassInterpret::~IClassInterpret(), NLAILOGIC::IGoal::~IGoal(), NLAIAGENT::IListBasicManager::~IListBasicManager(), NLAIAGENT::IMessageBase::~IMessageBase(), NLAIAGENT::IRefrence::~IRefrence(), and NLAICHARACTER::IZone::~IZone().

00087                 {
00088                         if(decRef() == 0) 
00089                                         delete this;
00090                 }

void NLAIAGENT::CAgentScript::releaseAgentScript  )  [static]
 

Definition at line 355 of file agent_script.cpp.

References sint.

Referenced by NLAILINK::releaseIALib().

00356         {               
00357                 //SendParamMessageScript->release();
00358                 //IdMsgNotifyParentClass->release();            
00360         // Temp, to be transfered in CGDAgentScript (Goal Driven Agent)
00361         // IdGoalMsgClass->release();
00362         // IdGoalMsg->release();
00363                 //ParamGoalMsg->release();
00364                 //ParamCancelGoalMsg->release();
00366 
00367                 //ParamRunParentNotify->release();
00368                 //SendCompParamMessageScript->release();
00369                 sint i;
00370                 for(i = 0; i < CAgentScript::TLastM; i++)
00371                 {
00372                                 delete StaticMethod[i];
00373                 }
00374                 delete StaticMethod;
00375         }

void NLAIAGENT::CAgentScript::remOperator NLAILOGIC::IBaseOperator p  )  [virtual]
 

Removing operator from th agent.

Definition at line 1672 of file agent_script.cpp.

01673         {
01674 /*              std::vector<NLAILOGIC::IBaseOperator *>::iterator it_o = _Operators.begin();
01675                 while ( it_o != _Operators.end() )
01676                 {
01677                         if ( op == *it_o )
01678                         {
01679                                 _Operators.erase( it_o );
01680                                 return;
01681                         }
01682                         it_o++;
01683                 }
01684                 char buf[2048];
01685                 op->getDebugString(buf);
01686                 throw NLAIE::CExceptionObjectNotFoundError(buf);
01687                 */
01688         }       

void NLAIAGENT::IAgentComposite::removeChild std::list< IBasicAgent * >::iterator &  iter  )  [virtual, inherited]
 

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

Implements NLAIAGENT::IBasicAgent.

Reimplemented in NLAIAGENT::CLocalAgentMail.

Definition at line 84 of file basic_agent.cpp.

References NLAIAGENT::IAgentComposite::_AgentList, and NLAIAGENT::IAgentComposite::_SizeChild.

00085         {                                       
00086                 _AgentList.erase(iter);
00087                 _SizeChild --;
00088         }

void NLAIAGENT::IAgentComposite::removeChild const IBasicAgent p  )  [virtual, inherited]
 

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

Implements NLAIAGENT::IBasicAgent.

Reimplemented in NLAIAGENT::CLocalAgentMail.

Definition at line 108 of file basic_agent.cpp.

References NLAIAGENT::IAgentComposite::_AgentList, NLAIAGENT::IAgentComposite::_SizeChild, NLAIAGENT::IBasicAgent::getMail(), NLAIC::IPointerGestion::release(), and NLAIAGENT::IMailBox::removeMailBox().

00109         {                       
00110                 std::list<IBasicAgent *>::iterator i = _AgentList.begin();
00111                 while(i != _AgentList.end())
00112                 {                                       
00113                         IBasicAgent *c = *i;
00114                         if(c == p)
00115                         {
00116                                 _AgentList.erase(i);                            
00117                                 p->getMail()->removeMailBox( this->getMail() );
00118                                 c->release();
00119                                 _SizeChild --;
00120                                 // Supprime chez l'ancien fils la boite au lettre du père                               
00121                                 break;
00122                         }
00123                         i++;
00124                 }
00125         }

void NLAIAGENT::IAgentComposite::removeChild const IBasicAgent p  )  [inherited]
 

Definition at line 90 of file basic_agent.cpp.

References NLAIAGENT::IAgentComposite::_AgentList, NLAIAGENT::IAgentComposite::_SizeChild, NLAIAGENT::IBasicAgent::getMail(), and NLAIAGENT::IMailBox::removeMailBox().

Referenced by removeDynamic(), NLAIAGENT::IAgent::runChildren(), and NLAIAGENT::IAgent::runChildrenStepByStep().

00091         {                       
00092                 std::list<IBasicAgent *>::iterator i = _AgentList.begin();
00093                 while(i != _AgentList.end())
00094                 {                                       
00095                         if(*((*i)) == p)
00096                         {
00097                                 (*i)->release();
00098                                 _AgentList.erase(i);
00099                                 // Supprime chez l'ancien fils la boite au lettre du père
00100                                 p.getMail()->removeMailBox( this->getMail() );
00101                                 _SizeChild --;
00102                                 return;
00103                         }
00104                         i++;
00105                 }
00106         }

void NLAIAGENT::IConnectIA::removeConnection IConnectIA Agent  )  [inherited]
 

To release a connection.

Definition at line 561 of file baseai.cpp.

References NLAIAGENT::IConnectIA::removeInConnectedList(), and NLAIAGENT::IConnectIA::removeInConnectionList().

Referenced by NLAIAGENT::CAgentWatchTimer::detach(), NLAIAGENT::IAgent::onKill(), NLAIAGENT::IAgentInput::releaseInputConnexion(), and NLAIAGENT::CLocalMailBox::removeMailBox().

00562         {               
00563                 Agent->removeInConnectedList(this);
00564                 removeInConnectionList(Agent);                  
00565         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::removeDynamic NLAIAGENT::IBaseGroupType g  )  [virtual]
 

that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g);

Definition at line 840 of file agent_script.cpp.

References _DynamicAgentName, NLAIAGENT::IBaseGroupType::getFront(), r, NLAIAGENT::IAgentComposite::removeChild(), and s.

00841         {
00842                 CStringType *s = (CStringType *)g->getFront();
00843                 IObjectIA::CProcessResult r;
00844                 r.ResultState = IObjectIA::ProcessIdle;
00845                 std::pair<TSetDefNameAgent::iterator,TSetDefNameAgent::iterator>  p = _DynamicAgentName.equal_range(CKeyAgent(*s));
00846 
00847                 if(p.first != p.second)
00848                 {       
00849                         while(p.first != p.second)
00850                         {
00851                                 TSetDefNameAgent::iterator iTmp = p.first;
00852                                 p.first ++;
00853 
00854                                 NLAIAGENT::IBasicAgent *o = *iTmp->Itr;
00855                                 _DynamicAgentName.erase(iTmp);                          
00856                                 removeChild(o);                         
00857                         }                       
00858                         r.Result = new DigitalType(1.0);
00859                         return r;
00860                 }               
00861                 r.Result = &DigitalType::NullOperator;
00862                 r.Result->incRef();
00863                 return r;
00864         }

void NLAIAGENT::CAgentScript::removeDynamic NLAIAGENT::IBasicAgent ag  )  [virtual]
 

remove an agent from the manager. The rgument g must store an CStringType. This string is the name of the agent to remove. The methode return the state of the operation, an digital at 1.0 if the remove is done an digital at 0.0 is the method did'nt find the agent.

Definition at line 867 of file agent_script.cpp.

References _DynamicAgentName, and NLAIAGENT::IAgentComposite::removeChild().

Referenced by runMethodBase(), and NLAIAGENT::CActorScript::unActivate().

00868         {               
00869                 
00870                 TSetDefNameAgent::iterator p = _DynamicAgentName.begin();
00871                 
00872                 while(p != _DynamicAgentName.end())
00873                 {
00874                         if((*(*p).Itr) == ag)
00875                         {
00876                                 _DynamicAgentName.erase(p);                             
00877                                 removeChild(ag);                        
00878                                 break;
00879                         }
00880                         p ++;
00881                 }                                       
00882         }

virtual void NLAIAGENT::CAgentScript::removeGoal NLAILOGIC::CGoal  )  [inline, virtual]
 

remove a goal, it hapend when it neaded by user, when the priorty is down or when the goal is satisfay.

Definition at line 410 of file agent_script.h.

Referenced by NLAILOGIC::CGoal::operatorSuccess().

00411                 {
00412                 }

void NLAIAGENT::IConnectIA::removeInConnectedList const IConnectIA a  )  [protected, inherited]
 

Definition at line 600 of file baseai.cpp.

References NLAIAGENT::IConnectIA::_Connected, and NLAIAGENT::IConnectIA::TListIBasicItr.

Referenced by NLAIAGENT::IConnectIA::Kill(), and NLAIAGENT::IConnectIA::removeConnection().

00601         {
00602                 TListIBasicItr i = _Connected.find(a);
00603                 if(i != _Connected.end())
00604                                                 _Connected.erase(i);
00605                 /*TListIBasicItr i = _Connected.begin();
00606                 while(i != _Connected.end())
00607                 {                       
00608                         const IConnectIA *o = *i;
00609                         if(o == a)
00610                         {                                       
00611                                 _Connected.erase(i);
00612                                 return;
00613                         }
00614                         i++;
00615                 }*/
00616         }

void NLAIAGENT::IConnectIA::removeInConnectionList IConnectIA a  )  [protected, inherited]
 

Definition at line 577 of file baseai.cpp.

References NLAIAGENT::IConnectIA::_Connection, and NLAIAGENT::IConnectIA::TListIBasicItr.

Referenced by NLAIAGENT::IConnectIA::Kill(), and NLAIAGENT::IConnectIA::removeConnection().

00578         {
00579 
00580                 TListIBasicItr i = _Connection.find(a);
00581                 if(i != _Connection.end())
00582                                                         _Connection.erase(i);
00583                 /*TListIBasicItr i = _Connection.begin();
00584                 while(i != _Connection.end())
00585                 {                               
00586                         if(*i == a)
00587                         {
00588                                 _Connection.erase(i);
00589                                 return;
00590                         }
00591                         i++;
00592                 }*/
00593         }

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

Run message is the message processing.

Reimplemented in NLAIAGENT::CMsgWaiter.

Definition at line 365 of file agents.cpp.

References NLAIAGENT::IMessageBase::getContinuation(), NLAIAGENT::IMessageBase::getPerformatif(), NLAIAGENT::IMessageBase::getSender(), NLAIC::IBasicType::getType(), NLAIC::IPointerGestion::incRef(), NLAIC::IPointerGestion::release(), NLAIAGENT::IBasicAgent::runAchieve(), NLAIAGENT::IBasicAgent::runAsk(), NLAIAGENT::IBasicAgent::runBreak(), NLAIAGENT::IBasicAgent::runError(), NLAIAGENT::IBasicAgent::runEven(), NLAIAGENT::IBasicAgent::runExec(), NLAIAGENT::IBasicAgent::runKill(), NLAIAGENT::IBasicAgent::runTell(), NLAIAGENT::IMessageBase::setPerformatif(), and NLAIC::stringGetBuild().

Referenced by NLAIAGENT::CSeqFsmScript::runChildren(), and NLAIAGENT::IAgent::runChildren().

00366         {
00367                 IMessageBase *returnMsg = NULL;
00368                 switch(msg.getPerformatif())
00369                 {
00370                 case IMessageBase::PUndefine:
00371                         {
00372                                 std::string text;
00373                                 text = NLAIC::stringGetBuild("Function IObjectIA *IBasicAgent::run('%s') proccess an IMessageBase::PUndefine performatif",(const char *)msg.getType());
00374                                 throw NLAIE::CExceptionNotImplemented(text.c_str());
00375                         }
00376                         break;          
00377                 case IMessageBase::PExec:
00378                 
00379                         returnMsg = runExec(msg);
00380                         if(msg.getContinuation() != NULL) 
00381                         {
00382                                 returnMsg->incRef();
00383                                 ((IObjectIA *)msg.getContinuation())->sendMessage(returnMsg);
00384                         }                               
00385                         break;
00386                 case IMessageBase::PAchieve:
00387                         returnMsg = runAchieve(msg);
00388                         if(msg.getContinuation() != NULL)
00389                         {
00390                                 returnMsg->incRef();
00391                                 ((IObjectIA *)msg.getContinuation())->sendMessage(returnMsg);
00392                         }
00393                         break;
00394                 case IMessageBase::PAsk:
00395                         returnMsg = runAsk(msg);
00396                         returnMsg->setPerformatif(IMessageBase::PTell);
00397                         returnMsg->incRef();                    
00398                         ((IObjectIA *)msg.getSender())->sendMessage(returnMsg);
00399                         if(msg.getContinuation() != NULL)
00400                         {                                       
00401                                 returnMsg->incRef();
00402                                 ((IObjectIA *)msg.getContinuation())->sendMessage(returnMsg);                           
00403                         }                       
00404                         break;
00405                 case IMessageBase::PTell:                       
00406                         returnMsg = runTell(msg);                       
00407                         
00408                         break;
00409                 case IMessageBase::PBreak:
00410                         returnMsg = runBreak(msg);
00411                         break;
00412                 case IMessageBase::PKill:
00413                         returnMsg = runKill(msg);
00414                         break;
00415                 case IMessageBase::PError:
00416                         returnMsg = runError(msg);
00417                         break;
00418 
00419                 case IMessageBase::PEven:
00420                         returnMsg = runEven(msg);                       
00421                         break;
00422                 default: break;
00423                 }
00424                 
00425                 if(returnMsg) returnMsg->release();
00426                 return NULL;
00427         }

const IObjectIA::CProcessResult & NLAIAGENT::CAgentScript::run  )  [virtual]
 

The work of an agent. Typically agent process child message, process its message and run its activity.

Reimplemented from NLAIAGENT::IAgent.

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CMainAgentScript, NLAIAGENT::CAgentOperation, NLAIAGENT::CFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 1628 of file agent_script.cpp.

References NLMISC::CTime::getPerformanceTime(), getType(), r, and NLMISC::TTicks.

Referenced by NLAIAGENT::CActorScript::run().

01629         {
01630                 
01631 #ifdef NL_DEBUG
01632                 const char *dbg_class_name = (const char *) getType();
01633                 //const NLAIAGENT::IRefrence *dbg_mail_parent = _ScriptMail->getParent();
01634 #endif
01635 
01636 #ifdef PROFILE
01637                 NLMISC::TTicks time = NLMISC::CTime::getPerformanceTime();
01638 #endif
01639 
01640                 const IObjectIA::CProcessResult &r = IAgentManager::run();
01641 
01642 #ifdef PROFILE
01643                 time = NLMISC::CTime::getPerformanceTime() - time;
01644                 //if(time)
01645                 {
01646                         TimeRun = time;
01647                         NbRun = 1;              
01648                 }
01649 #endif
01650 
01651                 return r;
01652                                 
01653         }

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

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 NLAIAGENT::IBasicAgent::run().

00128                 {
00129                         std::string debugString;
00130                         std::string text;
00131                         getDebugString(debugString);
00132                         text = "IMessageBase *runAchieve(";
00133                         text += (const char *)m.getType();
00134                         text += " note implementaited for the '";
00135                         text += (const char *)getType();
00136                         text += "' interface for the instence '";
00137                         text += (const char *)getType();
00138                         text += "' '";
00139                         text += debugString;
00140                         text += "'";
00141                         
00142                         throw NLAIE::CExceptionNotImplemented(text.c_str());
00143                         return NULL;
00144                 }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runActivity  )  [virtual]
 

Mailer do'nt have own activity.

Reimplemented from NLAIAGENT::IAgent.

Reimplemented in NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentClockTimer, and NLAIAGENT::CAgentOperation.

Definition at line 1607 of file agent_script.cpp.

References _AgentClass, _AgentManager, NLAIAGENT::IAgentManager::getAgentContext(), NLAISCRIPT::CAgentClass::getRunMethod(), runMethodeMember(), and NLAISCRIPT::CCodeContext::Self.

Referenced by NLAIAGENT::CMainAgentScript::run().

01608         {
01609                 
01610                 NLAISCRIPT::CCodeContext *context = (NLAISCRIPT::CCodeContext *)_AgentManager->getAgentContext();
01611                 context->Self = this;
01612                 if(_AgentClass->getRunMethod() >= 0) runMethodeMember(_AgentClass->getRunMethod(), context);
01613                 
01614                 return ProcessRun;
01615         }

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

runAsk is to processing reltative to PAsk Performatif. its call from the IObjectIA *run(const IMessageBase &m) method.

Definition at line 546 of file agents.cpp.

References NLAIC::IBasicType::getDebugString(), NLAIAGENT::IConnectIA::getParent(), NLAIC::IBasicType::getType(), and NLAIC::stringGetBuild().

Referenced by NLAIAGENT::IBasicAgent::run().

00547         {
00548                 if(NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass == m.getType())
00549                 {
00550                         if(getParent() != NULL)
00551                         {
00552                                 CNotifyParentScript *msg = new CNotifyParentScript();
00553                                 return msg;
00554                         }
00555                         else
00556                         {
00557                                 CNotifyParentScript *msg = new CNotifyParentScript((IBasicAgent *)getParent());
00558                                 return msg;
00559                         }
00560                 }
00561                 else
00562                 {
00563                         std::string debugString;
00564                         std::string text;
00565                         getDebugString(debugString);
00566                         text += NLAIC::stringGetBuild("runAsk(%s) note implementaited for the '%s' interface for the instence '%s'",(const char *)m.getType(),(const char *)getType(),debugString.c_str());
00567                         throw NLAIE::CExceptionNotImplemented(text.c_str());
00568                         return NULL;
00569                 }               
00570         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runAskDebugString IBaseGroupType  )  [virtual]
 

This function process the message ask debug string for the runTell.

Definition at line 923 of file agent_script.cpp.

References NLAIC::CIdentType::allocClass(), NLAIAGENT::IBaseGroupType::get(), getDebugString(), NLAIAGENT::IConnectIA::getParent(), NLAIAGENT::IMessageBase::getSender(), NLAIC::IBasicType::getType(), getType(), NLAIAGENT::IListBasicManager::push(), r, NLAIAGENT::IMessageBase::setPerformatif(), and NLAIAGENT::IMessageBase::setSender().

Referenced by runMethodBase().

00924         {
00925 
00926 #ifdef NL_DEBUG
00927                 const char *text = (const char *)getType();
00928                 const char *textP = (const char *)getParent()->getType();
00929 #endif
00930                 static NLAIC::CIdentType idMsgDebugString ("MsgDebugString");
00931 
00932                 NLAIAGENT::IMessageBase &mOriginal = (NLAIAGENT::IMessageBase &)*g->get();
00933 
00934                 IMessageBase *m = (IMessageBase *)idMsgDebugString.allocClass();
00935                 m->setPerformatif(IMessageBase::PTell);         
00936                 m->setSender(this);
00937 
00938                 std::string str;
00939                 getDebugString(str);
00940 
00941                 m->push(new CStringType(str));
00942 
00943                 if(mOriginal.getSender() != NULL)
00944                                                                 ((IObjectIA *)mOriginal.getSender())->sendMessage((IObjectIA *)m);
00945 
00946                 IObjectIA::CProcessResult r;
00947 
00948                 //m->incRef();
00949                 r.Result = m;
00950                 return r;
00951         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runAskGetValue IBaseGroupType  ) 
 

that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g);

Definition at line 1006 of file agent_script.cpp.

References _AgentClass, _Components, NLAIAGENT::IBaseGroupType::get(), NLAISCRIPT::CAgentClass::getInheritedStaticMemberIndex(), NLAIAGENT::IMessageBase::getSender(), NLAIAGENT::CStringType::getStr(), NLAIC::IPointerGestion::incRef(), index, r, NLAIAGENT::IListBasicManager::set(), NLAIAGENT::IMessageBase::setContinuation(), NLAIAGENT::IMessageBase::setMethodIndex(), NLAIAGENT::IMessageBase::setPerformatif(), and sint32.

Referenced by runMethodBase().

01007         {
01008                 NLAIAGENT::IMessageBase &msg_result = (NLAIAGENT::IMessageBase &)*g->get();
01009                 msg_result.incRef();
01010 
01011                 CStringType *comp_name = (CStringType *)msg_result[(sint32)0];
01012                 
01013                 msg_result.setPerformatif(IMessageBase::PTell);
01014                 msg_result.setMethodIndex(-1,-1);
01015                 msg_result.setContinuation( (IObjectIA *) msg_result.getSender() );
01016                 
01017                 sint32 index = _AgentClass->getInheritedStaticMemberIndex(  comp_name->getStr()  );
01018                 if ( index != -1 )
01019                 {
01020                         msg_result.set( 1, _Components[ index ] );
01021                 }
01022                 else
01023                 {
01024                         // Component not foud: return error msg
01025                 }
01026 
01027                 IObjectIA::CProcessResult r;
01028                 r.Result = &msg_result;
01029                 return r;
01030         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runAskParentNotify IBaseGroupType  )  [virtual]
 

This function process the message CNotifyParentScript for the runAsk.

Definition at line 912 of file agent_script.cpp.

References NLAIAGENT::IConnectIA::getParent(), r, NLAIAGENT::IMessageBase::setPerformatif(), and NLAIAGENT::IMessageBase::setSender().

Referenced by runMethodBase().

00913         {
00914                 CNotifyParentScript *m = new CNotifyParentScript((IBasicAgent *)getParent());
00915                 m->setPerformatif(IMessageBase::PTell);
00916                 //this->incRef();
00917                 m->setSender(this);
00918                 IObjectIA::CProcessResult r;
00919                 r.Result = m;
00920                 return r;
00921         }

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

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 NLAIAGENT::IBasicAgent::run().

00160                 {
00161                         std::string debugString;
00162                         std::string text;
00163                         getDebugString(debugString);
00164                         text = "IMessageBase *runBreak(";
00165                         text += (const char *)m.getType();
00166                         text += " note implementaited for the '";
00167                         text += (const char *)getType();
00168                         text += "' interface for the instence '";
00169                         text += (const char *)getType();
00170                         text += "' '";
00171                         text += debugString;
00172                         text += "'";
00173                         
00174                         throw NLAIE::CExceptionNotImplemented(text.c_str());
00175                         return NULL;
00176                 }

virtual IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runCancelGoalMsg IBaseGroupType  )  [inline, virtual]
 

Cancel a goal, it call by message manager when a cancel goal message is occure.

Definition at line 398 of file agent_script.h.

00399                 {
00400                         return IObjectIA::CProcessResult();
00401                 }

void NLAIAGENT::CAgentScript::runChildren  )  [virtual]
 

Run all child.

Reimplemented from NLAIAGENT::IAgent.

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

Definition at line 1377 of file agent_script.cpp.

References _Components, _NbComponents, getType(), NLAIAGENT::IObjectIA::run(), and NLAIAGENT::IAgent::runChildren().

Referenced by NLAIAGENT::CMainAgentScript::run().

01378         {
01379 #ifdef NL_DEBUG         
01380         const char *classBase = (const char *)getType();        
01381 #endif
01382                 // Activation des agents de la partie statique
01383                 int i = _NbComponents;
01384 
01385                 IObjectIA **com = _Components;
01386 
01387                 while(i --)
01388                         (*com ++)->run();               
01389 
01390                 // Activation des fils
01391                 IAgent::runChildren();
01392         }

bool NLAIAGENT::CAgentScript::runChildrenStepByStep  )  [virtual]
 

Activates the child agents.

Reimplemented from NLAIAGENT::IAgent.

Definition at line 1394 of file agent_script.cpp.

References _Components, _iComponents, _NbComponents, NLAIAGENT::IObjectIA::run(), and NLAIAGENT::IAgent::runChildrenStepByStep().

01395         {
01396                 if(_iComponents == _NbComponents)
01397                 {
01398                         if(IAgent::runChildrenStepByStep())
01399                         {
01400                                 _iComponents = 0;
01401                                 return true;                            
01402                         }
01403                         else return false;                      
01404                 }
01405 
01406                 IObjectIA *o = _Components[_iComponents ++];
01407                 o->run();
01408 
01409                 return false;
01410         }

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

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 NLAIAGENT::IBasicAgent::run().

00207                 {
00208                         std::string debugString;
00209                         std::string text;
00210                         getDebugString(debugString);
00211                         text = "IMessageBase *runError(";
00212                         text += (const char *)m.getType();
00213                         text += " note implementaited for the '";
00214                         text += (const char *)getType();
00215                         text += "' interface for the instence '";
00216                         text += (const char *)getType();
00217                         text += "' '";
00218                         text += debugString;
00219                         text += "'";
00220                         
00221                         throw NLAIE::CExceptionNotImplemented(text.c_str());
00222                         return NULL;
00223                 }

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

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 NLAIAGENT::IBasicAgent::run().

00106                 {
00107                         std::string debugString;
00108                         std::string text;
00109                         getDebugString(debugString);
00110                         text = "IMessageBase *runEven(";
00111                         text += (const char *)m.getType();
00112                         text += " note implementaited for the '";
00113                         text += (const char *)getType();
00114                         text += "' interface for the instence '";
00115                         text += (const char *)getType();
00116                         text += "' '";
00117                         text += debugString;
00118                         text += "'";
00119 
00120                         throw NLAIE::CExceptionNotImplemented(text.c_str());
00121                         return NULL;
00122                 }

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

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 NLAIAGENT::IBasicAgent::run().

00084                 {
00085                         std::string debugString;
00086                         std::string text;
00087                         getDebugString(debugString);
00088                         text = "IMessageBase *runExec(";
00089                         text += (const char *)m.getType();
00090                         text += " note implementaited for the '";
00091                         text += (const char *)getType();
00092                         text += "' interface for the instence '";
00093                         text += (const char *)getType();
00094                         text += "' '";
00095                         text += debugString;
00096                         text += "'";
00097                         
00098                         throw NLAIE::CExceptionNotImplemented(text.c_str());
00099                         return NULL;
00100                 }

virtual IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runFactMsg IBaseGroupType  )  [inline, virtual]
 

Add a fact on the fact base, it occur when a fact message hapend.

Definition at line 404 of file agent_script.h.

00405                 {
00406                         return IObjectIA::CProcessResult();
00407                 }

virtual IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runGoalMsg IBaseGroupType  )  [inline, virtual]
 

Run all goal message, it call by message manager when a goal message is occure.

Definition at line 392 of file agent_script.h.

00393                 {
00394                         return IObjectIA::CProcessResult();
00395                 }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runInitClass IBaseGroupType  )  [virtual]
 

that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g);

Definition at line 1103 of file agent_script.cpp.

References NLAIAGENT::IBaseGroupType::get(), and r.

01104         {
01105                 const char * class_name = ((NLAIAGENT::CStringVarName *)g->get())->getString();
01106                 NLAIC::CIdentType id_class( class_name );       
01107 
01108                 
01109 
01110                 /*
01111                 NLAIAGENT::IMessageBase &msg_result = (NLAIAGENT::IMessageBase &)*g->get();
01112                 msg_result.incRef();
01113 
01114 
01115                 // Cleans previous components
01116                 if ( _Components != NULL )
01117                 {
01118                         for ( int i = 0; i < _NbComponents; i++ )
01119                                 _Components[i]->release();
01120                 }
01121 
01122                 // Creates a new component array
01123                 _NbComponents = (sint32) msg_result.size() / 3;
01124                 _Components = new IObjectIA *[ _NbComponents ];
01125 
01126                 int test = 0;
01127 
01128                 for ( int i = 0; i < msg_result.size() ; i += 3 )
01129                 {
01130                         CStringType *comp_name = (CStringType *) msg_result[ (sint32) i ];
01131                         CStringType *comp_type = (CStringType *) msg_result[ (sint32) (i + 1) ];
01132                         IObjectIA *comp_val = (IObjectIA *) msg_result[ (sint32) (i + 2) ];
01133                         
01134                         sint32 index = getStaticMemberIndex( comp_name->getStr() ); //_AgentClass->getInheritedStaticMemberIndex(  comp_name->getStr()  );
01135                         if ( index != -1 )
01136                         {
01137                                 // Sets the component to the new value
01138                                 setStaticMember( index, comp_val );             
01139                         }
01140                         else
01141                         {
01142                                 setStaticMember( (sint32) (i / 3) , comp_val );
01143                         }
01144                         test++;
01145                 }
01146                 */
01147                 IObjectIA::CProcessResult r;
01148                 r.Result = NULL;
01149                 return r;
01150         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runInitComponent IBaseGroupType  )  [virtual]
 

that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g);

Definition at line 1060 of file agent_script.cpp.

References _Components, _NbComponents, NLAIAGENT::IBaseGroupType::get(), getStaticMemberIndex(), NLAIAGENT::CStringType::getStr(), NLAIC::IPointerGestion::incRef(), index, r, NLAIC::IPointerGestion::release(), setStaticMember(), sint32, and NLAIAGENT::IListBasicManager::size().

Referenced by runMethodBase().

01061         {
01062                 NLAIAGENT::IMessageBase &msg_result = (NLAIAGENT::IMessageBase &)*g->get();
01063                 msg_result.incRef();
01064 
01065 
01066                 // Cleans previous components
01067                 if ( _Components != NULL )
01068                 {
01069                         for ( int i = 0; i < _NbComponents; i++ )
01070                                 _Components[i]->release();
01071                 }
01072 
01073                 // Creates a new component array
01074                 _NbComponents = (sint32) msg_result.size() / 3;
01075                 _Components = new IObjectIA *[ _NbComponents ];
01076 
01077                 int test = 0;
01078 
01079                 for ( int i = 0; i < msg_result.size() ; i += 3 )
01080                 {
01081                         CStringType *comp_name = (CStringType *) msg_result[ (sint32) i ];
01082                         IObjectIA *comp_val = (IObjectIA *) msg_result[ (sint32) (i + 2) ];
01083                         
01084                         sint32 index = getStaticMemberIndex( comp_name->getStr() ); //_AgentClass->getInheritedStaticMemberIndex(  comp_name->getStr()  );
01085                         if ( index != -1 )
01086                         {
01087                                 // Sets the component to the new value
01088                                 setStaticMember( index, comp_val );             
01089                         }
01090                         else
01091                         {
01092                                 setStaticMember( (sint32) (i / 3) , comp_val );
01093                         }
01094                         test++;
01095                 }
01096 
01097                 IObjectIA::CProcessResult r;
01098                 msg_result.incRef();
01099                 r.Result = &msg_result;
01100                 return r;
01101         }

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

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 NLAIAGENT::IBasicAgent::run().

00185                 {
00186                         std::string debugString;
00187                         std::string text;
00188                         getDebugString(debugString);
00189                         text = "IMessageBase *runKill(";
00190                         text += (const char *)m.getType();
00191                         text += " note implementaited for the '";
00192                         text += (const char *)getType();
00193                         text += "' interface for the instence '";
00194                         text += (const char *)getType();
00195                         text += "' '";
00196                         text += debugString;
00197                         text += "'";
00198                         
00199                         throw NLAIE::CExceptionNotImplemented(text.c_str());
00200                         return NULL;
00201                 }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runMethodBase int  index,
IObjectIA
[virtual]
 

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentOperation, NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript.

Definition at line 1849 of file agent_script.cpp.

References _AgentClass, _DynamicAgentName, addDynamicAgent(), addSet(), getClassName(), getDynamicAgent(), NLAISCRIPT::CAgentClass::getInheritedStaticMemberIndex(), NLAIAGENT::IBasicAgent::getMethodIndexSize(), NLAIAGENT::IConnectIA::getParent(), NLAIAGENT::CStringType::getStr(), NLAIC::IPointerGestion::incRef(), index, isa(), isClassInheritedFrom(), NLAIAGENT::CKeyAgent::Itr, NLAIAGENT::CKeyAgent::Name, param, r, NLAIAGENT::IObjectIA::CProcessResult::Result, runAskDebugString(), runAskGetValue(), runAskParentNotify(), runInitComponent(), NLAIAGENT::IBasicAgent::runMethodeMember(), runTellComponent(), runTellParentNotify(), runTellSetValue(), s, sendMethod(), sendMethodCompoment(), TAddChildTag, TAddSet, TFather, TGetChildTag, TGetClassName, TGetName, TGetValue, TInitComponent, TIsEUU, TIsInherited, TRunAskComponent, TRunAskDebugString, TRunAskParentNotify, TRunTellComponent, TRunTellParentNotify, TSelf, TSend, TSendComponent, TSetStatic, TSetValue, NLAISCRIPT::CAgentClass::updateStaticMember(), and value.

01850         {               
01851                 switch(index - IAgent::getMethodIndexSize())
01852                 {
01853                 case TSend:
01854                         {
01855                                 return sendMethod(o);
01856                         }
01857 
01858                 case TSendComponent:
01859                         {
01860                                 return sendMethodCompoment(o);
01861                         }
01862 
01863                 case TGetChildTag:
01864                         {
01865                                 return getDynamicAgent((IBaseGroupType *)o);
01866                         }
01867 
01868                 case TAddChildTag:
01869                         {
01870                                 return addDynamicAgent((IBaseGroupType *)o);
01871                         }
01872                 case TFather:
01873                         {
01874                                 IObjectIA::CProcessResult a;
01875                                 a.Result = (IObjectIA *)getParent();
01876                                 //if(a.Result != NULL) 
01877                                 a.Result->incRef();
01878                                 return a;
01879                         }
01880 
01881                 case TSelf:
01882                         {
01883                                 IObjectIA::CProcessResult a;
01884                                 a.Result = new CLocalAgentMail(this);
01885                                 return a;
01886                         }
01887                 case TGetName:
01888                         {
01889                                 IObjectIA::CProcessResult r;
01890                                 const CAgentScript *p = (CAgentScript *)getParent();
01891                                 TSetDefNameAgent::iterator i = p->_DynamicAgentName.begin();
01892 
01893                                 while(i != p->_DynamicAgentName.end())
01894                                 {
01895                                         CKeyAgent key = *i;
01896                                         if( this == *key.Itr )
01897                                         {
01898                                                 CStringType *s = new CStringType(key.Name);
01899                                                 r.Result = s;
01900                                                 return r;
01901                                         }
01902                                         i ++;
01903                                 }
01904                                 r.Result = new CStringType(CStringVarName("Unknown"));
01905                                 return r;
01906                         }
01907 
01908                 case TGetClassName:
01909                         {
01910                                 IObjectIA::CProcessResult r;
01911                                 const NLAIAGENT::IVarName *classname = getClassName();
01912                                 r.Result = new CStringType( *classname );
01913 
01914                                 r.Result->incRef();
01915                                 return r;
01916                         }
01917 
01918                 case TIsInherited:
01919                         {
01920                                 IObjectIA::CProcessResult r;
01921                                 if ( _AgentClass != NULL )
01922                                 {
01923                                         CGroupType *param = (CGroupType *) o;
01924                                         CStringType *comp_name = (CStringType *)((IBaseGroupType *)param)->popFront();
01925                                         if ( isClassInheritedFrom( comp_name->getStr() ) != -1 )
01926                                                 r.Result = new NLAILOGIC::CBoolType( true );
01927                                         else
01928                                                 r.Result = new NLAILOGIC::CBoolType( false );
01929                                         
01930                                 }
01931                                 else
01932                                         r.Result = new NLAILOGIC::CBoolType( false );
01933 
01934                                 r.Result->incRef();
01935                                 return r;
01936                         }
01937 
01938                 case TRunAskParentNotify:
01939                         {                               
01940                                 return runAskParentNotify((IBaseGroupType *)o);
01941                         }
01942 
01943                 case TRunTellParentNotify:
01944                         {                               
01945                                 return runTellParentNotify((IBaseGroupType *)o);
01946                         }
01947 
01948                 case TRunAskDebugString:
01949                         {
01950                                 return runAskDebugString((IBaseGroupType *)o);
01951                         }
01952 
01953                 case TRunAskComponent:
01954                 case TRunTellComponent:
01955                         {                               
01956                                 return runTellComponent((IBaseGroupType *)o);
01957                         }
01958                 case TSetStatic:
01959                         {
01960                                 CGroupType *param = (CGroupType *) o;
01961                                 CStringType *comp_name = (CStringType *)((IBaseGroupType *)param)->popFront();
01962                                 IObjectIA *value = (IObjectIA *)((IBaseGroupType *)param)->popFront();
01963                                 int index = _AgentClass->getInheritedStaticMemberIndex( comp_name->getStr() );
01964                                 _AgentClass->updateStaticMember(index, value);
01965                                 IObjectIA::CProcessResult a;
01966                                 a.Result = NULL;
01967                                 return a;
01968                         }
01969 
01970                 case TGetValue:
01971                         {
01972                                 return runAskGetValue( (IBaseGroupType *) o );
01973                         }
01974 
01975                 case TSetValue:
01976                         {
01977                                 return runTellSetValue( (IBaseGroupType *) o );
01978                         }
01979 
01980                 case TInitComponent:
01981                         {
01982                                 return runInitComponent( (IBaseGroupType *) o );
01983                         }
01984 
01985                 case TIsEUU:
01986                         {
01987                                 CGroupType *param = (CGroupType *) o;
01988                                 std::string s(((NLAIAGENT::CStringType *)param->get())->getStr().getString());
01989                                 NLAIAGENT::IObjectIA::CProcessResult r;
01990                                 
01991                                 if(isa(s))                              
01992                                         r.Result = new NLAIAGENT::DigitalType(1.0);                             
01993                                 else
01994                                         r.Result = new NLAIAGENT::DigitalType(0.0);
01995                                 return r;
01996                         }                       
01997 
01998                 case TAddSet:
01999                         {
02000                                 CGroupType *param = (CGroupType *) o;
02001                                 std::string s(((NLAIAGENT::CStringType *)param->get())->getStr().getString());                          
02002                                 addSet(s);
02003 
02004                                 return NLAIAGENT::IObjectIA::CProcessResult();
02005                         }                       
02006 
02007                 default:
02008                         return IAgent::runMethodeMember(index,o);
02009                 }
02010         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runMethodBase int  heritance,
int  index,
IObjectIA
[virtual]
 

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentOperation, NLAIAGENT::CSeqFsmScript, NLAILOGIC::CGoalPath, and NLAIAGENT::COperatorScript.

Definition at line 1698 of file agent_script.cpp.

References _AgentClass, _DynamicAgentName, addDynamicAgent(), getClassName(), NLAISCRIPT::CAgentClass::getComponentIndex(), getDynamicAgent(), NLAIAGENT::IBasicAgent::getMethodIndexSize(), NLAIAGENT::IConnectIA::getParent(), NLAIAGENT::CStringType::getStr(), NLAIC::IPointerGestion::incRef(), index, isClassInheritedFrom(), NLAIAGENT::CKeyAgent::Itr, NLAIAGENT::CKeyAgent::Name, param, r, removeDynamic(), NLAIAGENT::IObjectIA::CProcessResult::Result, runAskDebugString(), runAskGetValue(), runAskParentNotify(), runInitComponent(), NLAIAGENT::IBasicAgent::runMethodeMember(), runTellComponent(), runTellParentNotify(), runTellSetValue(), s, sendMethod(), sendMethodCompoment(), TAddChildTag, TFather, TGetChildTag, TGetClassName, TGetName, TGetValue, TInitComponent, TIsInherited, TRemoveChild, TRunAskComponent, TRunAskDebugString, TRunAskParentNotify, TRunTellComponent, TRunTellParentNotify, TSelf, TSend, TSendComponent, TSetStatic, TSetValue, NLAISCRIPT::CAgentClass::updateStaticMember(), and value.

Referenced by NLAIAGENT::CAgentWatchTimer::runMethodBase(), NLAIAGENT::CActorScript::runMethodBase(), and runMethodeMember().

01699         {
01700                 switch(index - IAgent::getMethodIndexSize())
01701                 {
01702                 case TSend:
01703                         {
01704                                 return sendMethod(o);
01705                         }
01706 
01707                 case TSendComponent:
01708                         {
01709                                 return sendMethodCompoment(o);
01710                         }
01711 
01712                 case TGetChildTag:
01713                         {
01714                                 return getDynamicAgent((IBaseGroupType *)o);
01715                         }
01716 
01717                 case TAddChildTag:
01718                         {
01719                                 return addDynamicAgent((IBaseGroupType *)o);
01720                         }
01721 
01722                 case TFather:
01723                         {
01724                                 IObjectIA::CProcessResult a;
01725                                 a.Result = (IObjectIA *)getParent();
01726                                 a.Result->incRef();
01727                                 return a;
01728                         }
01729 
01730                 case TSelf:
01731                         {
01732                                 IObjectIA::CProcessResult a;
01733                                 a.Result = new CLocalAgentMail(this);
01734                                 return a;
01735                         }
01736 
01737                 case TGetName:
01738                         {               
01739                                 IObjectIA::CProcessResult r;
01740                                 const CAgentScript *p = (CAgentScript *)getParent();
01741                                 TSetDefNameAgent::iterator i = p->_DynamicAgentName.begin();
01742 
01743                                 while(i != p->_DynamicAgentName.end())
01744                                 {
01745                                         CKeyAgent key = *i;
01746                                         if( this == *key.Itr )
01747                                         {
01748                                                 CStringType *s = new CStringType(key.Name);
01749                                                 r.Result = s;
01750                                                 return r;
01751                                         }
01752                                         i ++;
01753                                 }
01754                                 r.Result = new CStringType(CStringVarName("Unknown"));
01755                                 
01756                                 return r;
01757                         }
01758 
01759                 case TGetClassName:
01760                         {
01761                                 IObjectIA::CProcessResult r;
01762                                 if ( _AgentClass != NULL )
01763                                 {
01764                                         const NLAIAGENT::IVarName *classname = getClassName();
01765                                         r.Result = new CStringType( *classname );
01766                                 }
01767                                 else
01768                                         r.Result = new CStringType( CStringVarName("<unknown>"));                               
01769                                 return r;
01770                         }
01771 
01772                 case TIsInherited:
01773                         {
01774                                 IObjectIA::CProcessResult r;
01775                                 if ( _AgentClass != NULL )
01776                                 {
01777                                         CGroupType *param = (CGroupType *) o;
01778                                         CStringType *comp_name = (CStringType *)((IBaseGroupType *)param)->popFront();
01779                                         if ( isClassInheritedFrom( comp_name->getStr() ) != -1 )
01780                                                 r.Result = new NLAILOGIC::CBoolType( true );
01781                                         else
01782                                                 r.Result = new NLAILOGIC::CBoolType( false );
01783                                 }
01784                                 else
01785                                         r.Result = new NLAILOGIC::CBoolType( false );
01786                                 
01787                                 return r;
01788                         }
01789 
01790                 case TRemoveChild:
01791                         {
01792                                 return removeDynamic((IBaseGroupType *)o);
01793                         }
01794 
01795                 case TRunAskParentNotify:
01796                         {                               
01797                                 return runAskParentNotify((IBaseGroupType *)o);
01798                         }
01799 
01800                 case TRunTellParentNotify:
01801                         {                               
01802                                 return runTellParentNotify((IBaseGroupType *)o);
01803                         }
01804 
01805                 case TRunAskDebugString:
01806                         {
01807                                 return runAskDebugString((IBaseGroupType *)o);
01808                         }
01809 
01810                 case TRunAskComponent:
01811                 case TRunTellComponent:
01812                         {                               
01813                                 return runTellComponent((IBaseGroupType *)o);
01814                         }
01815 
01816 
01817                 case TSetStatic:
01818                         {
01819                                 CGroupType *param = (CGroupType *) o;
01820                                 CStringType *comp_name = (CStringType *)((IBaseGroupType *)param)->popFront();
01821                                 IObjectIA *value = (IObjectIA *)((IBaseGroupType *)param)->popFront();
01822                                 int index = _AgentClass->getComponentIndex(  comp_name->getStr()  );
01823                                 _AgentClass->updateStaticMember(index, value);
01824                                 return IObjectIA::CProcessResult();
01825                         }
01826 
01827                 case TGetValue:
01828                         {
01829                                 return runAskGetValue( (IBaseGroupType *) o );
01830                         }
01831 
01832                 case TSetValue:
01833                         {
01834                                 return runTellSetValue( (IBaseGroupType *) o );
01835                         }
01836 
01837                 case TInitComponent:
01838                         {
01839                                 return runInitComponent( (IBaseGroupType *) o );
01840                         }
01841 
01842 
01843                 default:
01844                         return IAgent::runMethodeMember(index,o);
01845                                 
01846                 }               
01847         }

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

Reimplemented in NLAIAGENT::CAgentWatchTimer.

Definition at line 2172 of file agent_script.cpp.

References NLAISCRIPT::CCodeContext::Code, NLAISCRIPT::CCodeContext::ContextDebug, getBaseMethodCount(), getMethode(), NLAIC::IBasicType::getType(), index, NLAISCRIPT::CCodeContext::Param, r, runMethodBase(), NLAIAGENT::IBasicAgent::runMethodeMember(), sint32, NLAISCRIPT::CCodeContext::Stack, and uint32.

02173         {
02174                 if(c->getType() != NLAISCRIPT::CCodeContext::IdCodeContext)
02175                 {
02176                         return IAgent::runMethodeMember(index, c);
02177                 }
02178 
02179                 NLAISCRIPT::IOpCode *opPtr = NULL;
02180                 NLAISCRIPT::CCodeContext &context = (NLAISCRIPT::CCodeContext &)*c;
02181 
02182                 int i = index - getBaseMethodCount();
02183                 if(i < 0)
02184                 {
02185                         /*if (context.ContextDebug.Active)
02186                         {
02187                                 context.ContextDebug.Param.push_back(&listBidon);
02188                                 listBidon.incRef();
02189                         }*/
02190 
02191                         IObjectIA::CProcessResult r = runMethodBase(index,(IObjectIA *)context.Param.back());
02192                         if(r.Result != NULL)
02193                         {
02194                                 context.Stack++;
02195                                 context.Stack[(int)context.Stack] = r.Result;
02196                         }
02197                         r.Result = NULL;
02198                         return r;
02199                 }
02200                 else
02201                 {
02202                         opPtr = getMethode(i);
02203                 }
02204                 IObjectIA::CProcessResult r;
02205                 if(opPtr != NULL)
02206                 {
02207                         NLAISCRIPT::CCodeBrancheRun *opTmp = context.Code;
02208                         int ip;
02209                         if(context.Code != NULL) ip = (uint32)*context.Code;
02210                         else ip =0;
02211                         context.Code = (NLAISCRIPT::CCodeBrancheRun *)opPtr;
02212                         *context.Code = 0;
02213                         
02214                         r = ((NLAISCRIPT::ICodeBranche *)opPtr)->run(context);
02215 
02216                         // If we are in Debug Mode
02217                         if (context.ContextDebug.Active)
02218                         {
02219                                 context.ContextDebug.callStackPop();
02220                         }
02221 
02222                         *context.Code = ip;
02223                         context.Code = opTmp;           
02224                 }
02225                 return r;
02226         }

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

Definition at line 2112 of file agent_script.cpp.

References _AgentClass, NLAISCRIPT::CCodeContext::Code, NLAISCRIPT::CCodeContext::ContextDebug, getBaseMethodCount(), NLAISCRIPT::CAgentClass::getBrancheCode(), getMethode(), NLAIC::IBasicType::getType(), index, NLAISCRIPT::CCodeContext::Param, r, runMethodBase(), NLAIAGENT::IBasicAgent::runMethodeMember(), sint32, NLAISCRIPT::CCodeContext::Stack, and uint32.

Referenced by NLAIAGENT::COperatorScript::execOnActivate(), NLAIAGENT::CActorScript::failure(), NLAIAGENT::CActorScript::pause(), NLAIAGENT::CActorScript::restart(), NLAIAGENT::CMainAgentScript::run(), NLAIAGENT::CActorScript::run(), runActivity(), NLAIAGENT::CActorScript::success(), and NLAIAGENT::CActorScript::unActivate().

02113         {
02114 
02115                 if(c->getType() != NLAISCRIPT::CCodeContext::IdCodeContext)
02116                 {
02117                         return IAgent::runMethodeMember(inheritance,index, c);
02118                 }
02119                 
02120                 NLAISCRIPT::IOpCode *opPtr = NULL;
02121                 NLAISCRIPT::CCodeContext &context = (NLAISCRIPT::CCodeContext &)*c;
02122 
02123                 int i = index - getBaseMethodCount();
02124                 if(i < 0)
02125                 {                       
02126                         /*if (context.ContextDebug.Active)
02127                         {
02128                                 context.ContextDebug.Param.push_back(&listBidon);
02129                                 listBidon.incRef();
02130                         }*/
02131                 
02132                         IObjectIA::CProcessResult r = runMethodBase(index,(IObjectIA *)context.Param.back());
02133                         if(r.Result != NULL)
02134                         {
02135                                 context.Stack++;
02136                                 context.Stack[(int)context.Stack] = r.Result;
02137                         }
02138                         r.Result = NULL;
02139                         return r;
02140                 }
02141                 else
02142                 {
02143                         opPtr = getMethode(inheritance,i);
02144                 }
02145                 
02146                 IObjectIA::CProcessResult r;
02147                 if(opPtr != NULL)
02148                 {
02149 #ifdef NL_DEBUG
02150                 std::string nameDbg;
02151                 _AgentClass->getBrancheCode(inheritance,i).getName().getDebugString(nameDbg);
02152                 _AgentClass->getBrancheCode(inheritance,i).getParam().getDebugString(nameDbg);
02153 #endif
02154                         NLAISCRIPT::IOpCode &op = *opPtr;
02155                         NLAISCRIPT::CCodeBrancheRun *opTmp = context.Code;
02156                         int ip = (uint32)*context.Code;
02157                         context.Code = (NLAISCRIPT::CCodeBrancheRun *)&op;              
02158                         *context.Code = 0;
02159 
02160                         r = ((NLAISCRIPT::ICodeBranche *)opPtr)->run(context);
02161                         // If we are in Debug Mode
02162                         if (context.ContextDebug.Active)
02163                         {
02164                                 context.ContextDebug.callStackPop();
02165                         }
02166                         *context.Code = ip;
02167                         context.Code = opTmp;           
02168                 }
02169                 return r;
02170         }

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

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

00229                 {
00230                         std::string debugString;
00231                         std::string text;
00232                         getDebugString(debugString);
00233                         text = "IMessageBase *runService(";
00234                         text += (const char *)m.getType();
00235                         text += " note implementaited for the '";
00236                         text += (const char *)getType();
00237                         text += "' interface for the instence '";
00238                         text += (const char *)getType();
00239                         text += "' '";
00240                         text += debugString;
00241                         text += "'";
00242                         
00243                         throw NLAIE::CExceptionNotImplemented(text.c_str());
00244                         return NULL;
00245                 }

const IObjectIA::CProcessResult & NLAIAGENT::CAgentScript::runStep  )  [virtual]
 

Some where Run method define the process of the agen.

Reimplemented from NLAIAGENT::IAgent.

Definition at line 1655 of file agent_script.cpp.

References getType().

01656         {
01657                 
01658 #ifdef NL_DEBUG
01659                 const char *dbg_class_name = (const char *) getType();
01660                 //const NLAIAGENT::IRefrence *dbg_mail_parent = _ScriptMail->getParent();
01661 #endif
01662 
01663                 return IAgentManager::runStep();
01664                                 
01665         }

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

runTell is to processing reltative to PTell Performatif. its call from the IObjectIA *run(const IMessageBase &m) method.

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentWatchTimer, and NLAIAGENT::CAgentOperation.

Definition at line 572 of file agents.cpp.

References NLAIC::IBasicType::clone(), and NLAIC::IBasicType::getType().

Referenced by NLAIAGENT::IBasicAgent::run(), and NLAIAGENT::CAgentWatchTimer::runTell().

00573         {
00574                 if(NLAISCRIPT::CMsgNotifyParentClass::IdMsgNotifyParentClass == m.getType())
00575                 {
00576                         /*const INombreDefine *n = (const INombreDefine *)m.getFront();
00577                         if(n->getNumber() != 0.0)
00578                         {
00579                                 const CLocalAgentMail *parent = (const CLocalAgentMail *)m.get();
00580                         }*/
00581                         return (IMessageBase *)m.clone();                       
00582                 }
00583                 else
00584                 {
00585 /*                      std::string debugString;
00586                         std::string text;
00587                         getDebugString(debugString);
00588                         text += NLAIC::stringGetBuild("runTell(%s) note implementaited for the '%s' interface for the instence '%s'",(const char *)m.getType(),(const char *)getType(),debugString.c_str());
00589                         throw NLAIE::CExceptionNotImplemented(text.c_str()); */
00590                         return NULL;
00591                 }
00592         }       

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runTellComponent IBaseGroupType  )  [virtual]
 

This function process the message MsgTellCompoment the result is to transmit a Message to an compoment.

Definition at line 989 of file agent_script.cpp.

References NLAIAGENT::IBaseGroupType::get(), NLAIAGENT::IMessageBase::getPerformatif(), NLAIAGENT::IMessageBase::getSender(), NLAIAGENT::CStringType::getStr(), NLAIC::IPointerGestion::incRef(), r, sendMessage(), NLAIAGENT::IMessageBase::setPerformatif(), NLAIAGENT::IMessageBase::setSender(), and sint32.

Referenced by runMethodBase().

00990         {       
00991                 NLAIAGENT::IMessageBase &mOriginal = (NLAIAGENT::IMessageBase &)*g->get();
00992                 CStringType *c = (CStringType *)mOriginal[(sint32)0];
00993                 NLAIAGENT::IMessageBase *m = (NLAIAGENT::IMessageBase *)mOriginal[(sint32)1];
00994                 m->incRef();
00995                 m->setSender((IObjectIA *)mOriginal.getSender());
00996                 m->setPerformatif(mOriginal.getPerformatif());
00997                 sendMessage(c->getStr(), (IObjectIA *)m);
00998 
00999                 IObjectIA::CProcessResult r;
01000 
01001                 m->incRef();
01002                 r.Result = m;
01003                 return r;
01004         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runTellParentNotify IBaseGroupType  )  [virtual]
 

This function process the message CNotifyParentScript for the runTell.

Definition at line 953 of file agent_script.cpp.

References _Components, _NbComponents, NLAIAGENT::CNotifyParentScript::clone(), NLAIAGENT::IConnectIA::getParent(), NLAIC::IBasicType::getType(), getType(), r, NLAIC::IPointerGestion::release(), NLAIAGENT::IMessageBase::setPerformatif(), NLAIAGENT::IMessageBase::setSender(), sint, t, and uint.

Referenced by runMethodBase().

00954         {       
00955                 sint i;
00956 
00957 #ifdef NL_DEBUG
00958                 const char *text = (const char *)getType();
00959                 const char *textP = (const char *)getParent()->getType();
00960 #endif
00961                 CNotifyParentScript *m = new CNotifyParentScript(this);
00962                 m->setPerformatif(IMessageBase::PTell);         
00963                 m->setSender(this);
00964 
00965                 for(i = 0; i < _NbComponents; i++)
00966                 {
00967                         if(_Components[i] != NULL)
00968                         {                               
00969                                 CNotifyParentScript *msg = (CNotifyParentScript *)m->clone();
00970                                 try
00971                                 {
00972                                         uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent;
00973                                         const NLAIC::CTypeOfObject &t = _Components[i]->getType();
00974 
00975                                         if((t.getValue() & b) == b)
00976                                                                         _Components[i]->sendMessage(msg);                                       
00977                                 }
00978                                 catch(NLAIE::IException &)
00979                                 {
00980                                         msg->release();
00981                                 }
00982                         }
00983                 }
00984                 IObjectIA::CProcessResult r;
00985                 r.Result = m;
00986                 return r;
00987         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::runTellSetValue IBaseGroupType  ) 
 

that is a surchage of the method member virtual IObjectIA::CProcessResult addDynamicAgent(NLAIAGENT::IBaseGroupType *g);

Definition at line 1032 of file agent_script.cpp.

References NLAIAGENT::IBaseGroupType::get(), getStaticMemberIndex(), NLAIAGENT::CStringType::getStr(), NLAIC::IPointerGestion::incRef(), index, r, setStaticMember(), sint32, and NLAIAGENT::IListBasicManager::size().

Referenced by runMethodBase().

01033         {
01034                 NLAIAGENT::IMessageBase &msg_result = (NLAIAGENT::IMessageBase &)*g->get();
01035                 msg_result.incRef();
01036 
01037                 while ( msg_result.size() )
01038                 {
01039                         CStringType *comp_name = (CStringType *) msg_result[ (sint32) 0 ];
01040                         IObjectIA *comp_val = (IObjectIA *) msg_result[ (sint32) 1 ];
01041                         
01042                         sint32 index = getStaticMemberIndex( comp_name->getStr() );
01043                         if ( index != -1 )
01044                         {
01045                                 // Sets the component to the new value
01046                                 setStaticMember( index, comp_val );             
01047                         }
01048                         else
01049                         {
01050                                 // Component not found: creates it
01051                                 
01052                         }
01053                 }
01054                 IObjectIA::CProcessResult r;
01055                 msg_result.incRef();
01056                 r.Result = &msg_result;
01057                 return r;
01058         }

void NLAIAGENT::CAgentScript::save NLMISC::IStream os  )  [virtual]
 

programmer have to call this method to load or save internal attribut.

Reimplemented from NLAIAGENT::IAgent.

Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CAgentManagerTimer, NLAIAGENT::CAgentOperation, NLAIAGENT::CFsmScript, NLAIAGENT::CSeqFsmScript, and NLAIAGENT::COperatorScript.

Definition at line 593 of file agent_script.cpp.

References _Components, _NbComponents, getType(), NLAIC::IBasicInterface::save(), NLMISC::IStream::serial(), sint32, and size.

Referenced by NLAIAGENT::CActorScript::save().

00594         {
00595                 IBasicAgent::save(os);
00596                 sint32 size = _NbComponents;
00597                 os.serial( size );
00598                 for ( int i = 0; i < _NbComponents; i++ )
00599                 {
00600                         os.serial( (NLAIC::CIdentType &) _Components[i]->getType() );
00601                         _Components[i]->save(os);
00602                 }               
00603         }       

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::sendBroadCast IObjectIA  )  [protected, virtual]
 

Definition at line 1197 of file agent_script.cpp.

References _DynamicAgentName, NLAIC::IPointerGestion::incRef(), and NLAIAGENT::IObjectIA::sendMessage().

01198         {
01199                 TSetDefNameAgent::iterator i = _DynamicAgentName.begin();
01200 
01201                 if(i != _DynamicAgentName.end()) 
01202                 {
01203                         ((IObjectIA *)(*(*(i)).Itr))->sendMessage(m);
01204                         i ++;
01205 
01206                         while(i != _DynamicAgentName.end())
01207                         {
01208                                 m->incRef();
01209                                 IObjectIA *o = ((IObjectIA *)(*(*(i)).Itr));
01210                                 o->sendMessage(m);
01211                                 i++;
01212                         }
01213                 }
01214 
01215                 return IObjectIA::CProcessResult();
01216         }

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

Send message to an receiver agent.

Definition at line 326 of file agents.cpp.

References NLAIAGENT::IMailBox::addMessage(), and NLAIAGENT::IBasicAgent::getMail().

00327         {
00328                 receiver.getMail()->addMessage( msg );
00329                 return IObjectIA::ProcessRun;
00330         }

IObjectIA::CProcessResult NLAIAGENT::IBasicAgent::sendMessage IMessageBase msg  )  [virtual, inherited]
 

Send a message to the agent.

Implements NLAIAGENT::IConnectIA.

Definition at line 320 of file agents.cpp.

References NLAIAGENT::IBasicAgent::_Mail, and NLAIAGENT::IMailBox::addMessage().

Referenced by NLAILOGIC::IGoal::failure(), sendMessage(), and NLAILOGIC::IGoal::success().

00321         {
00322                 _Mail->addMessage(msg);
00323                 return IObjectIA::ProcessRun;
00324         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::sendMessage const IVarName ,
IObjectIA
[virtual]
 

This method allow to send a message to an compoment given by an string IVarName.

Reimplemented from NLAIAGENT::IObjectIA.

Definition at line 1250 of file agent_script.cpp.

References _AgentClass, getStaticMember(), getStaticMemberIndex(), NLAIAGENT::IVarName::getString(), NLAIC::IBasicType::getType(), NLAIAGENT::processError, NLAIC::IPointerGestion::release(), NLAIAGENT::IObjectIA::sendMessage(), and sendMessageToDynmaicChild().

01251         {
01252 #ifdef NL_DEBUG
01253         const char *txt = (const char *)msg->getType();
01254         const char *compNameDb = (const char *)compName.getString();
01255         //nlinfo("MSG %s %4x", txt, this);
01256 #endif
01257                 if(_AgentClass != NULL)
01258                 {
01259                         int i = getStaticMemberIndex(compName);
01260                         if(i >= 0)
01261                         {
01262                                 IObjectIA *comp = (IObjectIA *)getStaticMember(i);
01263                                 if(comp != NULL)
01264                                 {
01265                                         comp->sendMessage(msg);
01266                                 }
01267                                 else
01268                                 {
01269                                         if(sendMessageToDynmaicChild(compName,msg).ResultState == processError) msg->release();
01270                                 }
01271                         }
01272                         else
01273                         {
01274                                 if(sendMessageToDynmaicChild(compName,msg).ResultState == processError) msg->release();
01275                         }
01276                 }
01277                 else                    
01278                 {                                               
01279                         if(sendMessageToDynmaicChild(compName,msg).ResultState == processError) msg->release();
01280                 }
01281                 return IObjectIA::CProcessResult();
01282         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::sendMessage IObjectIA m  )  [virtual]
 

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

Reimplemented from NLAIAGENT::IConnectIA.

Reimplemented in NLAIAGENT::CActorScript, and NLAIAGENT::CMainAgentScript.

Definition at line 1284 of file agent_script.cpp.

References NLAIAGENT::IMessageBase::getMethodIndex(), NLMISC::CTime::getPerformanceTime(), NLAIAGENT::IMessageBase::getPerformatif(), getType(), NLAIC::IBasicType::getType(), NLAIAGENT::CIdMethod::Index, isMember(), r, NLAIAGENT::IBasicAgent::sendMessage(), NLAIAGENT::IMessageBase::setMethodIndex(), NLAIAGENT::IMessageBase::setReceiver(), t, NLAIAGENT::TQueue, and uint.

Referenced by runTellComponent(), NLAIAGENT::CAgentTimerHandle::sendMessage(), NLAIAGENT::CActorScript::sendMessage(), sendMessageToDynmaicChild(), sendMethod(), and sendMethodCompoment().

01285         {
01286 #ifdef NL_DEBUG
01287         const char *txt = (const char *)m->getType();
01288         const char *classBase = (const char *)getType();
01289         //nlinfo("MSG %s %4x", txt, m);
01290 #endif
01291                 IMessageBase *msg = (IMessageBase *)m;
01292                 //this->incRef();
01293                 msg->setReceiver(this);
01294                 if(msg->getMethodIndex() < 0)
01295                 {                       
01296                         uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tMessage;
01297                         const NLAIC::CTypeOfObject &t = m->getType();
01298 
01299                         if((t.getValue() & b) == b)                     
01300                         {
01301                                 //char runMsg[1024];
01302                                 //strcpy(runMsg,_RUN_);
01303                                 static CStringVarName sRunTell("RunTell");
01304                                 static CStringVarName sRunAchieve("RunAchieve");
01305                                 static CStringVarName sRunAsk("RunAsk");
01306                                 static CStringVarName sRunExec("RunExec");
01307                                 static CStringVarName sRunBreak("RunBreak");
01308                                 static CStringVarName sRunKill("RunKill");
01309                                 static CStringVarName sRunError("RunError");
01310 
01311                                 CStringVarName *runMsg = NULL;//sRunTell;
01312 
01313                                 switch(msg->getPerformatif())
01314                                 {
01315                                 case IMessageBase::PExec:
01316                                         //strcat(runMsg,"Exec");
01317                                         runMsg = &sRunExec;
01318                                         break;
01319                                 case IMessageBase::PAchieve:
01320                                         //strcat(runMsg,"Achieve");
01321                                         runMsg = &sRunAchieve;
01322                                         break;
01323                                 case IMessageBase::PAsk:
01324                                         //strcat(runMsg,"Ask");
01325                                         runMsg = &sRunAsk;
01326                                         break;
01327                                 case IMessageBase::PTell:
01328                                         //strcat(runMsg,"Tell");
01329                                         runMsg = &sRunTell;
01330                                         break;
01331                                 case IMessageBase::PBreak:
01332                                         runMsg = &sRunBreak;
01333                                         break;
01334                                 case IMessageBase::PKill:
01335                                         runMsg = &sRunKill;
01336                                         break;
01337                                 case IMessageBase::PError:
01338                                         runMsg = &sRunError;
01339                                         break;
01340 
01341                                 default:
01342                                         throw;
01343                                         break;
01344                                 }
01345 
01346                                 CStringVarName &tmp_name = *runMsg;
01347 
01348                                 NLAISCRIPT::COperandSimple *t = new NLAISCRIPT::COperandSimple(new NLAIC::CIdentType(m->getType()));
01349                                 NLAISCRIPT::CParam p(1,t);
01350                                 
01351                                 TQueue r = isMember(NULL,&tmp_name,p);
01352                                 if(r.size())
01353                                 {
01354                                         NLAIAGENT::CIdMethod m = r.top();
01355                                         msg->setMethodIndex(0,m.Index);
01356                                 }                               
01357                         }                       
01358                 }
01359 
01360                 IObjectIA::CProcessResult r = IAgent::sendMessage(msg);
01361 
01362         
01363 
01364 #ifdef PROFILE
01365                 time = NLMISC::CTime::getPerformanceTime() - time;
01366                 //if(time)
01367                 {
01368                         TimeSend += time;
01369                         NbSend ++;                      
01370                 }
01371 #endif
01372 
01373                 return r;
01374                 //return IObjectIA::CProcessResult();
01375         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::sendMessageToDynmaicChild const IVarName ,
IObjectIA
 

Definition at line 1218 of file agent_script.cpp.

References _DynamicAgentName, NLAIC::IBasicType::clone(), NLAIC::IBasicType::getDebugString(), NLAIC::IBasicType::getType(), NLAIAGENT::processError, r, and sendMessage().

Referenced by sendMessage().

01219         {
01220                 //TSetDefNameAgent::iterator  p = _DynamicAgentName.find(CKeyAgent(CStringType(compName)));
01221                 std::pair<TSetDefNameAgent::iterator,TSetDefNameAgent::iterator>  p = _DynamicAgentName.equal_range(CKeyAgent(CStringType(compName)));
01222 
01223 #ifdef NL_DEBUG
01224                 const char *txt = (const char *)msg->getType();
01225                 std::string txtName;
01226                 compName.getDebugString(txtName);
01227 #endif
01228 
01229                 IObjectIA::CProcessResult r;
01230 
01231                 if(p.first != p.second)
01232                 {
01233                         while(p.first != p.second)
01234                         {
01235                                 CAgentScript *o = (CAgentScript *)*((*(p.first)).Itr);
01236                                 o->sendMessage(msg);
01237                                 p.first ++;
01238                                 if(p.first != p.second) msg = (IObjectIA *)msg->clone();
01239                         }
01240                 }
01241                 else
01242                 {
01243                         r.ResultState = processError;
01244                         r.Result = NULL;                        
01245                 }
01246 
01247                 return r;
01248         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::sendMethod IObjectIA  ) 
 

Definition at line 1177 of file agent_script.cpp.

References NLAIAGENT::INombreDefine::getNumber(), param, NLAIC::IPointerGestion::release(), sendMessage(), NLAIAGENT::IMessageBase::setPerformatif(), and sint.

Referenced by runMethodBase().

01178         {
01179                 INombreDefine *p = (INombreDefine *)((IBaseGroupType *)param)->popFront();
01180                 IMessageBase *msg = (IMessageBase *)((IBaseGroupType *)param)->popFront();
01181                 msg->setPerformatif((IMessageBase::TPerformatif)(sint)p->getNumber());
01182                 p->release();
01183                 return sendMessage(msg);
01184         }

IObjectIA::CProcessResult NLAIAGENT::CAgentScript::sendMethodCompoment IObjectIA  ) 
 

Definition at line 1186 of file agent_script.cpp.

References NLAIAGENT::INombreDefine::getNumber(), NLAIAGENT::CStringType::getStr(), NLAIC::IPointerGestion::incRef(), param, sendMessage(), NLAIAGENT::IMessageBase::setPerformatif(), and sint.

Referenced by runMethodBase().

01187         {
01188                 NLAIAGENT::CIteratorContener It = ((IBaseGroupType *)param)->getIterator();
01189                 const CStringType *n = (const CStringType *)It++;
01190                 INombreDefine *p = (INombreDefine *)((IBaseGroupType *)It++);
01191                 IMessageBase *msg = (IMessageBase *)((IBaseGroupType *)It++);
01192                 msg->setPerformatif((IMessageBase::TPerformatif)(sint)p->getNumber());
01193                 msg->incRef();
01194                 return sendMessage(n->getStr(),msg);
01195         }       

virtual void NLAIC::IBasicInterface::serial NLMISC::IStream f  )  throw (NLMISC::EStream) [inline, virtual, inherited]
 

Reimplemented from NLAIC::IPointerGestion.

Definition at line 328 of file abstract_interface.h.

References NLAIC::IBasicInterface::load(), and NLAIC::IBasicInterface::save().

00329                 {
00330                         if ( f.isReading() )
00331                                 load( f );
00332                         else
00333                                 save( f );
00334                 }

void NLAIAGENT::CAgentScript::setAgentManager IAgentManager manager  )  [virtual]
 

Set the manager for this instance.

Definition at line 496 of file agent_script.cpp.

References _AgentManager, _Components, _NbComponents, NLAIC::IBasicType::getType(), t, and uint.

00497         {
00498                 //if(_AgentManager != NULL) _AgentManager->release();
00499                 _AgentManager = manager;
00500                 for ( int i = 0; i < _NbComponents; i++ )
00501                 {                       
00502 
00503                         uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent;
00504                         const NLAIC::CTypeOfObject &t = (const NLAIC::CTypeOfObject &)_Components[i]->getType();
00505                         if( (t.getValue() & b ) == b)                   
00506                         {                               
00507                                 ((CAgentScript *)_Components[i])->setAgentManager(_AgentManager);                       
00508                         }
00509                 }
00510         }

void NLAIAGENT::IRefrence::setNumRef const IWordNumRef ref  )  [protected, inherited]
 

Definition at line 461 of file baseai.cpp.

References NLAIAGENT::IRefrence::_NumRef, NLAIAGENT::IWordNumRef::getNumIdent(), and NLAIC::IPointerGestion::release().

00462         {
00463                 if(_NumRef != NULL) _NumRef->release();
00464                 _NumRef = new CLocWordNumRef(ref.getNumIdent(),this);
00465         }

void NLAIAGENT::IConnectIA::setParent const IWordNumRef parent  )  [virtual, inherited]
 

to set the parent of the agents.

Reimplemented from NLAIAGENT::IRefrence.

Definition at line 661 of file baseai.cpp.

References NLAIAGENT::IConnectIA::connect(), and NLAIAGENT::IConnectIA::getParent().

Referenced by addDynamicAgent(), NLAIAGENT::IAgentComposite::deleteListe(), NLAIAGENT::IBasicAgent::IBasicAgent(), NLAIAGENT::IConnectIA::onKill(), NLAIAGENT::CProxyAgentMail::sendMessage(), NLAIAGENT::CLocalAgentMail::sendMessage(), and NLAIAGENT::IBasicAgent::~IBasicAgent().

00662         {               
00663                 IRefrence::setParent(parent);
00664                 IConnectIA *p = (IConnectIA *)getParent();
00665 
00666                 if(p != NULL) connect(p);
00667         }

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

Set the state of an agent.

Implements NLAIAGENT::IConnectIA.

Definition at line 314 of file agents.cpp.

References NLAIAGENT::IBasicAgent::_RunState.

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

00315         {
00316                 _RunState.ResultState = state;
00317                 _RunState.Result = result;
00318         }

bool NLAIAGENT::IObjectIA::setStaticMember const IVarName compName,
IObjectIA change
[inline, inherited]
 

to cahnge a given components given by an index.

Definition at line 268 of file baseai.h.

References NLAIAGENT::IObjectIA::getStaticMemberIndex().

Referenced by NLAISCRIPT::CAffHeapMemberiOpCode::runOpCode(), NLAISCRIPT::CAffMemberiOpCode::runOpCode(), and NLAIAGENT::CLocalAgentMail::setStaticMember().

00269                 {
00270                         return setStaticMember(getStaticMemberIndex(compName),change);
00271                 }

bool NLAIAGENT::CAgentScript::setStaticMember sint32  ,
IObjectIA
[virtual]
 

to cahnge a given components given by a string.

Reimplemented from NLAIAGENT::IObjectIA.

Definition at line 517 of file agent_script.cpp.

References _Components, _NbComponents, index, NLAIC::IPointerGestion::release(), sint32, t, and uint.

Referenced by NLAIAGENT::COperatorScript::checkTrigMsg(), NLAIAGENT::COperatorScript::linkGoalArgs(), runInitComponent(), and runTellSetValue().

00518         {
00519 #ifdef NL_DEBUG
00520                 if ( index >= _NbComponents )
00521                 {
00522                         throw NLAIE::CExceptionIndexError();
00523                 }
00524 #endif
00525                 IObjectIA *old_comp = _Components[ index ];
00526                 _Components[ index ] = op;              
00527 
00528                 uint b = NLAIC::CTypeOfObject::tInterpret | NLAIC::CTypeOfObject::tAgent;
00529                 const NLAIC::CTypeOfObject &t = op->getType();
00530                 if((t.getValue() & b) == b)
00531                 {
00532                         ((CAgentScript *)op)->setParent( (const IWordNumRef *) *this);
00533                 }
00534                 if(op != old_comp)  
00535                 {
00536                         old_comp->release();
00537                         return false;
00538                 }
00539                 return true;
00540         }

virtual void NLAIAGENT::CAgentScript::setTopLevel NLAIAGENT::CAgentScript  )  [inline, virtual]
 

Set the top level agent of this one.

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

Definition at line 415 of file agent_script.h.

Referenced by NLAIAGENT::CFsmScript::setTopLevel(), and NLAIAGENT::CActorScript::setTopLevel().

00416                 {
00417                 }

void NLAIAGENT::IRefrence::setTypeAt uint64  t  )  [inherited]
 

That function allow user to change the 7 bit of the type field in the sid agent number;.

Definition at line 485 of file baseai.cpp.

References NLAIAGENT::IRefrence::_NumRef, NLAIAGENT::CNumericIndex::getId(), NLAIAGENT::IWordNumRef::getNumIdent(), t, and uint64.

Referenced by NLAIAGENT::IRefrence::IRefrence().

00486         {
00487                 ((CAgentNumber &)(_NumRef->getNumIdent().getId())).setTypeAt(t);
00488         }


Field Documentation

NLAISCRIPT::CAgentClass* NLAIAGENT::CAgentScript::_AgentClass [protected]
 

The creator of this instance. This useful for find scripted method entry point.

Definition at line 178 of file agent_script.h.

Referenced by CAgentScript(), getChildMessageIndex(), getClass(), getClassName(), getDebugString(), getFactoryClass(), getMethode(), getMethodeMemberDebugString(), getStaticMemberIndex(), getType(), haveActivity(), isClassInheritedFrom(), isMember(), newInstance(), runActivity(), runAskGetValue(), runMethodBase(), runMethodeMember(), and sendMessage().

TBasicList NLAIAGENT::IAgentComposite::_AgentList [protected, inherited]
 

Definition at line 340 of file agent.h.

Referenced by NLAIAGENT::IAgentComposite::addChild(), NLAIAGENT::IAgentComposite::cpyChild(), NLAIAGENT::IAgentComposite::deleteListe(), NLAIAGENT::IAgentComposite::IAgentComposite(), NLAIAGENT::IAgentComposite::removeChild(), and NLAIAGENT::IAgentComposite::save().

IAgentManager* NLAIAGENT::CAgentScript::_AgentManager [protected]
 

The manager where the agent is run this manager have the agent script context.

Definition at line 170 of file agent_script.h.

Referenced by CAgentScript(), getAgentManager(), getDebugString(), processMessages(), runActivity(), and setAgentManager().

IObjectIA** NLAIAGENT::CAgentScript::_Components [protected]
 

Table of static compoments.

Definition at line 163 of file agent_script.h.

Referenced by CAgentScript(), createComponents(), getDebugString(), getStaticMember(), load(), runAskGetValue(), runChildren(), runChildrenStepByStep(), runInitComponent(), runTellParentNotify(), save(), setAgentManager(), setStaticMember(), and ~CAgentScript().

TListIBasic NLAIAGENT::IConnectIA::_Connected [protected, inherited]
 

Definition at line 427 of file baseai.h.

Referenced by NLAIAGENT::IConnectIA::addInConnectedList(), NLAIAGENT::IConnectIA::Kill(), NLAIAGENT::IConnectIA::removeInConnectedList(), and NLAIAGENT::IConnectIA::save().

TListIBasic NLAIAGENT::IConnectIA::_Connection [protected, inherited]
 

Reimplemented in NLAIAGENT::CAgentOperation.

Definition at line 426 of file baseai.h.

Referenced by NLAIAGENT::IConnectIA::addInConnectionList(), NLAIAGENT::IConnectIA::Kill(), NLAIAGENT::IConnectIA::removeInConnectionList(), and NLAIAGENT::IConnectIA::save().

TSetDefNameAgent NLAIAGENT::CAgentScript::_DynamicAgentName [protected]
 

Map for store agent added in the dynamic child container.

Definition at line 173 of file agent_script.h.

Referenced by addDynamicAgent(), getDynamicAgent(), getDynamicName(), onKill(), removeDynamic(), runMethodBase(), sendBroadCast(), and sendMessageToDynmaicChild().

sint NLAIAGENT::CAgentScript::_iComponents [protected]
 

Definition at line 179 of file agent_script.h.

Referenced by CAgentScript(), and runChildrenStepByStep().

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

Box letter for communication service.

Definition at line 63 of file agent.h.

Referenced by NLAIAGENT::IBasicAgent::getMail(), NLAIAGENT::IBasicAgent::IBasicAgent(), NLAIAGENT::IBasicAgent::load(), NLAIAGENT::IBasicAgent::onKill(), NLAIAGENT::IBasicAgent::save(), NLAIAGENT::IBasicAgent::sendMessage(), and NLAIAGENT::IBasicAgent::~IBasicAgent().

int NLAIAGENT::CAgentScript::_NbComponents [protected]
 

Nomber of static compoment.

Definition at line 167 of file agent_script.h.

Referenced by CAgentScript(), createComponents(), getDebugString(), getStaticMember(), getStaticMemberSize(), load(), runChildren(), runChildrenStepByStep(), runInitComponent(), runTellParentNotify(), save(), setAgentManager(), setStaticMember(), and ~CAgentScript().

CProcessResult NLAIAGENT::IBasicAgent::_RunState [protected, inherited]
 

Internal state of the agent.

Definition at line 61 of file agent.h.

Referenced by NLAIAGENT::IBasicAgent::getState(), and NLAIAGENT::IBasicAgent::setState().

sint NLAIAGENT::IAgentComposite::_SizeChild [protected, inherited]
 

Definition at line 342 of file agent.h.

Referenced by NLAIAGENT::IAgentComposite::addChild(), NLAIAGENT::IAgentComposite::cpyChild(), NLAIAGENT::IAgentComposite::deleteListe(), NLAIAGENT::IAgentComposite::getChildCoun(), NLAIAGENT::IAgentComposite::load(), and NLAIAGENT::IAgentComposite::removeChild().

const NLAIC::CIdentType * IAgent::IdAgent = NULL [static, inherited]
 

Definition at line 77 of file static_def_init.cpp.

Referenced by NLAIAGENT::IAgent::getType().

const NLAIC::CIdentType CAgentScript::IdAgentScript [static]
 

Referenced by getType().

NLAISCRIPT::COperandSimpleListOr * NLAIAGENT::CAgentScript::IdMsgNotifyParent = NULL [static]
 

Definition at line 67 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::COperandSimple * NLAIAGENT::CAgentScript::IdMsgNotifyParentClass = NULL [static]
 

Definition at line 66 of file agent_script.cpp.

Referenced by initAgentScript().

std::set<std::string> NLAIAGENT::CAgentScript::mapSet [protected]
 

Definition at line 181 of file agent_script.h.

Referenced by addSet(), beginSet(), CAgentScript(), endSet(), and isa().

NLAISCRIPT::COperandSimpleListOr * NLAIAGENT::CAgentScript::msgPerf = NULL [static]
 

Definition at line 63 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::COperandSimpleListOr * NLAIAGENT::CAgentScript::msgType = NULL [static]
 

Definition at line 62 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::CParam * NLAIAGENT::CAgentScript::ParamGetValueMsg = NULL [static]
 

Definition at line 71 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::COperandSimpleListOr * NLAIAGENT::CAgentScript::ParamIdGetValueMsg = NULL [static]
 

Definition at line 70 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::COperandSimpleListOr * NLAIAGENT::CAgentScript::ParamIdInitComponentMsg = NULL [static]
 

Definition at line 76 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::COperandSimpleListOr * NLAIAGENT::CAgentScript::ParamIdSetValueMsg = NULL [static]
 

Definition at line 72 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::COperandSimpleListOr * NLAIAGENT::CAgentScript::ParamIdTellComponentMsg = NULL [static]
 

Definition at line 74 of file agent_script.cpp.

NLAISCRIPT::CParam * NLAIAGENT::CAgentScript::ParamInitComponentMsg = NULL [static]
 

Definition at line 77 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::CParam * NLAIAGENT::CAgentScript::ParamRunParentNotify = NULL [static]
 

Definition at line 68 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::CParam* NLAIAGENT::CAgentScript::ParamSetStatic [static]
 

Definition at line 140 of file agent_script.h.

NLAISCRIPT::CParam * NLAIAGENT::CAgentScript::ParamSetValueMsg = NULL [static]
 

Definition at line 73 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::CParam * NLAIAGENT::CAgentScript::ParamTellComponentMsg = NULL [static]
 

Definition at line 75 of file agent_script.cpp.

Referenced by initAgentScript().

TProcessStatement NLAIAGENT::IObjectIA::ProcessBuzzy = processBuzzy [static, inherited]
 

Define the an buzzy state for an agent all time in this state.

Definition at line 147 of file baseai.cpp.

TProcessStatement NLAIAGENT::IObjectIA::ProcessEnd = processEnd [static, inherited]
 

Define the an end state for an agent all time in this state.

Definition at line 148 of file baseai.cpp.

TProcessStatement NLAIAGENT::IObjectIA::ProcessError = processError [static, inherited]
 

Define the an error state for an agent all time in this state.

Definition at line 149 of file baseai.cpp.

TProcessStatement NLAIAGENT::IObjectIA::ProcessIdle = processIdle [static, inherited]
 

Define the an idle state for an agent all time in this state.

Definition at line 145 of file baseai.cpp.

TProcessStatement NLAIAGENT::IObjectIA::ProcessLocked = processLocked [static, inherited]
 

Define the an locked state for an agent all time in this state.

Definition at line 146 of file baseai.cpp.

IObjectIA::CProcessResult NLAIAGENT::IObjectIA::ProcessNotComplit = IObjectIA::CProcessResult(processNotComplete) [static, inherited]
 

Definition at line 144 of file baseai.cpp.

IObjectIA::CProcessResult NLAIAGENT::IObjectIA::ProcessRun = IObjectIA::CProcessResult() [static, inherited]
 

Definition at line 143 of file baseai.cpp.

NLAISCRIPT::CParam * NLAIAGENT::CAgentScript::SendCompParamMessageScript = NULL [static]
 

Definition at line 65 of file agent_script.cpp.

Referenced by initAgentScript().

NLAISCRIPT::CParam * NLAIAGENT::CAgentScript::SendParamMessageScript = NULL [static]
 

Definition at line 64 of file agent_script.cpp.

Referenced by initAgentScript().

CAgentScript::CMethodCall ** NLAIAGENT::CAgentScript::StaticMethod = NULL [static]
 

Reimplemented in NLAIAGENT::CAgentWatchTimer, and NLAIAGENT::CAgentOperation.

Definition at line 69 of file agent_script.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 09:04:44 2004 for NeL by doxygen 1.3.6