# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLAIAGENT::CIndexedVarName Class Reference

This class is an IVarName concret class. More...

#include <agent_string.h>

Inheritance diagram for NLAIAGENT::CIndexedVarName:

NLAIAGENT::IVarName NLAIC::IBasicInterface NLAIC::IBasicType NLAIC::IPointerGestion NLMISC::IStreamable NLMISC::IClassable List of all members.

Public Methods

 CIndexedVarName (const char *name)
 CIndexedVarName (const CIndexedVarName &name)
 CIndexedVarName (NLMISC::IStream &is)
sint32 newIndex ()
const char * getString () const
 Get the string stored in the instance. More...

const NLAIC::CIdentTypegetType () const
 getType return a unique string how represente the class, it can be the name of the class. More...

const sint32getIndex () const
IVarNameoperator+= (const IVarName &s)
IVarNameoperator-= (const IVarName &s)
IVarNameoperator= (const IVarName &v)
void save (NLMISC::IStream &os)
 Save the class in a stream. More...

void load (NLMISC::IStream &is)
 Load the class from a stream. More...

const NLAIC::IBasicTypeclone () const
 This function allow a pointer copy, that mean that the new class have the sam attributs caracteristics as the owne. More...

const NLAIC::IBasicTypenewInstance () const
 This function allow a new instance, that mean that the class is a class factory. More...

void getDebugString (std::string &text) const
 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. More...

virtual ~CIndexedVarName ()

Static Public Methods

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

Static Public Attributes

const NLAIC::CIdentType IdIndexedVarName

Private Types

typedef std::map< CStringVarName,
CNameStruc * > 
tMapName
 Definition of the static std::map. More...


Private Methods

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

void clear ()
 Clear string from map. More...


Private Attributes

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


Static Private Attributes

tMapName_Map = new CIndexedVarName::tMapName
 Static std::map for storing string. More...

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

const sint32 _Bank = 256
 Actual nomber of allocation resolution in the Table. More...

sint32 _Count = 0
 Number of string allocated. This is the table size. More...

std::list< CNameStruc * > * _Empty = new std::list<CIndexedVarName::CNameStruc *>
 Number of cell free in the table, not that this is very usefull because thy prevent us to realloc all time a new table. More...


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.


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.


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.

NLAIAGENT::CIndexedVarName::CIndexedVarName const CIndexedVarName &    name
 

Definition at line 157 of file agent_string.cpp.

References _Index, _Map, _TableName, and NLAIAGENT::CIndexedVarName::CNameStruc::Name.

NLAIAGENT::CIndexedVarName::CIndexedVarName NLMISC::IStream   is
 

Definition at line 173 of file agent_string.cpp.

References insert.

NLAIAGENT::CIndexedVarName::~CIndexedVarName   [virtual]
 

Definition at line 179 of file agent_string.cpp.

References clear.


Member Function Documentation

void NLAIAGENT::CIndexedVarName::clear   [private]
 

Clear string from map.

Definition at line 190 of file agent_string.cpp.

References _Empty, _Index, _Map, and _TableName.

Referenced by load, and ~CIndexedVarName.

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.

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.

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

Definition at line 347 of file agent_string.h.

References _Index.

Referenced by save.

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.

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.

void NLAIAGENT::CIndexedVarName::initClass   [static]
 

Definition at line 39 of file agent_string.cpp.

References _Bank, _Count, _Empty, _Map, _TableName, NLAIAGENT::CIndexedVarName::CNameStruc::Count, NLAIAGENT::CIndexedVarName::CNameStruc::Index, and NLAIAGENT::CIndexedVarName::CNameStruc::Name.

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

Insert new string.

Definition at line 206 of file agent_string.cpp.

References _Index, _Map, _TableName, and newIndex.

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

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.

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

Definition at line 95 of file agent_string.cpp.

References _Count, _Empty, _Map, _TableName, NLAIAGENT::CIndexedVarName::CNameStruc::Count, NLAIAGENT::CIndexedVarName::CNameStruc::Index, NLAIAGENT::CIndexedVarName::CNameStruc::load, NLAIAGENT::CIndexedVarName::CNameStruc::Name, releaseClass, and NLMISC::IStream::serial.

sint32 NLAIAGENT::CIndexedVarName::newIndex  
 

Definition at line 239 of file agent_string.cpp.

References _Bank, _Count, _Empty, _TableName, NLAIAGENT::CIndexedVarName::CNameStruc::Count, NLAIAGENT::CIndexedVarName::CNameStruc::Index, and NLAIAGENT::CIndexedVarName::CNameStruc::Name.

Referenced by insert.

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.

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.

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.

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

Implements NLAIAGENT::IVarName.

Definition at line 184 of file agent_string.cpp.

References insert, and s.

void NLAIAGENT::CIndexedVarName::releaseClass   [static]
 

Definition at line 125 of file agent_string.cpp.

References _Count, _Empty, _Map, _TableName, and NLAIAGENT::CIndexedVarName::CNameStruc::Name.

Referenced by loadClass.

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.

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

Definition at line 74 of file agent_string.cpp.

References _Count, _TableName, NLAIAGENT::CIndexedVarName::CNameStruc::Name, s, NLAIAGENT::CIndexedVarName::CNameStruc::save, and NLMISC::IStream::serial.


Member Data 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 53 of file static_def_init.cpp.

Referenced by initClass, and newIndex.

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

Number of string allocated. This is the table size.

Definition at line 54 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 57 of file static_def_init.cpp.

Referenced by clear, initClass, loadClass, newIndex, and releaseClass.

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 56 of file static_def_init.cpp.

Referenced by CIndexedVarName, clear, initClass, insert, loadClass, and releaseClass.

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

Table of string, this the contents of the map.

Definition at line 52 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: