#include <mailbox.h>
Inheritance diagram for NLAIAGENT::CLocalMailBox:
Public Types | |
typedef std::list< IMailBox * > | TListMailBox |
typedef std::list< IMailBox * >::const_iterator | TListMailBoxCstIter |
typedef std::list< IMailBox * >::iterator | TListMailBoxIter |
Type deffinition for list aned iterator for connectong mailbox container. | |
typedef std::list< const IMessageBase * > | TListMessage |
typedef std::list< const IMessageBase * >::const_iterator | TListMessageCstIter |
typedef std::list< const IMessageBase * >::iterator | TListMessageIter |
Type deffinition for list and iterator for message container. | |
Public Member Functions | |
virtual void | addMailBox (IMailBox *mail) |
Add a new mail box to this mail, all message hapend here will be acheived to the mail box connected. | |
virtual void | addMessage (IMessageBase *msg) |
Add a agent message to the buffer. | |
virtual TQueue | canProcessMessage (const IVarName &) |
CLocalMailBox (const CLocalMailBox &A) | |
CLocalMailBox (NLMISC::IStream &is) | |
CLocalMailBox (const IWordNumRef *parent) | |
virtual const NLAIC::IBasicType * | clone () const |
void | connect (IConnectIA *b) |
sint32 | decRef () |
Decrement the reference of an object. | |
virtual void | getDebugString (std::string &t) const |
virtual const CIdent | getIdentType () const |
virtual const std::string | getInfo () |
virtual const IMessageBase & | getMessage () |
Get the first message from the buffer. | |
virtual sint32 | getMessageCount () const |
get message count. | |
virtual const TListMessage & | getMesseageListe () const |
virtual std::string | getMethodeMemberDebugString (sint32, sint32) const |
virtual sint32 | getMethodIndexSize () const |
virtual const IRefrence * | getOwner () const |
To get the top level parent of this agent. | |
IConnectIA * | getParent () const |
to get the agent parents | |
const sint32 & | getRef () const |
get the refence count. | |
virtual const CProcessResult & | getState () const |
const IObjectIA * | getStaticMember (const IVarName &compName) const |
virtual const IObjectIA * | getStaticMember (sint32) const |
virtual sint32 | getStaticMemberIndex (const IVarName &) const |
virtual sint32 | getStaticMemberSize () const |
virtual const NLAIC::CIdentType & | getType () const |
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 sint32 | isClassInheritedFrom (const IVarName &) const |
virtual bool | isEmpty () const |
test if buffer is empty. | |
virtual bool | isEqual (const IBasicObjectIA &a) 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 TQueue | isMember (const IVarName *, const IVarName *, const IObjectIA &) const |
virtual void | Kill () |
this method define wat agent have to whene he die. | |
virtual void | load (NLMISC::IStream &is) |
virtual const NLAIC::IBasicType * | newInstance () const |
virtual void | onKill (IConnectIA *a) |
When agent die and when he is in the Connectioned lis, he call this method to inform this state to the objects. | |
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 | popMessage () |
Pop the first message from the buffer. | |
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 void | removeMailBox (IMailBox *mail) |
Remove a mail box. | |
virtual const IObjectIA::CProcessResult & | run () |
virtual CProcessResult | runMethodeMember (sint32 index, IObjectIA *) |
virtual CProcessResult | runMethodeMember (sint32, sint32, IObjectIA *) |
virtual const CProcessResult & | runStep () |
virtual void | save (NLMISC::IStream &os) |
virtual CProcessResult | sendMessage (const IVarName &, IObjectIA *) |
virtual IObjectIA::CProcessResult | sendMessage (IObjectIA *m) |
virtual IObjectIA::CProcessResult | sendMessage (IMessageBase *) |
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 state, IObjectIA *result) |
virtual bool | setStaticMember (sint32, IObjectIA *) |
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 sint | size () const |
virtual | ~CLocalMailBox () |
Static Public Attributes | |
const NLAIC::CIdentType | IdLocalMailBox |
TProcessStatement | ProcessBuzzy = processBuzzy |
TProcessStatement | ProcessEnd = processEnd |
TProcessStatement | ProcessError = processError |
TProcessStatement | ProcessIdle = processIdle |
TProcessStatement | ProcessLocked = processLocked |
CProcessResult | ProcessNotComplit = IObjectIA::CProcessResult(processNotComplete) |
CProcessResult | ProcessRun = IObjectIA::CProcessResult() |
Protected Member Functions | |
void | connectLoadStream (NLMISC::IStream &is) |
void | refLoadStream (NLMISC::IStream &is) |
the loader of the class. | |
void | setNumRef (const IWordNumRef &ref) |
Protected Attributes | |
TListIBasic | _Connected |
TListIBasic | _Connection |
Private Attributes | |
TListMailBox | _ListMailBox |
List of mailboxs connected. | |
TListMessage | _ListMessageIn |
List of reciption messages. | |
IObjectIA::CProcessResult | _RunState |
Statue of run. | |
sint | _Size |
Count of messages. |
|
|
|
Definition at line 101 of file mailbox.h. Referenced by save(). |
|
Type deffinition for list aned iterator for connectong mailbox container.
|
|
|
|
|
|
Type deffinition for list and iterator for message container.
|
|
Definition at line 46 of file mailbox.cpp. Referenced by clone(), and newInstance().
|
|
Definition at line 50 of file mailbox.cpp. References load().
|
|
Definition at line 56 of file mailbox.cpp.
|
|
Definition at line 60 of file mailbox.cpp. References _ListMessageIn, and NLAIC::IPointerGestion::release().
00061 { 00062 while(_ListMessageIn.begin() != _ListMessageIn.end()) 00063 { 00064 IMessageBase *msg = (IMessageBase *)_ListMessageIn.back(); 00065 msg->release(); 00066 _ListMessageIn.pop_back(); 00067 } 00068 00069 } |
|
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 } |
|
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 } |
|
Add a new mail box to this mail, all message hapend here will be acheived to the mail box connected.
Implements NLAIAGENT::IMailBox. Definition at line 106 of file mailbox.cpp. References _ListMailBox, and NLAIAGENT::IConnectIA::connect().
00107 { 00108 connect( mail ); 00109 _ListMailBox.push_back((IMailBox *)mail); 00110 00111 } |
|
Add a agent message to the buffer.
Implements NLAIAGENT::IMailBox. Definition at line 99 of file mailbox.cpp. References _ListMessageIn.
00100 { 00101 _ListMessageIn.push_front(msg); 00102 _Size ++; 00103 } |
|
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 } |
|
This function allow a pointer copy, that mean that the new class have the sam attributs caracteristics as the owne. Implements NLAIC::IBasicType. Definition at line 122 of file mailbox.cpp. References CLocalMailBox().
00123 { 00124 NLAIC::IBasicType *a = new CLocalMailBox(*this); 00125 return a; 00126 } |
|
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(), addMailBox(), NLAIAGENT::CAgentWatchTimer::CAgentWatchTimer(), NLAIAGENT::CLocalAgentMail::CLocalAgentMail(), NLAIAGENT::CAgentOperation::connectOnChange(), and NLAIAGENT::IConnectIA::setParent().
00556 { 00557 b->addInConnectedList(this); 00558 addInConnectionList(b); 00559 } |
|
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 } |
|
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 }
|
|
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 } |
|
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. Implements NLAIC::IBasicType. Definition at line 231 of file mailbox.cpp. References t.
00232 { 00233 t += "class CLocalMailBox parent"; 00234 00235 } |
|
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 }
|
|
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 } |
|
Get the first message from the buffer.
Implements NLAIAGENT::IMailBox. Definition at line 71 of file mailbox.cpp. References _ListMessageIn.
00072 { 00073 return *_ListMessageIn.back(); 00074 } |
|
get message count.
Implements NLAIAGENT::IMailBox. Definition at line 83 of file mailbox.cpp. References sint32.
00084 { 00085 return _Size; 00086 } |
|
Implements NLAIAGENT::IMailBox. Definition at line 142 of file mailbox.h. References _ListMessageIn.
00143 { 00144 return _ListMessageIn; 00145 } |
|
The methode getMethodeMemberDebugString(sint32 heritance, sint32 index) return a string that define the name and the argument of the method Reimplemented in NLAIAGENT::CAgentScript. Definition at line 311 of file baseai.cpp. References sint32. Referenced by NLAISCRIPT::CCallHeapMethodi::getDebugResult(), NLAISCRIPT::CCallStackMethodi::getDebugResult(), NLAISCRIPT::CCallMethodi::getDebugResult(), NLAISCRIPT::CLibHeapMemberMethod::getDebugResult(), NLAISCRIPT::CLibStackNewMemberMethod::getDebugResult(), NLAISCRIPT::CLibStackMemberMethod::getDebugResult(), NLAISCRIPT::CLibCallMethodi::getDebugResult(), NLAISCRIPT::CLibCallInheritedMethod::getDebugResult(), NLAISCRIPT::CLibCallMethod::getDebugResult(), NLAISCRIPT::CLibMemberMethodi::getDebugResult(), NLAISCRIPT::CLibMemberInheritedMethod::getDebugResult(), and NLAISCRIPT::CLibMemberMethod::getDebugResult().
00312 { 00313 switch(id) 00314 { 00315 case 0: 00316 { 00317 return std::string("IObjectIA::sendMessage(IMessage)"); 00318 } 00319 break; 00320 case 1: 00321 break; 00322 case 2: 00323 return std::string("IObjectIA::run()"); 00324 break; 00325 00326 case 3: 00327 { 00328 return std::string("IObjectIA::getStaticMember(Integer)"); 00329 } 00330 } 00331 return std::string("Mathod_?????(Param_?????)"); 00332 } |
|
getMethodIndexSize define the nomber of method define in the class. Reimplemented in NLAIAGENT::CActor, NLAIAGENT::CActorScript, NLAIAGENT::IBasicAgent, NLAIAGENT::IVector, NLAIAGENT::CLocalAgentMail, NLAIAGENT::INombreDefine, NLAIAGENT::CPairType, NLAIAGENT::IBaseGroupType, NLAIAGENT::CVectorGroupType, NLAIAGENT::IObjetOp, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CLibTimerManager, NLAIAGENT::CAgentWatchTimer, NLAIAGENT::CAgentTimerHandle, NLAILOGIC::CGoalStack, NLAIAGENT::IListBasicManager, NLAIAGENT::CMessageScript, NLAIAGENT::IMessageBase, NLAIAGENT::CAgentOperation, NLAIFUZZY::CFuzzyVar, NLAILOGIC::CFact, NLAIAGENT::CFsmScript, NLAILOGIC::CGoal, NLAILOGIC::CInternalGoal, NLAILOGIC::CGoalPath, NLAILOGIC::CGoalStack, NLAIAGENT::COperatorScript, NLAILOGIC::IBaseVar, NLAISCRIPT::CAgentClass, and NLAISCRIPT::CLibTest. Definition at line 251 of file baseai.cpp. References sint32.
00252 {
00253 return 4;
00254 }
|
|
To get the top level parent of this agent.
Definition at line 402 of file baseai.cpp. References NLAIAGENT::IRefrence::getParent().
|
|
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(), newInstance(), NLAIAGENT::IAgent::newInstance(), NLAIAGENT::CActor::newInstance(), NLAIAGENT::IConnectIA::onKill(), NLAIAGENT::IBasicAgent::runAsk(), NLAIAGENT::CAgentScript::runAskDebugString(), NLAIAGENT::CAgentScript::runAskParentNotify(), NLAIAGENT::CAgentScript::runMethodBase(), NLAIAGENT::CActorScript::runMethodBase(), NLAIAGENT::IBasicAgent::runMethodeMember(), NLAIAGENT::CAgentScript::runTellParentNotify(), NLAIAGENT::IConnectIA::setParent(), and NLAIAGENT::CActorScript::unActivate().
00512 { 00513 return (IConnectIA *)IRefrence::getParent(); 00514 } |
|
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 }
|
|
Implements NLAIAGENT::IConnectIA. Definition at line 215 of file mailbox.cpp. Referenced by run().
00216 { 00217 return _RunState; 00218 } |
|
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 } |
|
|
to get the index of a given components name. Reimplemented in NLAIAGENT::CLocalAgentMail, NLAIAGENT::CAgentScript, and NLAIAGENT::CMessageScript. Definition at line 188 of file baseai.cpp. References sint32. Referenced by NLAISCRIPT::CCompilateur::affectation(), NLAIAGENT::CComponentHandle::getComponent(), NLAIAGENT::IObjectIA::getStaticMember(), NLAIAGENT::CLocalAgentMail::getStaticMemberIndex(), NLAISCRIPT::CCompilateur::getValidateHierarchyBase(), NLAISCRIPT::CCompilateur::isValidateVarName(), NLAISCRIPT::CCodeBrancheRunDebug::printVariable(), NLAISCRIPT::CCompilateur::processingVar(), NLAISCRIPT::CConstraintStackComp::run(), and NLAIAGENT::IObjectIA::setStaticMember().
00189 {
00190 return -1;
00191 }
|
|
Static member is the component that the agent is create and die with. getStaticMemberSize to get the size of the static member components Reimplemented in NLAIAGENT::CLocalAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CMessageScript, NLAISCRIPT::IClassInterpret, and NLAISCRIPT::CAgentClass. Definition at line 180 of file baseai.cpp. References NLAIC::IBasicType::getType(), sint32, and NLAIC::stringGetBuild(). Referenced by NLAIAGENT::CLocalAgentMail::getStaticMemberSize().
00181 { 00182 std::string text; 00183 text = NLAIC::stringGetBuild("sint32 IObjectIA::getStaticMemberSize() note implementaited for the '%s' interface",(const char *)getType()); 00184 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00185 return 0; 00186 } |
|
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). Implements NLAIC::IBasicType. Definition at line 138 of file mailbox.cpp. References IdLocalMailBox.
00139 { 00140 return IdLocalMailBox; 00141 } |
|
|
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 } |
|
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 }
|
|
test if buffer is empty.
Implements NLAIAGENT::IMailBox. Definition at line 88 of file mailbox.cpp.
00089 { 00090 return _Size == 0; 00091 } |
|
The bool operator == (const IBasicObjectIA &a) const member method call this function when class 'classType' have the same type of this class, programme have to assume the equality between the memebers of this class and the memeber of the class 'classType'. Implements NLAIAGENT::IBasicObjectIA. Definition at line 164 of file mailbox.cpp.
|
|
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 } |
|
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 in NLAIAGENT::IBasicAgent, NLAIAGENT::IVector, NLAIAGENT::CLocalAgentMail, NLAIAGENT::INombreDefine, NLAIAGENT::CPairType, NLAIAGENT::IBaseGroupType, NLAIAGENT::CVectorGroupType, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentTimerHandle, NLAIAGENT::IListBasicManager, NLAIAGENT::CMessageScript, and NLAIAGENT::IMessageBase. Definition at line 206 of file baseai.cpp. References _CONSTRUCTOR_, _RUN_, _SEND_, param, r, NLAIAGENT::IObjectIA::run(), and NLAIAGENT::TQueue. Referenced by NLAIAGENT::CAgentWatchTimer::addAttrib(), NLAISCRIPT::CCompilateur::findMethode(), NLAISCRIPT::CAgentClass::isMember(), NLAIAGENT::CLocalAgentMail::isMember(), and NLAISCRIPT::CFindRunMsg::runOpCode().
00207 { 00208 static CStringVarName send(_SEND_); 00209 static CStringVarName constructor(_CONSTRUCTOR_); 00210 static CStringVarName run(_RUN_); 00211 static CStringVarName statM("GetStaticMember"); 00212 00213 if(*methodName == send) 00214 { 00215 TQueue r; 00216 CObjectType *c = new CObjectType(new NLAIC::CIdentType(NLAIC::CIdentType::VoidType)); 00217 r.push(CIdMethod(0,0.0,NULL,c)); 00218 return r; 00219 } 00220 else 00221 if(*methodName == constructor && !((const NLAISCRIPT::CParam &)param).size()) 00222 { 00223 TQueue r; 00224 CObjectType *c = new CObjectType(new NLAIC::CIdentType(NLAIC::CIdentType::VoidType)); 00225 r.push(CIdMethod(1,0.0,NULL,c)); 00226 return r; 00227 } 00228 else 00229 if(*methodName == run && !((const NLAISCRIPT::CParam &)param).size()) 00230 { 00231 TQueue r; 00232 CObjectType *c = new CObjectType(new NLAIC::CIdentType(NLAIC::CIdentType::VoidType)); 00233 r.push(CIdMethod(2,0.0,NULL,c)); 00234 return r; 00235 } 00236 if(*methodName == statM && ((const NLAISCRIPT::CParam &)param).size()) 00237 { 00238 TQueue r; 00239 CObjectType *c = new CObjectType(new NLAIC::CIdentType(*IAgent::IdAgent)); 00240 r.push(CIdMethod(3,0.0,NULL,c)); 00241 return r; 00242 } 00243 return TQueue(); 00244 } |
|
this method define wat agent have to whene he die.
Reimplemented in NLAIAGENT::IAgent. Definition at line 618 of file baseai.cpp. References NLAIAGENT::IConnectIA::_Connected, NLAIAGENT::IConnectIA::_Connection, NLAIAGENT::IConnectIA::getParent(), NLAIAGENT::IConnectIA::onKill(), NLAIAGENT::IConnectIA::removeInConnectedList(), NLAIAGENT::IConnectIA::removeInConnectionList(), and NLAIAGENT::IConnectIA::TListIBasicCstItr. Referenced by NLAIAGENT::IConnectIA::~IConnectIA().
00619 { 00620 IConnectIA *parent = getParent(); 00621 if ( parent != NULL ) 00622 { 00623 parent->onKill( this ); 00624 } 00625 00626 TListIBasicCstItr it = _Connection.begin(); 00627 00628 while(it != _Connection.end()) 00629 { 00630 IConnectIA *a = (IConnectIA *)*it ++; 00631 if(a != NULL) 00632 { 00633 a->removeInConnectedList(this); 00634 } 00635 } 00636 _Connection.clear(); 00637 00638 it = _Connected.begin(); 00639 while(it != _Connected.end()) 00640 { 00641 IConnectIA *a = (IConnectIA *)*it ++; 00642 if(a != NULL) 00643 { 00644 a->removeInConnectionList(this); 00645 a->onKill(this); 00646 } 00647 } 00648 _Connected.clear(); 00649 } |
|
Load the class from a stream. Implements NLAIAGENT::IMailBox. Definition at line 194 of file mailbox.cpp. References _ListMailBox, num, NLMISC::IStream::serial(), and sint32. Referenced by CLocalMailBox().
00195 { 00196 IMailBox::load(is); 00197 sint32 i; 00198 NLAIC::CIdentTypeAlloc id; 00199 is.serial(i); 00200 _Size = 0; 00201 if(i) 00202 { 00203 while(i --) 00204 { 00205 is.serial(id); 00206 IWordNumRef *num = (IWordNumRef *)id.allocClass(); 00207 num->load(is); 00208 _ListMailBox.push_back((IMailBox *)((const IRefrence *)*num)); 00209 _Size ++; 00210 delete num; 00211 } 00212 } 00213 } |
|
This function allow a new instance, that mean that the class is a class factory. Implements NLAIC::IBasicType. Definition at line 128 of file mailbox.cpp. References CLocalMailBox(), and NLAIAGENT::IConnectIA::getParent().
00129 { 00130 NLAIC::IBasicType *a; 00131 if(getParent() != NULL) 00132 a = new CLocalMailBox((const IWordNumRef *)getParent()); 00133 else 00134 a = new CLocalMailBox((const IWordNumRef *)NULL); 00135 return a; 00136 } |
|
When agent die and when he is in the Connectioned lis, he call this method to inform this state to the objects.
Reimplemented from NLAIAGENT::IConnectIA. Definition at line 143 of file mailbox.cpp. References _ListMailBox, _ListMessageIn, NLAIAGENT::IMessageBase::getContinuation(), NLAIAGENT::IMessageBase::getReceiver(), NLAIAGENT::IMessageBase::getSender(), NLAIC::IPointerGestion::release(), and TListMessageIter.
00144 { 00145 eraseFromList<IMailBox *>(&_ListMailBox,(IMailBox *)a); 00146 00147 TListMessageIter msgItr = _ListMessageIn.begin(); 00148 while(msgItr != _ListMessageIn.end()) 00149 { 00150 IMessageBase *msg = (IMessageBase *)*msgItr; 00151 00152 if(msg->getSender() == a || msg->getContinuation() == a || msg->getReceiver() == a) 00153 { 00154 TListMessageIter iTmp = msgItr++; 00155 _ListMessageIn.erase(iTmp); 00156 msg->release(); 00157 _Size --; 00158 } 00159 else msgItr++; 00160 } 00161 00162 } |
|
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 }
|
|
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 }
|
|
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().
|
|
Pop the first message from the buffer.
Implements NLAIAGENT::IMailBox. Definition at line 76 of file mailbox.cpp. References _ListMessageIn.
00077 { 00078 ((IMessageBase *)_ListMessageIn.back())->release(); 00079 _ListMessageIn.pop_back(); 00080 _Size --; 00081 } |
|
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 } |
|
|
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 removeMailBox().
00562 { 00563 Agent->removeInConnectedList(this); 00564 removeInConnectionList(Agent); 00565 } |
|
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 } |
|
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 } |
|
Remove a mail box.
Implements NLAIAGENT::IMailBox. Definition at line 114 of file mailbox.cpp. References _ListMailBox, and NLAIAGENT::IConnectIA::removeConnection().
00115 { 00116 eraseFromList<IMailBox *>(&_ListMailBox,mail); 00117 removeConnection(mail); 00118 } |
|
Some where Run method define the process of the agen. Implements NLAIAGENT::IObjectIA. Definition at line 226 of file mailbox.cpp. References getState().
00227 { 00228 return getState(); 00229 } |
|
|
|
Some where Run method define the process of the agen. Reimplemented in NLAIAGENT::IAgent, and NLAIAGENT::CAgentScript. Definition at line 163 of file baseai.cpp. References NLAIC::IBasicType::getType(), and NLAIC::stringGetBuild(). Referenced by NLAIAGENT::IAgent::runChildrenStepByStep().
00164 { 00165 std::string text; 00166 text = NLAIC::stringGetBuild("const CProcessResult &IObjectIA::runStep() note implementaited for the '%s' interface",(const char *)getType()); 00167 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00168 return IObjectIA::ProcessNotComplit; 00169 } |
|
programmer have to call this method to load or save internal attribut. Implements NLAIAGENT::IMailBox. Definition at line 170 of file mailbox.cpp. References _ListMailBox, _ListMessageIn, NLAIC::IBasicType::getType(), NLAIAGENT::IMessageBase::save(), NLMISC::IStream::serial(), sint32, size, TListMailBoxCstIter, and TListMessageIter.
00171 { 00172 IMailBox::save(os); 00173 sint32 size = _ListMailBox.size(); 00174 os.serial( size ); 00175 TListMailBoxCstIter k = _ListMailBox.begin(); 00176 while(k != _ListMailBox.end()) 00177 { 00178 IMailBox *mail = *k++; 00179 ((IWordNumRef *)(const NLAIAGENT::IWordNumRef *)*mail)->save(os); 00180 } 00181 00182 size = _ListMessageIn.size(); 00183 os.serial( size ); 00184 TListMessageIter msgItr = _ListMessageIn.begin(); 00185 while(msgItr != _ListMessageIn.end()) 00186 { 00187 IMessageBase *msg = (IMessageBase *)*msgItr++; 00188 os.serial( (NLAIC::CIdentType &) (msg->getType()) ); 00189 msg->save(os); 00190 } 00191 00192 } |
|
This method allow to send a message to an compoment given by an string IVarName. Reimplemented in NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, and NLAIAGENT::IMessageBase. Definition at line 334 of file baseai.cpp. References NLAIAGENT::IVarName::getString(), NLAIC::IBasicType::getType(), and NLAIC::stringGetBuild().
00335 { 00336 std::string text; 00337 text = NLAIC::stringGetBuild("method 'sendMessage(%s,const IObjectIA &)' '%s' interface",name.getString(), (const char *)getType()); 00338 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00339 return CProcessResult(); 00340 } |
|
sendMessage allow agent to send a message to an ather agent. The message is a IMessageBase. Reimplemented from NLAIAGENT::IObjectIA. Reimplemented in NLAIAGENT::CActorScript, NLAIAGENT::CLocalAgentMail, NLAIAGENT::CProxyAgentMail, NLAIAGENT::CAgentScript, and NLAIAGENT::CMainAgentScript. Definition at line 451 of file baseai.h.
00452 { 00453 return sendMessage((IMessageBase *)m); 00454 } |
|
Implements NLAIAGENT::IConnectIA. Definition at line 93 of file mailbox.cpp. References NLAIC::IPointerGestion::release().
00094 {
00095 m->release();
00096 return IObjectIA::ProcessRun;
00097 }
|
|
Reimplemented from NLAIC::IPointerGestion. Definition at line 328 of file abstract_interface.h. References NLAIC::IBasicInterface::load(), and NLAIC::IBasicInterface::save().
|
|
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 } |
|
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 NLAIAGENT::CAgentScript::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 } |
|
Implements NLAIAGENT::IConnectIA. Definition at line 220 of file mailbox.cpp. References NLAIAGENT::IObjectIA::CProcessResult::Result, and NLAIAGENT::IObjectIA::CProcessResult::ResultState.
|
|
to cahnge a given components given by a string. Reimplemented in NLAIAGENT::CLocalAgentMail, NLAIAGENT::CAgentScript, NLAIAGENT::CMessageScript, and NLAISCRIPT::CAgentClass. Definition at line 198 of file baseai.cpp. References NLAIC::IBasicType::getType(), sint32, and NLAIC::stringGetBuild().
00199 { 00200 std::string text; 00201 text = NLAIC::stringGetBuild("Function void IObjectIA::setStaticMember(sint32,IObjectIA *) note implementaited for the '%s' interface",(const char *)getType()); 00202 throw NLAIE::CExceptionNotImplemented(text.c_str()); 00203 return false; 00204 } |
|
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 } |
|
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 } |
|
Definition at line 146 of file mailbox.h. References sint.
00147 { 00148 return _Size; 00149 } |
|
Definition at line 427 of file baseai.h. Referenced by NLAIAGENT::IConnectIA::addInConnectedList(), NLAIAGENT::IConnectIA::Kill(), NLAIAGENT::IConnectIA::removeInConnectedList(), and NLAIAGENT::IConnectIA::save(). |
|
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(). |
|
List of mailboxs connected.
Definition at line 110 of file mailbox.h. Referenced by addMailBox(), load(), onKill(), removeMailBox(), and save(). |
|
List of reciption messages.
Definition at line 108 of file mailbox.h. Referenced by addMessage(), getMessage(), getMesseageListe(), onKill(), popMessage(), save(), and ~CLocalMailBox(). |
|
Statue of run.
|
|
Count of messages.
|
|
Referenced by getType(). |
|
Define the an buzzy state for an agent all time in this state. Definition at line 147 of file baseai.cpp. |
|
Define the an end state for an agent all time in this state. Definition at line 148 of file baseai.cpp. |
|
Define the an error state for an agent all time in this state. Definition at line 149 of file baseai.cpp. |
|
Define the an idle state for an agent all time in this state. Definition at line 145 of file baseai.cpp. |
|
Define the an locked state for an agent all time in this state. Definition at line 146 of file baseai.cpp. |
|
Definition at line 144 of file baseai.cpp. |
|
Definition at line 143 of file baseai.cpp. |