#include <abstract_interface.h>
Inheritance diagram for NLAIC::CIdentType:
Nevrax France
Definition at line 142 of file abstract_interface.h.
Public Member Functions | |
void | addObjectType (sint32) |
const IBasicInterface * | allocClass () const |
Alloc an instance of a class. | |
CIdentType (const CIdentType &i) | |
Copy contructor. | |
CIdentType (const char *ident, const IClassFactory &classCFactory, const CTypeOfObject &objType, const CTypeOfOperator &opSupport) | |
throw (NLAIE::CExceptionContainer); | |
CIdentType (const char *ident) | |
throw(NLMISC::EStream); | |
CIdentType (NLMISC::IStream &) | |
throw(NLMISC::EStream) | |
sint32 | cmp (const CIdentType &a) const |
sint32 | decRef () |
Decrement the reference of an object. | |
virtual void | getDebugString (std::string &t) const |
const IClassFactory * | getFactory () const |
Get the class factory associate. | |
sint32 | getIndex () 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. | |
operator const char * () const | |
Get class type name. | |
operator const CTypeOfObject & () const | |
operator const CTypeOfOperator & () const | |
bool | operator< (const char *a) const |
bool | operator< (const CIdentType &a) const |
This test is need for the std::map. | |
void | operator= (const CIdentType &a) |
Make equality. | |
bool | operator== (const CIdentType &a) const |
Test the equality. | |
bool | operator> (const CIdentType &a) const |
virtual void | release () |
Release allow to release the pointer. The last release when the _Ref is nul delete the object. | |
~CIdentType () | |
NLMISC::IStreamable method. | |
virtual std::string | getClassName () |
virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
Static Public Attributes | |
CIdentType | VoidType = CIdentType("VOID",CTypeOfObject::tObject,CTypeOfOperator(0),-1) |
Basic shared type need for lot of objects, and special for typing the retern method in the script. | |
Private Member Functions | |
CIdentType (const char *ident, const CTypeOfObject &objType, const CTypeOfOperator &opSupport, sint32 index) | |
Construct object with all atribut. It use when we serial object. | |
Private Attributes | |
char * | _Ident |
This is a string for naming the class. | |
sint32 | _Index |
The index of objects in the class gactory map. | |
CTypeOfObject * | _ObjType |
This objects allow use to know what kind of objects it is (simple object, agent, scripted agent, operator ...). | |
CTypeOfOperator * | _OpSupport |
This objects allow use to know what kind of operation we can do with it (add, sub ...). | |
Friends | |
class | CIdentTypeAlloc |
|
Construct object with all atribut. It use when we serial object.
Definition at line 108 of file ident_type.cpp. References _Ident, index, and sint32.
|
|
throw(NLMISC::EStream)
Definition at line 100 of file ident_type.cpp. References _Ident, _ObjType, _OpSupport, and serial().
00101 { 00102 _ObjType = NULL; 00103 _OpSupport = NULL; 00104 _Ident = NULL; 00105 serial(f); 00106 } |
|
throw(NLMISC::EStream); Construct object with a name. Object must be mounted in the class factory else an exception wil occur. CExceptionContainer share an CExceptionUnRegisterClassError exception object. Definition at line 140 of file ident_type.cpp. References _Ident, _ObjType, _OpSupport, NLAIC::getRegistry(), NLAIC::IPointerGestion::incRef(), and r.
00140 : _Index(-1) 00141 { 00142 _Ident = new char [strlen(ident) + 1]; 00143 strcpy((char *)_Ident,ident); 00144 00145 try 00146 { 00147 CRegistry *r = getRegistry(); 00148 _Index = r->getNumIdent(*this); 00149 const CIdentType &id= r->getIdent(_Index); 00150 _ObjType = (CTypeOfObject *)&((const CTypeOfObject &)id); 00151 _ObjType->incRef(); 00152 _OpSupport = (CTypeOfOperator *)&((const CTypeOfOperator &)id); 00153 _OpSupport->incRef(); 00154 } 00155 catch (NLAIE::IException &err) 00156 { 00157 delete _Ident; 00158 _Ident = NULL; 00159 _ObjType = NULL; 00160 _OpSupport = NULL; 00161 NLAIE::CExceptionContainer e(err.what()); 00162 throw e; 00163 } 00164 } |
|
throw (NLAIE::CExceptionContainer); Construct object. Object must be mounted in the class factory else an exception wil occur. CExceptionContainer share an CExceptionUnRegisterClassError exception object. Definition at line 117 of file ident_type.cpp. References _Ident, _ObjType, _OpSupport, NLAIC::getRegistry(), r, and NLAIC::IPointerGestion::release().
00117 : _ObjType((CTypeOfObject *)objType.clone()), 00118 _OpSupport((CTypeOfOperator *)opSupport.clone()), 00119 _Index(-1) 00120 { 00121 _Ident = new char [strlen(ident) + 1]; 00122 strcpy((char *)_Ident,ident); 00123 00124 try 00125 { 00126 CRegistry *r = getRegistry(); 00127 _Index = r->registerClass(*this,classCFactory); 00128 } 00129 catch (NLAIE::IException &err) 00130 { 00131 delete _Ident; 00132 _Ident = NULL; 00133 _ObjType->release(); 00134 _OpSupport->release(); 00135 throw NLAIE::CExceptionContainer(err.what()); 00136 } 00137 } |
|
Copy contructor. throw (NLAIE::CExceptionContainer); Definition at line 166 of file ident_type.cpp. References _Ident, and _Index.
00166 :_ObjType((CTypeOfObject *)i._ObjType->clone()),_OpSupport((CTypeOfOperator *)i._OpSupport->clone()),_Index(-1) 00167 { 00168 _Index = i._Index; 00169 _Ident = new char [strlen(i._Ident) + 1]; 00170 strcpy((char *)_Ident,i._Ident); 00171 } |
|
Definition at line 93 of file ident_type.cpp. References _Ident, _ObjType, _OpSupport, and NLAIC::IPointerGestion::release().
00094 { 00095 if(_Ident != NULL) delete (char *)_Ident; 00096 if(_ObjType != NULL) _ObjType->release(); 00097 if(_OpSupport != NULL) _OpSupport->release(); 00098 } |
|
Definition at line 183 of file ident_type.cpp. References _ObjType, NLAIC::CBinaryType::addType(), sint32, and t. Referenced by NLAISCRIPT::CMessageClass::CMessageClass().
|
|
Alloc an instance of a class.
Definition at line 173 of file ident_type.cpp. References NLAIC::CRegistry::createInstance(), and NLAIC::getRegistry(). Referenced by NLAIC::CIdentTypeAlloc::allocClass(), NLAIAGENT::CVolatilMemmory::init(), and NLAIAGENT::CAgentScript::runAskDebugString().
00174 { 00175 return getRegistry()->createInstance(_Index); 00176 } |
|
Definition at line 216 of file abstract_interface.h. References _Ident, and sint32.
00217 {
00218 return strcmp(_Ident,a._Ident);
00219 }
|
|
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 }
|
|
Reimplemented from NLAIC::IPointerGestion. Definition at line 243 of file abstract_interface.h. References _Ident.
00244 {
00245 return std::string(_Ident);
00246 }
|
|
|
Get the class factory associate.
Definition at line 178 of file ident_type.cpp. References NLAIC::CRegistry::getFactory(), and NLAIC::getRegistry(). Referenced by NLAISCRIPT::CCompilateur::affectation(), NLAISCRIPT::CAgentClass::buildChildsMessageMap(), NLAISCRIPT::IOpType::evalParam(), NLAISCRIPT::CAgentClass::isMessageFunc(), NLAISCRIPT::CConstraintStackComp::run(), NLAISCRIPT::CConstraintFindRun::run(), NLAISCRIPT::CConstraintMethode::run(), and NLAISCRIPT::COperationTypeGD::satisfied().
00179 { 00180 return getRegistry()->getFactory(_Index); 00181 } |
|
Definition at line 231 of file abstract_interface.h. References sint32.
00232 { 00233 return _Index; 00234 } |
|
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 }
|
|
|
Get class type name.
Definition at line 183 of file abstract_interface.h. References _Ident.
00184 { 00185 #ifdef NL_DEBUG 00186 if(this == NULL) return "<Inknown>"; 00187 #endif 00188 return _Ident; 00189 } |
|
Definition at line 221 of file abstract_interface.h. References _ObjType.
00222 { 00223 return *_ObjType; 00224 } |
|
Definition at line 226 of file abstract_interface.h. References _OpSupport.
00227 { 00228 return *_OpSupport; 00229 } |
|
Definition at line 206 of file abstract_interface.h. References _Ident.
00207 {
00208 return strcmp(_Ident,a) < 0;
00209 }
|
|
This test is need for the std::map.
Definition at line 201 of file abstract_interface.h. References _Ident.
00202 {
00203 return strcmp(_Ident,a._Ident) < 0;
00204 }
|
|
Make equality.
Definition at line 190 of file ident_type.cpp. References _Ident, and _Index.
|
|
Test the equality.
Definition at line 196 of file abstract_interface.h. References _Index.
00197 { 00198 return _Index == a._Index; 00199 } |
|
Definition at line 211 of file abstract_interface.h. References _Ident.
00212 {
00213 return strcmp(_Ident,a._Ident) > 0;
00214 }
|
|
|
Reimplemented from NLAIC::IPointerGestion. Definition at line 198 of file ident_type.cpp. References NLAIC::CRegistry::getIdent(), NLAIC::CRegistry::getNumIdent(), NLAIC::getRegistry(), s, sint32, and x. Referenced by CIdentType(), NLAIC::operator<<(), and NLAISCRIPT::COperandSimple::serial().
00199 { 00200 if(!f.isReading()) 00201 { 00202 f.serial(_Index); 00203 std::string x(_Ident); 00204 f.serial(x); 00205 } 00206 else 00207 { 00208 std::string s; 00209 sint32 n; 00210 f.serial(n); 00211 f.serial(s); 00212 00213 if(_Ident) delete _Ident; 00214 00215 _Ident = new char [strlen(s.data()) + 1]; 00216 strcpy((char *)_Ident,s.data()); 00217 try 00218 { 00219 _Index = getRegistry()->getNumIdent(*this); 00220 const CIdentType &id= getRegistry()->getIdent(_Index); 00221 if(_ObjType) _ObjType->release(); 00222 if(_OpSupport) _OpSupport->release(); 00223 00224 _ObjType = (CTypeOfObject *)&((const CTypeOfObject &)id); 00225 _ObjType->incRef(); 00226 _OpSupport = (CTypeOfOperator *)&((const CTypeOfOperator &)id); 00227 _OpSupport->incRef(); 00228 } 00229 catch (NLAIE::IException &) 00230 { 00231 throw NLMISC::EStream(); 00232 } 00233 00234 } 00235 } |
|
Definition at line 144 of file abstract_interface.h. |
|
This is a string for naming the class.
Definition at line 147 of file abstract_interface.h. Referenced by CIdentType(), cmp(), getClassName(), operator const char *(), operator<(), operator=(), operator>(), and ~CIdentType(). |
|
The index of objects in the class gactory map.
Definition at line 153 of file abstract_interface.h. Referenced by CIdentType(), operator=(), and operator==(). |
|
This objects allow use to know what kind of objects it is (simple object, agent, scripted agent, operator ...).
Definition at line 149 of file abstract_interface.h. Referenced by addObjectType(), CIdentType(), operator const CTypeOfObject &(), and ~CIdentType(). |
|
This objects allow use to know what kind of operation we can do with it (add, sub ...).
Definition at line 151 of file abstract_interface.h. Referenced by CIdentType(), operator const CTypeOfOperator &(), and ~CIdentType(). |
|
Basic shared type need for lot of objects, and special for typing the retern method in the script.
Definition at line 91 of file ident_type.cpp. |