From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/a02660.html | 1892 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1892 insertions(+) create mode 100644 docs/doxygen/nel/a02660.html (limited to 'docs/doxygen/nel/a02660.html') diff --git a/docs/doxygen/nel/a02660.html b/docs/doxygen/nel/a02660.html new file mode 100644 index 00000000..44d01632 --- /dev/null +++ b/docs/doxygen/nel/a02660.html @@ -0,0 +1,1892 @@ + + +NeL: NLAIAGENT::CIndexedVarName class Reference + + + +
+

NLAIAGENT::CIndexedVarName Class Reference

#include <agent_string.h> +

+

Inheritance diagram for NLAIAGENT::CIndexedVarName: +

+ +NLAIAGENT::IVarName +NLAIC::IBasicInterface +NLAIC::IBasicType +NLAIC::IPointerGestion +NLMISC::IStreamable +NLMISC::IClassable + +

Detailed Description

+This class is an IVarName concret class. Its share string in a static map, when we constuct a new instance if string is not stored in the std::map then its add in it else it references it from string stored in th std::map.

+

Author:
Chafik sameh

+Nevrax France

+
Date:
2000
+ +

+ +

+Definition at line 261 of file agent_string.h. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

const char * addString (const IVarName &s) const
 Adding two string.

 CIndexedVarName (NLMISC::IStream &is)
 CIndexedVarName (const CIndexedVarName &name)
 CIndexedVarName (const char *name)
const NLAIC::IBasicTypeclone () const
sint32 decRef ()
 Decrement the reference of an object.

void getDebugString (std::string &text) const
const sint32getIndex () const
virtual const std::string getInfo ()
const sint32getRef () const
 get the refence count.

const char * getString () const
 Get the string stored in the instance.

const NLAIC::CIdentTypegetType () const
void incRef ()
 Inc a reference. We use this when we have to conserve a pointer memeory for exemple in a list.

void load (NLMISC::IStream &is)
sint32 newIndex ()
const NLAIC::IBasicTypenewInstance () const
IVarNameoperator+= (const IVarName &s)
IVarNameoperator-= (const IVarName &s)
IVarNameoperator= (const IVarName &v)
virtual void release ()
 Release allow to release the pointer. The last release when the _Ref is nul delete the object.

void save (NLMISC::IStream &os)
virtual void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
const char * subString (const IVarName &s) const
 Extract an string from an ather.

virtual ~CIndexedVarName ()

Static Public Member Functions

void initClass ()
void loadClass (NLMISC::IStream &is)
void releaseClass ()
void saveClass (NLMISC::IStream &is)

Static Public Attributes

const NLAIC::CIdentType IdIndexedVarName

Private Types

typedef std::map< CStringVarName,
+CNameStruc * > 
TMapName
 Definition of the static std::map.


Private Member Functions

void clear ()
 Clear string from map.

void insert (const CStringVarName &name)
 Insert new string.


Private Attributes

sint32 _Index
 the index of the declared string in the table.


Static Private Attributes

const sint32 _Bank = 256
sint32 _Count = 0
 Number of string allocated. This is the table size.

std::list< CNameStruc * > * _Empty = new std::list<CIndexedVarName::CNameStruc *>
TMapName_Map = new CIndexedVarName::TMapName
 Static std::map for storing string.

CNameStruc_TableName = NULL
 Table of string, this the contents of the map.

+


Member Typedef Documentation

+

+ + + + +
+ + +
typedef std::map<CStringVarName ,CNameStruc *> NLAIAGENT::CIndexedVarName::TMapName [private] +
+
+ + + + + +
+   + + +

+Definition of the static std::map. +

+ +

+Definition at line 310 of file agent_string.h. +

+Referenced by initClass().

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + + +
NLAIAGENT::CIndexedVarName::CIndexedVarName const char *  name  ) 
+
+ + + + + +
+   + + +

+ +

+Definition at line 152 of file agent_string.cpp. +

+References insert(). +

+Referenced by clone(), and newInstance(). +

+

00153         {
+00154                 insert(CStringVarName(name));
+00155         }       
+
+

+ + + + +
+ + + + + + + + + + +
NLAIAGENT::CIndexedVarName::CIndexedVarName const CIndexedVarName name  ) 
+
+ + + + + +
+   + + +

+ +

+Definition at line 157 of file agent_string.cpp. +

+References _Index, _TableName, and getIndex(). +

+

00158         {               
+00159                 TMapName::iterator i = _Map->find(*_TableName[name.getIndex()].Name);           
+00160                 if(i != _Map->end())
+00161                 {
+00162                         _Index = name.getIndex();
+00163                         (*i).second->Count ++;
+00164                 }
+00165                 else
+00166                 {
+00167                         _Index = -1;
+00168                         throw NLAIE::CExceptionIndexError();
+00169                 }
+00170                 
+00171         }
+
+

+ + + + +
+ + + + + + + + + + +
NLAIAGENT::CIndexedVarName::CIndexedVarName NLMISC::IStream is  ) 
+
+ + + + + +
+   + + +

+ +

+Definition at line 173 of file agent_string.cpp. +

+References insert(). +

+

00174         {
+00175                 CStringVarName str(is);
+00176                 insert(str);            
+00177         }
+
+

+ + + + +
+ + + + + + + + + +
NLAIAGENT::CIndexedVarName::~CIndexedVarName  )  [virtual]
+
+ + + + + +
+   + + +

+ +

+Definition at line 179 of file agent_string.cpp. +

+References clear(). +

+

00180         {               
+00181                 clear();
+00182         }
+
+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
const char* NLAIAGENT::IVarName::addString const IVarName s  )  const [inline, inherited]
+
+ + + + + +
+   + + +

+Adding two string. +

+ +

+Definition at line 80 of file agent_string.h. +

+References NLAIAGENT::IVarName::getString(), and s. +

+Referenced by NLAIAGENT::CStringVarName::operator+=(), and operator+=(). +

+

00081                 {
+00082                         char *nameTmp,*str = (char *)s.getString();             
+00083                         nameTmp = (char *)getString();  
+00084                         char *name = new char [strlen(str) + strlen(nameTmp) + 2];
+00085                         sprintf(name,"%s%s",nameTmp,str);                       
+00086                         return name;
+00087                 }
+
+

+ + + + +
+ + + + + + + + + +
void NLAIAGENT::CIndexedVarName::clear  )  [private]
+
+ + + + + +
+   + + +

+Clear string from map. +

+ +

+Definition at line 190 of file agent_string.cpp. +

+References _Index, _TableName, NLAIAGENT::CIndexedVarName::CNameStruc::Count, and NLAIAGENT::CIndexedVarName::CNameStruc::Name. +

+Referenced by load(), and ~CIndexedVarName(). +

+

00191         {               
+00192                 if(_TableName && !(--_TableName[_Index].Count) )
+00193                 {
+00194                         TMapName::iterator i = _Map->find(*_TableName[_Index].Name);
+00195                         if(i != _Map->end()) 
+00196                         {
+00197                                 _Map->erase(i);
+00198                                 delete _TableName[_Index].Name;
+00199                                 _TableName[_Index].Name = NULL;
+00200                                 _Empty->push_back(&_TableName[_Index]);
+00201                         }
+00202                 }
+00203         }
+
+

+ + + + +
+ + + + + + + + + +
const NLAIC::IBasicType * NLAIAGENT::CIndexedVarName::clone  )  const [virtual]
+
+ + + + + +
+   + + +

+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 280 of file agent_string.cpp. +

+References CIndexedVarName(), and x. +

+

00281         {
+00282                 NLAIC::IBasicInterface *x = new CIndexedVarName(*this);
+00283                 return x;
+00284         }
+
+

+ + + + +
+ + + + + + + + + +
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::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                 }
+
+

+ + + + +
+ + + + + + + + + + +
void NLAIAGENT::CIndexedVarName::getDebugString std::string &  text  )  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. +

+Implements NLAIC::IBasicType. +

+Definition at line 292 of file agent_string.cpp. +

+

00293         {
+00294                 
+00295         }
+
+

+ + + + +
+ + + + + + + + + +
const sint32& NLAIAGENT::CIndexedVarName::getIndex  )  const [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 347 of file agent_string.h. +

+References _Index, and sint32. +

+Referenced by CIndexedVarName(), and save(). +

+

00348                 {
+00349                         return _Index;
+00350                 }
+
+

+ + + + +
+ + + + + + + + + +
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                 }
+
+

+ + + + +
+ + + + + + + + + +
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 char * NLAIAGENT::CIndexedVarName::getString  )  const [virtual]
+
+ + + + + +
+   + + +

+Get the string stored in the instance. +

+ +

+Implements NLAIAGENT::IVarName. +

+Definition at line 297 of file agent_string.cpp. +

+References _Index, and _TableName. +

+

00298         {
+00299                 return (*(_TableName + _Index)).Name->getString();
+00300                 //return _TableName[_Index].Name->getString();
+00301         }       
+
+

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

+Implements NLAIC::IBasicType. +

+Definition at line 33 of file agent_string.cpp. +

+References IdIndexedVarName. +

+

00034         {
+00035                 
+00036                 return IdIndexedVarName;
+00037         }
+
+

+ + + + +
+ + + + + + + + + +
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(), NLAIAGENT::CAgentScript::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(), NLAIAGENT::CAgentScript::processMessages(), NLAISCRIPT::CCompilateur::pushParamExpression(), NLAISCRIPT::CConstraintFindRun::run(), NLAIAGENT::IBasicAgent::run(), NLAIAGENT::CAgentScript::runAskGetValue(), NLAIAGENT::IAgent::runChildren(), NLAIAGENT::CMainAgentScript::runExec(), NLAIAGENT::CAgentScript::runInitComponent(), NLAIAGENT::CAgentOperation::runMethodBase(), NLAIAGENT::CAgentWatchTimer::runMethodBase(), NLAIAGENT::CAgentScript::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(), NLAIAGENT::CAgentScript::runTellComponent(), NLAIAGENT::CAgentScript::runTellSetValue(), NLAISCRIPT::CMethodContextDebug::saveContext(), NLAISCRIPT::CMethodContext::saveContext(), NLAIAGENT::CAgentScript::sendBroadCast(), NLAIAGENT::IListManager::sendMessage(), NLAIAGENT::CAgentScript::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::CIndexedVarName::initClass  )  [static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 39 of file agent_string.cpp. +

+References _Count, _TableName, NLAIAGENT::CIndexedVarName::CNameStruc::Count, NLAIAGENT::CIndexedVarName::CNameStruc::Index, NLAIAGENT::CIndexedVarName::CNameStruc::Name, sint32, and TMapName. +

+

00040         {
+00041                 if(_Empty == NULL) 
+00042                 {
+00043                         _Empty = new std::list<CIndexedVarName::CNameStruc *>;
+00044                         
+00045                 }
+00046 
+00047                 if(_Map == NULL) 
+00048                 {
+00049                         _Map = new CIndexedVarName::TMapName;
+00050                 }
+00051                 
+00052                 if(_TableName != NULL)
+00053                 {
+00054                         _Map->clear();
+00055                         for(sint32 i =0; i < _Count; i++)
+00056                         {
+00057                                 if(_TableName[i].Name != NULL) delete _TableName[i].Name;
+00058                         }
+00059                         delete [] _TableName;
+00060                 }
+00061                 _TableName = new CNameStruc [_Bank];
+00062                 _Count = _Bank;
+00063                 
+00064                 for(sint32 i = 0; i < _Count; i++)
+00065                 {
+00066                         _TableName[i].Name = NULL;
+00067                         _TableName[i].Count = 0;
+00068                         _TableName[i].Index = i;
+00069                         _Empty->push_back(&_TableName[i]);
+00070                 }
+00071                 
+00072         }
+
+

+ + + + +
+ + + + + + + + + + +
void NLAIAGENT::CIndexedVarName::insert const CStringVarName name  )  [private]
+
+ + + + + +
+   + + +

+Insert new string. +

+ +

+Definition at line 206 of file agent_string.cpp. +

+References _Index, _TableName, NLAIAGENT::CStringVarName::clone(), NLAIAGENT::CIndexedVarName::CNameStruc::Name, and newIndex(). +

+Referenced by CIndexedVarName(), load(), operator+=(), operator-=(), and operator=(). +

+

00207         {               
+00208                 TMapName::iterator i = _Map->find(str);         
+00209                 if(i != _Map->end())
+00210                 {
+00211                         _Index = (*i).second->Index;
+00212                         (*i).second->Count ++;
+00213                 }
+00214                 else 
+00215                 {
+00216                         _Index = newIndex();
+00217                         _TableName[_Index].Name = (CStringVarName *)str.clone();
+00218                         _Map->insert(TMapName::value_type(*_TableName[_Index].Name, &_TableName[_Index]));
+00219                 }
+00220         }
+
+

+ + + + +
+ + + + + + + + + + +
void NLAIAGENT::CIndexedVarName::load NLMISC::IStream is  )  [virtual]
+
+ + + + + +
+   + + +

+Load the class from a stream. +

+Implements NLAIC::IBasicInterface. +

+Definition at line 273 of file agent_string.cpp. +

+References clear(), and insert(). +

+

00274         {
+00275                 clear();
+00276                 CStringVarName str(is);
+00277                 insert(str);
+00278         }
+
+

+ + + + +
+ + + + + + + + + + +
void NLAIAGENT::CIndexedVarName::loadClass NLMISC::IStream is  )  [static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 95 of file agent_string.cpp. +

+References _Count, _TableName, NLAIAGENT::CIndexedVarName::CNameStruc::Count, NLAIAGENT::CIndexedVarName::CNameStruc::Index, NLAIAGENT::CIndexedVarName::CNameStruc::load(), NLAIAGENT::CIndexedVarName::CNameStruc::Name, releaseClass(), NLMISC::IStream::serial(), and sint32. +

+

00096         {
+00097                 sint32 i;
+00098                 is.serial( i );
+00099                 if(i != 0)
+00100                 {                       
+00101                         releaseClass();
+00102                         _TableName = new CNameStruc [i];
+00103                         _Count = i;
+00104                         sint32 k;
+00105                         for(i = 0;i < _Count;i ++)
+00106                         {
+00107                                 is.serial( k );
+00108                                 if(k)
+00109                                 {                                                                       
+00110                                         _TableName[i].load(is);
+00111                                         _Map->insert(TMapName::value_type(*_TableName[i].Name, &_TableName[i]));
+00112                                 }
+00113                                 else
+00114                                 {
+00115                                         _TableName[i].Count = 0;
+00116                                         _TableName[i].Index = i;
+00117                                         _TableName[i].Name = NULL;
+00118                                         _Empty->push_back(&_TableName[i]);
+00119                                 }
+00120                         }
+00121                 }
+00122 
+00123         }
+
+

+ + + + +
+ + + + + + + + + +
sint32 NLAIAGENT::CIndexedVarName::newIndex  ) 
+
+ + + + + +
+   + + +

+ +

+Definition at line 239 of file agent_string.cpp. +

+References _Count, _TableName, NLAIAGENT::CIndexedVarName::CNameStruc::Count, NLAIAGENT::CIndexedVarName::CNameStruc::Index, NLAIAGENT::CIndexedVarName::CNameStruc::Name, and sint32. +

+Referenced by insert(). +

+

00240         {
+00241 
+00242                 if(_Empty->size())
+00243                 {
+00244                         CNameStruc *o = _Empty->front();
+00245                         _Empty->pop_front();
+00246                         o->Count++;
+00247                         return o->Index;
+00248                 }
+00249                 else
+00250                 {
+00251                         CNameStruc *tmp = _TableName;
+00252                         _TableName = new CNameStruc [_Count + _Bank];
+00253                         
+00254                         for(sint32 i = _Count; i < (_Count + _Bank); i++)
+00255                         {
+00256                                 _TableName[i].Count = 0;
+00257                                 _TableName[i].Index = i;
+00258                                 _TableName[i].Name = NULL;
+00259                                 _Empty->push_back(&_TableName[i]);
+00260                         }
+00261                         
+00262                         memcpy(_TableName, tmp, _Count*sizeof(CNameStruc));
+00263                         _Count += _Bank;
+00264                         return newIndex();
+00265                 }
+00266         }
+
+

+ + + + +
+ + + + + + + + + +
const NLAIC::IBasicType * NLAIAGENT::CIndexedVarName::newInstance  )  const [virtual]
+
+ + + + + +
+   + + +

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

+Implements NLAIC::IBasicType. +

+Definition at line 286 of file agent_string.cpp. +

+References CIndexedVarName(), and x. +

+

00287         {
+00288                 NLAIC::IBasicInterface *x = new CIndexedVarName("Inst");
+00289                 return x;
+00290         }
+
+

+ + + + +
+ + + + + + + + + + +
IVarName & NLAIAGENT::CIndexedVarName::operator+= const IVarName s  )  [virtual]
+
+ + + + + +
+   + + +

+ +

+Implements NLAIAGENT::IVarName. +

+Definition at line 224 of file agent_string.cpp. +

+References NLAIAGENT::IVarName::addString(), insert(), and s. +

+

00225         {
+00226                 char *n = (char *)addString(s);
+00227                 insert(n);
+00228                 return *this;
+00229         }
+
+

+ + + + +
+ + + + + + + + + + +
IVarName & NLAIAGENT::CIndexedVarName::operator-= const IVarName s  )  [virtual]
+
+ + + + + +
+   + + +

+ +

+Implements NLAIAGENT::IVarName. +

+Definition at line 231 of file agent_string.cpp. +

+References insert(), s, and NLAIAGENT::IVarName::subString(). +

+

00232         {                       
+00233                 char *n = (char *)subString(s);
+00234                 if(n != NULL) insert(n);
+00235                 return *this;
+00236         }
+
+

+ + + + +
+ + + + + + + + + + +
bool NLAIAGENT::IVarName::operator< const IVarName v  )  const [inline, inherited]
+
+ + + + + +
+   + + +

+ +

+Definition at line 52 of file agent_string.h. +

+References NLAIAGENT::IVarName::getString(), and v. +

+

00053                 {                       
+00054                         const char *name1 = getString();
+00055                         const char *name2 = v.getString();
+00056                         if(name1[0] < name2[0]) return true;
+00057                         else return strcmp(name1,name2) < 0;                    
+00058                 }
+
+

+ + + + +
+ + + + + + + + + + +
IVarName & NLAIAGENT::CIndexedVarName::operator= const IVarName v  )  [virtual]
+
+ + + + + +
+   + + +

+ +

+Implements NLAIAGENT::IVarName. +

+Definition at line 184 of file agent_string.cpp. +

+References insert(), and s. +

+

00185         {
+00186                 insert(CStringVarName(s.getString()));
+00187                 return *this;
+00188         }
+
+

+ + + + +
+ + + + + + + + + + +
bool NLAIAGENT::IVarName::operator== const IVarName v  )  const [inline, inherited]
+
+ + + + + +
+   + + +

+ +

+Definition at line 69 of file agent_string.h. +

+References NLAIAGENT::IVarName::getString(), and v. +

+

00070                 {
+00071                         const char *name1 = getString();
+00072                         const char *name2 = v.getString();
+00073                         if(name1[0] == name2[0]) return strcmp(name1,name2) == 0;
+00074                         
+00075                         return false;
+00076                 }
+
+

+ + + + +
+ + + + + + + + + + +
bool NLAIAGENT::IVarName::operator> const IVarName v  )  const [inline, inherited]
+
+ + + + + +
+   + + +

+ +

+Definition at line 60 of file agent_string.h. +

+References NLAIAGENT::IVarName::getString(), and v. +

+

00061                 {                       
+00062                         const char *name1 = getString();
+00063                         const char *name2 = v.getString();
+00064                         if(name1[0] > name2[0]) return true;
+00065                         else return strcmp(name1,name2) > 0;
+00066                 }
+
+

+ + + + +
+ + + + + + + + + + +
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(), NLAIAGENT::CAgentScript::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(), NLAIAGENT::CAgentScript::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(), NLAIAGENT::CAgentScript::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(), NLAIAGENT::CAgentScript::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(), NLAIAGENT::CAgentScript::runTellParentNotify(), NLAISCRIPT::CCompilateur::runTypeConstraint(), NLAIAGENT::CHashTimerManager::sendMessage(), NLAIAGENT::CVolatilMemmory::sendMessage(), NLAIAGENT::CLocalMailBox::sendMessage(), NLAIAGENT::IListManager::sendMessage(), NLAIAGENT::CAgentTimerHandle::sendMessage(), NLAIAGENT::CAgentScript::sendMessage(), NLAIAGENT::CAgentScript::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(), NLAIAGENT::CAgentScript::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(), NLAIAGENT::CAgentScript::~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::CIndexedVarName::releaseClass  )  [static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 125 of file agent_string.cpp. +

+References _Count, _TableName, NLAIAGENT::CIndexedVarName::CNameStruc::Name, and sint32. +

+Referenced by loadClass(), and NLAILINK::releaseIALib(). +

+

00126         {
+00127                 return;
+00128 
+00129                 if(_TableName != NULL)
+00130                 {
+00131                         _Map->clear();
+00132                         _Empty->clear();
+00133                         for(sint32 i =0; i < _Count; i++)
+00134                         {
+00135                                 if(_TableName[i].Name != NULL) delete _TableName[i].Name;
+00136                         }
+00137                         delete [] _TableName;
+00138                         _TableName = NULL;
+00139                 }
+00140                 if(_Empty != NULL) 
+00141                 {
+00142                         delete _Empty;
+00143                         _Empty = NULL;
+00144                 }
+00145                 if(_Map != NULL) 
+00146                 {
+00147                         delete _Map;
+00148                         _Map = NULL;
+00149                 }
+00150         }       
+
+

+ + + + +
+ + + + + + + + + + +
void NLAIAGENT::CIndexedVarName::save NLMISC::IStream os  )  [virtual]
+
+ + + + + +
+   + + +

+Save the class in a stream. +

+Implements NLAIC::IBasicInterface. +

+Definition at line 268 of file agent_string.cpp. +

+References _TableName, getIndex(), and NLMISC::IStream::serial(). +

+

00269         {
+00270                 os.serial( *_TableName[getIndex()].Name );
+00271         }
+
+

+ + + + +
+ + + + + + + + + + +
void NLAIAGENT::CIndexedVarName::saveClass NLMISC::IStream is  )  [static]
+
+ + + + + +
+   + + +

+ +

+Definition at line 74 of file agent_string.cpp. +

+References _Count, _TableName, count, NLAIAGENT::CIndexedVarName::CNameStruc::Name, s, NLAIAGENT::CIndexedVarName::CNameStruc::save(), NLMISC::IStream::serial(), and sint32. +

+

00075         {
+00076                 sint32 count = (sint32) _Count;
+00077                 os.serial( count );
+00078                 for(sint32 i = 0; i < count; i++)
+00079                 {
+00080                         if(_TableName[i].Name != NULL)
+00081                         {
+00082                                 sint32 s = 1;
+00083                                 os.serial(  s  );
+00084                                 _TableName[i].save(os);
+00085                         }
+00086                         else 
+00087                         {
+00088                                 sint32 s = 0;
+00089                                 os.serial(  s  );
+00090                         }
+00091                 }
+00092 
+00093         }
+
+

+ + + + +
+ + + + + + + + + + +
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                 }
+
+

+ + + + +
+ + + + + + + + + + +
const char* NLAIAGENT::IVarName::subString const IVarName s  )  const [inline, inherited]
+
+ + + + + +
+   + + +

+Extract an string from an ather. +

+ +

+Definition at line 90 of file agent_string.h. +

+References NLAIAGENT::IVarName::getString(), s, and sint32. +

+Referenced by NLAIAGENT::CStringVarName::operator-=(), and operator-=(). +

+

00091                 {
+00092                         char *nameTmp,*str = (char *)s.getString();             
+00093                         nameTmp = (char *)getString();  
+00094 
+00095                         sint32 k = strlen(nameTmp);
+00096 
+00097                         for(sint32 i = 0; i < k; i ++)
+00098                         {
+00099                                 if(!strcmp(&nameTmp[i],str))
+00100                                 {
+00101                                         sint32 l,n = strlen(str);
+00102                                         char *name = new char [(l = (k - n + 1))];
+00103                                         memcpy(name,nameTmp,i);
+00104                                         memcpy(&name[i],nameTmp + n,l);
+00105                                         return name;
+00106                                 }
+00107                         }
+00108                         return NULL;
+00109                 }
+
+


Field Documentation

+

+ + + + +
+ + +
const sint32 CIndexedVarName::_Bank = 256 [static, private] +
+
+ + + + + +
+   + + +

+Actual nomber of allocation resolution in the Table. Note that when we superseded table resolution we realloc a new table with the old size add by _Bank. +

+Definition at line 57 of file static_def_init.cpp.

+

+ + + + +
+ + +
sint32 CIndexedVarName::_Count = 0 [static, private] +
+
+ + + + + +
+   + + +

+Number of string allocated. This is the table size. +

+ +

+Definition at line 58 of file static_def_init.cpp. +

+Referenced by initClass(), loadClass(), newIndex(), releaseClass(), and saveClass().

+

+ + + + +
+ + +
std::list< CIndexedVarName::CNameStruc * > * CIndexedVarName::_Empty = new std::list<CIndexedVarName::CNameStruc *> [static, private] +
+
+ + + + + +
+   + + +

+Number of cell free in the table, not that this is very usefull because thy prevent us to realloc all time a new table. +

+Definition at line 61 of file static_def_init.cpp.

+

+ + + + +
+ + +
sint32 NLAIAGENT::CIndexedVarName::_Index [private] +
+
+ + + + + +
+   + + +

+the index of the declared string in the table. +

+ +

+Definition at line 333 of file agent_string.h. +

+Referenced by CIndexedVarName(), clear(), getIndex(), getString(), and insert().

+

+ + + + +
+ + +
CIndexedVarName::TMapName * CIndexedVarName::_Map = new CIndexedVarName::TMapName [static, private] +
+
+ + + + + +
+   + + +

+Static std::map for storing string. +

+ +

+Definition at line 60 of file static_def_init.cpp.

+

+ + + + +
+ + +
CIndexedVarName::CNameStruc * CIndexedVarName::_TableName = NULL [static, private] +
+
+ + + + + +
+   + + +

+Table of string, this the contents of the map. +

+ +

+Definition at line 56 of file static_def_init.cpp. +

+Referenced by CIndexedVarName(), clear(), getString(), initClass(), insert(), loadClass(), newIndex(), releaseClass(), save(), and saveClass().

+

+ + + + +
+ + +
const NLAIC::CIdentType CIndexedVarName::IdIndexedVarName [static] +
+
+ + + + + +
+   + + +

+ +

+Referenced by getType().

+


The documentation for this class was generated from the following files: +
Generated on Tue Mar 16 09:16:32 2004 for NeL by + +doxygen +1.3.6
+ + -- cgit v1.2.1