#include <ident.h>
Inheritance diagram for NLAIAGENT::CLocWordNumRef:
This class share agent in a static map.
Nevrax France
Definition at line 476 of file ident.h.
Public Member Functions | |
CLocWordNumRef () | |
CLocWordNumRef (NLMISC::IStream &is) | |
CLocWordNumRef (const CLocWordNumRef &l) | |
CLocWordNumRef (const CNumericIndex &id, IRefrence *ref) | |
CLocWordNumRef (const CNumericIndex &ref) | |
CLocWordNumRef (IRefrence *ref) | |
Construct object for an IRefrence agents objects. | |
sint32 | decRef () |
Decrement the reference of an object. | |
void | getDebugString (std::string &t) const |
virtual const std::string | getInfo () |
virtual const CNumericIndex & | getNumIdent () const |
const sint32 & | getRef () const |
get the refence count. | |
void | incRef () |
Inc a reference. We use this when we have to conserve a pointer memeory for exemple in a list. | |
virtual | operator const IRefrence * () const |
virtual void | release () |
Release allow to release the pointer. The last release when the _Ref is nul delete the object. | |
virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
void | setTypeAt (uint64 t) |
virtual | ~CLocWordNumRef () |
IBasicInterface method. | |
virtual const NLAIC::IBasicType * | clone () const |
virtual const NLAIC::CIdentType & | getType () const |
virtual void | load (NLMISC::IStream &is) |
Exception: throw (NLAIE::CExceptionIndexHandeledError). | |
virtual const NLAIC::IBasicType * | newInstance () const |
virtual void | save (NLMISC::IStream &os) |
Static Public Member Functions | |
Map fonctionality method. | |
void | clear () |
Clear the map. | |
IRefrence * | getRef (const CNumericIndex &) |
Clear the map. | |
void | Init () |
Init the map. | |
bool | loadMapping (NLMISC::IStream &) |
void | saveMapping (ostream &) |
Static Public Attributes | |
const NLAIC::CIdentType * | IdLocWordNumRef = NULL |
The class factory ident of the class. | |
Private Types | |
typedef std::map< CNumericIndex, IRefrence * > | TMapRef |
The map use an CNumericIndex as a key for the internal tree. | |
Private Attributes | |
CNumericIndex | _Id |
The iden of the class. | |
IRefrence * | _Stock |
_Stock define the cross reference between agent and this class. | |
Static Private Attributes | |
NLMISC::CSynchronized< TMapRef > | _LocRefence |
|
The map use an CNumericIndex as a key for the internal tree.
|
|
Construct object for an IRefrence agents objects.
Definition at line 497 of file ident.h. References _LocRefence, and _Stock.
00497 :_Stock(ref) 00498 { 00499 NLMISC::CSynchronized<TMapRef >::CAccessor a(&_LocRefence); 00500 a.value().insert(TMapRef::value_type(_Id,ref)); 00501 } |
|
Construct object with an CNumericIndex objects. This constroctor allow to reload an IRefrence defined with the CNumericIndex &ref. Exception: throw (NLAIE::CExceptionIndexHandeledError) Definition at line 510 of file ident.h. References _LocRefence, and _Stock.
00510 :_Id(ref),_Stock(NULL) 00511 { 00512 NLMISC::CSynchronized<TMapRef >::CAccessor a(&_LocRefence); 00513 TMapRef::iterator Itr = a.value().find(_Id); 00514 if(Itr != a.value().end()) 00515 { 00516 _Stock = (*Itr).second; 00517 } 00518 else throw NLAIE::CExceptionIndexHandeledError(); 00519 } |
|
Definition at line 521 of file ident.h. References _LocRefence, _Stock, and id.
00521 :_Id(id),_Stock(ref) 00522 { 00523 NLMISC::CSynchronized<TMapRef >::CAccessor a(&_LocRefence); 00524 TMapRef::iterator itr = a.value().find(_Id); 00525 if(itr != a.value().end()) 00526 { 00527 if((*itr).second != _Stock) 00528 { 00529 return; 00530 } 00531 else 00532 { 00533 throw NLAIE::CExceptionIndexHandeledError(); 00534 } 00535 a.value().erase(itr); 00536 } 00537 a.value().insert(TMapRef::value_type(_Id,_Stock)); 00538 } |
|
Copy Constructor. Exception: throw (NLAIE::CExceptionIndexHandeledError) Definition at line 544 of file ident.h. References _LocRefence, and _Stock.
00544 :_Id(l._Id),_Stock(NULL) 00545 { 00546 NLMISC::CSynchronized<TMapRef >::CAccessor a(&_LocRefence); 00547 TMapRef::iterator itr = a.value().find(_Id); 00548 if(itr != a.value().end()) 00549 { 00550 _Stock = (*itr).second; 00551 } 00552 else throw NLAIE::CExceptionIndexHandeledError(); 00553 } |
|
Copy Constructor. Exception: throw (NLAIE::CExceptionIndexHandeledError) Definition at line 560 of file ident.h. References _Stock, and load().
|
|
Definition at line 565 of file ident.h. References _Stock. Referenced by clone(), and newInstance().
00565 :_Stock(NULL) 00566 { 00567 } |
|
Definition at line 121 of file ident.cpp. References _LocRefence.
00122 { 00123 NLMISC::CSynchronized<TMapRef >::CAccessor a(&_LocRefence); 00124 TMapRef::iterator Itr = a.value().find(_Id); 00125 if(Itr != a.value().end()) 00126 { 00127 a.value().erase(Itr); 00128 } 00129 else throw NLAIE::CExceptionIndexHandeledError(); 00130 } |
|
Clear the map.
Definition at line 158 of file ident.cpp.
00159 { 00160 /*NLMISC::CSynchronized<TMapRef >::CAccessor a(&_LocRefence); 00161 if(a.value() ) 00162 { 00163 delete a.value(); 00164 a.value() = NULL; 00165 }*/ 00166 } |
|
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 579 of file ident.h. References CLocWordNumRef().
00580 { 00581 NLAIC::IBasicInterface *m = new CLocWordNumRef(*this); 00582 return m; 00583 } |
|
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 569 of file ident.h. References NLAIAGENT::CNumericIndex::getDebugString(), NLAIC::stringGetBuild(), and t.
00570 { 00571 std::string i; 00572 _Id.getDebugString(i); 00573 t += NLAIC::stringGetBuild("CLocWordNumRef<%d>: _Id <%s>",this,i.c_str()); 00574 } |
|
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 } |
|
Implements NLAIAGENT::IWordNumRef. Definition at line 612 of file ident.h.
00613 { 00614 return _Id; 00615 } |
|
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 }
|
|
Clear the map.
Definition at line 137 of file ident.cpp. References _LocRefence.
00138 { 00139 NLMISC::CSynchronized<TMapRef >::CAccessor a(&_LocRefence); 00140 TMapRef::iterator Itr = a.value().find(id); 00141 if(Itr != a.value().end()) 00142 { 00143 return (*Itr).second; 00144 } 00145 /*else 00146 { 00147 throw NLAIE::CExceptionIndexHandeledError(); 00148 }*/ 00149 return NULL; 00150 } |
|
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 132 of file ident.cpp. References IdLocWordNumRef.
00133 { 00134 return *IdLocWordNumRef; 00135 } |
|
|
Init the map.
Definition at line 152 of file ident.cpp.
00153 { 00154 /*NLMISC::CSynchronized<TMapRef >::CAccessor a(&_LocRefence); 00155 a.value() = new CLocWordNumRef::TMapRef;*/ 00156 } |
|
Exception: throw (NLAIE::CExceptionIndexHandeledError).
Implements NLAIC::IBasicInterface. Definition at line 594 of file ident.h. References _LocRefence, _Stock, and NLAIAGENT::CNumericIndex::load(). Referenced by CLocWordNumRef().
00595 { 00596 NLMISC::CSynchronized<TMapRef >::CAccessor a(&_LocRefence); 00597 _Id.load(is); 00598 TMapRef::iterator Itr = a.value().find(_Id); 00599 if(Itr != a.value().end()) 00600 { 00601 _Stock = (*Itr).second; 00602 } 00603 else throw NLAIE::CExceptionIndexHandeledError(); 00604 } |
|
Load the mapping objects in the word |
|
This function allow a new instance, that mean that the class is a class factory. Implements NLAIC::IBasicType. Definition at line 584 of file ident.h. References CLocWordNumRef().
00585 { 00586 NLAIC::IBasicInterface *m = new CLocWordNumRef(); 00587 return m; 00588 } |
|
Implements NLAIAGENT::IWordNumRef. Definition at line 607 of file ident.h. References _Stock.
00608 { 00609 return (const IRefrence *)_Stock; 00610 } |
|
|
Save the class in a stream. Implements NLAIC::IBasicInterface. Definition at line 589 of file ident.h. References NLAIAGENT::CNumericIndex::save().
00590 { 00591 _Id.save(os); 00592 } |
|
Saving the mapping objects in the word. Saving mapping is to save all CNumericIndex shared in the map and its IRefrence class factory ident type. |
|
Reimplemented from NLAIC::IPointerGestion. Definition at line 328 of file abstract_interface.h. References NLAIC::IBasicInterface::load(), and NLAIC::IBasicInterface::save().
|
|
Definition at line 617 of file ident.h. References NLAIAGENT::CNumericIndex::setTypeAt(), t, and uint64.
00618 { 00619 _Id.setTypeAt(t); 00620 } |
|
The iden of the class.
|
|
Referenced by CLocWordNumRef(), getRef(), load(), and ~CLocWordNumRef(). |
|
_Stock define the cross reference between agent and this class.
Definition at line 489 of file ident.h. Referenced by CLocWordNumRef(), load(), and operator const IRefrence *(). |
|
The class factory ident of the class.
Definition at line 73 of file static_def_init.cpp. Referenced by getType(). |