31 : _baseClass(baseClass)
41 : _baseClass(runTimeClass._baseClass)
48 auto bases = _bases.load(std::memory_order_relaxed);
49 if (bases != _basesInline)
56 static void printClassNames();
123 mutable std::atomic<const RunTimeClass**> _bases;
143 template <
typename T>
178 static const char* _name;
197 template <
typename T>
230 #define isA(className) _isA(CLASS(className)) 241 #define isA2(className, T1, T2) _isA(CLASS2(className, T1, T2)) 249 #define CLASS(className) (className::getThisClass()) 257 #define CLASS2(className, T1, T2) (className<T1, T2>::getThisClass()) 265 #define UTL_CLASS_DECL_RTTI_ABC(className) \ 267 virtual const utl::RunTimeClass* getClass() const; \ 268 virtual const char* getClassName() const; \ 269 static const utl::RunTimeClass* getThisClass(); \ 270 static const char* getThisClassName(); \ 271 static const utl::RunTimeClass* getBaseClass(); \ 272 static const char* getBaseClassName(); \ 275 static const utl::TRunTimeClass<className> ___rtc __attribute__((__used__)); 283 #define UTL_CLASS_DECL_RTTI(className) \ 285 virtual const utl::RunTimeClass* getClass() const; \ 286 virtual const char* getClassName() const; \ 287 static const utl::RunTimeClass* getThisClass(); \ 288 static const char* getThisClassName(); \ 289 static const utl::RunTimeClass* getBaseClass(); \ 290 static const char* getBaseClassName(); \ 293 static const utl::TConcreteRunTimeClass<className> ___rtc __attribute__((__used__)); 302 #define UTL_CLASS_DECL_RTTI_TPL(className, T) \ 304 virtual const utl::RunTimeClass* getClass() const; \ 305 virtual const char* getClassName() const; \ 306 static const utl::RunTimeClass* getThisClass(); \ 307 static const char* getThisClassName(); \ 308 static const utl::RunTimeClass* getBaseClass(); \ 309 static const char* getBaseClassName(); \ 312 static const utl::TConcreteRunTimeClass<className<T>> ___rtc __attribute__((__used__)); 321 #define UTL_CLASS_DECL_RTTI_TPL2(className, T1, T2) \ 323 virtual const utl::RunTimeClass* getClass() const; \ 324 virtual const char* getClassName() const; \ 325 static const utl::RunTimeClass* getThisClass(); \ 326 static const char* getThisClassName(); \ 327 static const utl::RunTimeClass* getBaseClass(); \ 328 static const char* getBaseClassName(); \ 331 static const utl::TConcreteRunTimeClass<className<T1, T2>> ___rtc __attribute__((__used__)); 335 #define UTL_CLASS_IMPL_RTTI_CMN(className) \ 336 const utl::RunTimeClass* className::getClass() const \ 340 const char* className::getClassName() const \ 342 return ___rtc.name(); \ 344 const utl::RunTimeClass* className::getThisClass() \ 348 const char* className::getThisClassName() \ 350 return ___rtc.name(); \ 352 const utl::RunTimeClass* className::getBaseClass() \ 354 return ___rtc.baseClass(); \ 356 const char* className::getBaseClassName() \ 358 return getBaseClass()->name(); \ 367 #define UTL_CLASS_IMPL_RTTI_ABC(className) \ 368 UTL_CLASS_IMPL_RTTI_CMN(className); \ 369 const utl::TRunTimeClass<className> className::___rtc(CLASS(className::super)); \ 370 template class utl::TRunTimeClass<className>; 378 #define UTL_CLASS_IMPL_RTTI(className) \ 379 UTL_CLASS_IMPL_RTTI_CMN(className); \ 380 const utl::TConcreteRunTimeClass<className> className::___rtc(CLASS(className::super)); \ 381 template class utl::TRunTimeClass<className>; \ 382 template class utl::TConcreteRunTimeClass<className>; 391 #define UTL_CLASS_IMPL_RTTI_TPL(className, T) \ 392 template <typename T> \ 393 const utl::RunTimeClass* className<T>::getClass() const \ 397 template <typename T> \ 398 const char* className<T>::getClassName() const \ 400 return ___rtc.name(); \ 402 template <typename T> \ 403 const utl::RunTimeClass* className<T>::getThisClass() \ 407 template <typename T> \ 408 const char* className<T>::getThisClassName() \ 410 return ___rtc.name(); \ 412 template <typename T> \ 413 const utl::RunTimeClass* className<T>::getBaseClass() \ 415 return ___rtc.baseClass(); \ 417 template <typename T> \ 418 const char* className<T>::getBaseClassName() \ 420 return getBaseClass()->name(); \ 422 template <typename T> \ 423 const utl::TConcreteRunTimeClass<className<T>> className<T>::___rtc( \ 424 CLASS(className<T>::super)); 428 #define UTL_CLASS_IMPL_RTTI_TPL2_CMN(className, T1, T2) \ 429 template <typename T1, typename T2> \ 430 const utl::RunTimeClass* className<T1, T2>::getClass() const \ 434 template <typename T1, typename T2> \ 435 const char* className<T1, T2>::getClassName() const \ 437 return ___rtc.name(); \ 439 template <typename T1, typename T2> \ 440 const utl::RunTimeClass* className<T1, T2>::getThisClass() \ 444 template <typename T1, typename T2> \ 445 const char* className<T1, T2>::getThisClassName() \ 447 return ___rtc.name(); \ 449 template <typename T1, typename T2> \ 450 const utl::RunTimeClass* className<T1, T2>::getBaseClass() \ 452 return ___rtc.baseClass(); \ 454 template <typename T1, typename T2> \ 455 const char* className<T1, T2>::getBaseClassName() \ 457 return getBaseClass()->name(); \ 467 #define UTL_CLASS_IMPL_RTTI_TPL2(className, T1, T2) \ 468 UTL_CLASS_IMPL_RTTI_TPL2_CMN(className, T1, T2); \ 469 template <typename T1, typename T2> \ 470 const utl::TConcreteRunTimeClass<className<T1, T2>> className<T1, T2>::___rtc( \ 471 className<T1, T2>::super::getThisClass()); 479 #define UTL_CLASS_IMPL_NAME(className) \ 481 const char* utl::TRunTimeClass<className>::_name = #className; 489 #define UTL_CLASS_IMPL_NAME_TPL(className, T) \ 491 const char* utl::TRunTimeClass<className<T>>::_name = #className "<" #T ">"; 499 #define UTL_CLASS_IMPL_NAME_TPL2(className, T1, T2) \ 501 const char* utl::TRunTimeClass<className<T1, T2>>::_name = #className "<" #T1 "," #T2 ">"; 510 #define UTL_CLASS_IMPL_NAME_TPLxTPL2(className, TC, T1, T2) \ 512 const char* utl::TRunTimeClass<className<TC<T1, T2>>>::_name \ 513 = #className "<" #TC "<" #T1 "," #T2 \ const char * name() const
Get the name.
virtual Object * create() const
Create a new instance of this class.
virtual size_t size() const
Get the size of this class (as in sizeof()).
virtual Object * create() const
Create a new instance of this class.
Store information about a class.
virtual const char * vname() const
Get the name.
virtual size_t size() const
Get the size of this class (as in sizeof()).
virtual const char * vname() const
Get the name.
RunTimeClass(const RunTimeClass *baseClass)
Constructor.
Encapsulate class-related knowledge for concrete classes.
#define ABORT()
Immediately terminates the program.
Template version of RunTimeClass.
TRunTimeClass(const RunTimeClass *baseClass)
Constructor.
Root of UTL++ class hierarchy.
const RunTimeClass * baseClass() const
Get the base class.
TConcreteRunTimeClass(const RunTimeClass *baseClass)
Constructor.
RunTimeClass(const RunTimeClass &runTimeClass)
Copy constructor.