PixelLightAPI  .
Rtti.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: Rtti.h                                         *
00003  *
00004  *  Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLCORE_RTTI_H__
00024 #define __PLCORE_RTTI_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLCore/Base/ClassReal.h"
00032 #include "PLCore/Base/ClassManager.h"
00033 #include "PLCore/Base/Var/Var.h"
00034 #include "PLCore/Base/Var/Attribute.h"
00035 #include "PLCore/Base/Func/Method.h"
00036 #include "PLCore/Base/Func/Constructor.h"
00037 #include "PLCore/Base/Event/Signal.h"
00038 #include "PLCore/Base/Event/Slot.h"
00039 #include "PLCore/Base/Tools/TypeTraits.h"
00040 
00041 
00042 //[-------------------------------------------------------]
00043 //[ Namespace                                             ]
00044 //[-------------------------------------------------------]
00045 namespace PLCore {
00046 
00047 
00048 //[-------------------------------------------------------]
00049 //[ Definitions                                           ]
00050 //[-------------------------------------------------------]
00051 /**
00052 *  @brief
00053 *    Debug mode
00054 */
00055 #ifdef _DEBUG
00056     #define PLCORE_IS_DEBUGMODE true
00057 #else
00058     #define PLCORE_IS_DEBUGMODE false
00059 #endif
00060 
00061 
00062 //[-------------------------------------------------------]
00063 //[ Classes                                               ]
00064 //[-------------------------------------------------------]
00065 /**
00066 *  @brief
00067 *    Class to give each module a unique ID
00068 *
00069 *  @remarks
00070 *    This is implemented as a template to ensure, that the compiler will create a *unique* class
00071 *    in each module (e.g. library or application) that is using that class. So, e.g. calling
00072 *    ModuleID<int> from project A will result in another class being used than calling it
00073 *    from project B, which allows the class to request a unique identifier in each module.
00074 *    The class is accessed using ModuleID<int>.
00075 */
00076 template <typename T> class ModuleID
00077 {
00078 
00079 
00080     //[-------------------------------------------------------]
00081     //[ Public functions                                      ]
00082     //[-------------------------------------------------------]
00083     public:
00084         /**
00085         *  @brief
00086         *    Get module ID
00087         *
00088         *  @return
00089         *    Unique module ID
00090         */
00091         static uint32 GetModuleID();
00092 
00093         /**
00094         *  @brief
00095         *    Register module
00096         *
00097         *  @param[in] sName
00098         *    Module name
00099         *  @param[in] sVendor
00100         *    Vendor name
00101         *  @param[in] sLicense
00102         *    Module license
00103         *  @param[in] sDescription
00104         *    Module description
00105         */
00106         static void RegisterModule(const String &sName, const String &sVendor, const String &sLicense, const String &sDescription);
00107 
00108 
00109     //[-------------------------------------------------------]
00110     //[ Private data                                          ]
00111     //[-------------------------------------------------------]
00112     private:
00113         static uint32 m_nModuleID;  /**< Unique module ID */
00114 
00115 
00116 };
00117 
00118 // Get module ID
00119 template <typename T> uint32 ModuleID<T>::GetModuleID()
00120 {
00121     // Request module ID from ClassManager
00122     if (m_nModuleID == 0)
00123         m_nModuleID = ClassManager::GetInstance()->GetUniqueModuleID();
00124 
00125     // Return module ID
00126     return m_nModuleID;
00127 }
00128 
00129 template <typename T> void ModuleID<T>::RegisterModule(const String &sName, const String &sVendor, const String &sLicense, const String &sDescription)
00130 {
00131     ClassManager::GetInstance()->RegisterModule(GetModuleID(), sName, sVendor, sLicense, sDescription);
00132 }
00133 
00134 // Module ID
00135 template <typename T> uint32    ModuleID<T>::m_nModuleID = 0;
00136 
00137 
00138 //[-------------------------------------------------------]
00139 //[ Internal macros                                       ]
00140 //[-------------------------------------------------------]
00141 /**
00142 *  @brief
00143 *    Create class for an enumeration type
00144 *
00145 *  @param[in] ENUM
00146 *    Enumeration name
00147 */
00148 #define __pl_enum(ENUM) \
00149     class ENUM##__plcore_enum__ { \
00150         public: \
00151             typedef int  _BaseType; \
00152             typedef ENUM _Type; \
00153             \
00154             static bool GetEnumValue(int nIndex, ENUM &nValue, PLCore::String &sName, PLCore::String &sDescription) { \
00155                 int nCount = 0; \
00156 
00157 /**
00158 *  @brief
00159 *    Create class for an direct enumeration type (not using enum{}, e.g. for float 'enums')
00160 *
00161 *  @param[in] ENUM
00162 *    Enumeration name
00163 *  @param[in] TYPE
00164 *    Enumeration type
00165 */
00166 #define __pl_enum_direct(ENUM, TYPE) \
00167     class ENUM##__plcore_enum__ { \
00168         public: \
00169             typedef TYPE _BaseType; \
00170             typedef TYPE _Type; \
00171             \
00172             static bool GetEnumValue(int nIndex, TYPE &nValue, PLCore::String &sName, PLCore::String &sDescription) { \
00173                 int nCount = 0; \
00174 
00175 /**
00176 *  @brief
00177 *    Declare base enumeration type (add all values of an existing enumeration type)
00178 *
00179 *  @param[in] ENUM
00180 *    Enumeration name of base data type
00181 */
00182 #define __pl_enum_base(ENUM) \
00183                 nCount = PLCore::EnumType<ENUM##__plcore_enum__>::GetNumOfEnumValues(); \
00184                 if (nIndex >= 0 && nIndex < nCount) { \
00185                     return ENUM##__plcore_enum__::GetEnumValue(nIndex, reinterpret_cast<ENUM&>(nValue), sName, sDescription); \
00186                 } else if (nIndex == -1) { \
00187                     if (ENUM##__plcore_enum__::GetEnumValue(-1, reinterpret_cast<ENUM&>(nValue), sName, sDescription)) \
00188                         return true; \
00189                 } \
00190 
00191 /**
00192 *  @brief
00193 *    Add enumeration value
00194 *
00195 *  @param[in] VALUE
00196 *    Enumeration value
00197 *  @param[in] DESCRIPTION
00198 *    Enumeration description
00199 */
00200 #define __pl_enum_value(VALUE, DESCRIPTION) \
00201                      if (nIndex == nCount)                                      { nValue = VALUE; sName = #VALUE; return true; } \
00202                 else if (nIndex == -1 && !sName.GetLength() && nValue == VALUE) { sName = #VALUE; return true; } \
00203                 else if (nIndex == -1 && sName == #VALUE)                       { nValue = VALUE; sDescription = DESCRIPTION; return true; } \
00204                 nCount++; \
00205 
00206 /**
00207 *  @brief
00208 *    Add enumeration value by directly specifying the value
00209 *
00210 *  @param[in] NAME
00211 *    Enumeration name
00212 *  @param[in] VALUE
00213 *    Enumeration value
00214 *  @param[in] DESCRIPTION
00215 *    Enumeration description
00216 */
00217 #define __pl_enum_value_direct(NAME, VALUE, DESCRIPTION) \
00218                      if (nIndex == nCount)                                      { nValue = VALUE; sName = #NAME; return true; } \
00219                 else if (nIndex == -1 && !sName.GetLength() && nValue == VALUE) { sName = #NAME;  return true; } \
00220                 else if (nIndex == -1 && sName == #NAME)                        { nValue = VALUE; sDescription = DESCRIPTION; return true; } \
00221                 nCount++; \
00222 
00223 /**
00224 *  @brief
00225 *    End enumeration class
00226 */
00227 #define __pl_enum_end \
00228                 return false; \
00229             } \
00230     }; \
00231 
00232 /**
00233 *  @brief
00234 *    Create class
00235 *
00236 *  @param[in] CLASS
00237 *    Class name (without namespace)
00238 *  @param[in] NAMESPACE
00239 *    Namespace
00240 *  @param[in] BASECLASS
00241 *    Base class name (with namespace)
00242 *  @param[in] DESCRIPTION
00243 *    Class description
00244 */
00245 #define __pl_class(CLASS, NAMESPACE, BASECLASS, BASECLASSNAME, DESCRIPTION) \
00246     /* All RTTI members are public */ \
00247     public: \
00248         /* Class type */ \
00249         typedef CLASS     _Self; \
00250         typedef BASECLASS _Base; \
00251         \
00252         /* Class description */ \
00253         class _Class : public PLCore::ClassReal { \
00254             friend class CLASS; \
00255             public: \
00256                 /* Check base class */ \
00257                 static void Error() { \
00258                     PLCore::CheckBaseClass<CLASS, BASECLASS>::Type::Error(); \
00259                 } \
00260                 \
00261                 /* Singleton */ \
00262                 static _Class *GetSingleton(bool bGet = true) {\
00263                     static bool    MyShutdown = false; \
00264                     static _Class *MyInstance = nullptr; \
00265                     if (bGet) { \
00266                         /* Get or create instance */ \
00267                         if (!MyInstance && !MyShutdown) { \
00268                             MyInstance = new _Class(); \
00269                             CLASS::_RegisterProperties(MyInstance); \
00270                         } \
00271                     } else { \
00272                         /* Destroy instance and make sure that it won't be recreated */ \
00273                         MyShutdown = true; \
00274                         if (MyInstance) { \
00275                             delete MyInstance; \
00276                             MyInstance = nullptr; \
00277                         } \
00278                     } \
00279                     return MyInstance; \
00280                 } \
00281                 \
00282                 /* Constructor */ \
00283                 _Class() : PLCore::ClassReal(PLCore::ModuleID<int>::GetModuleID(), #CLASS, DESCRIPTION, NAMESPACE, BASECLASSNAME) { \
00284                 }; \
00285                 \
00286                 /* Destructor */ \
00287                 virtual ~_Class() { \
00288                 }; \
00289         }; \
00290 
00291 /**
00292 *  @brief
00293 *    Mark export flag
00294 *
00295 *  @param[in] EXPORT
00296 *    Export definition (must be defined as either 1 or 0)
00297 */
00298 #define __pl_rtti_export(EXPORT) \
00299         enum { \
00300             _RttiExport = EXPORT \
00301         }; \
00302         \
00303 
00304 /**
00305 *  @brief
00306 *    Create guard for class
00307 *
00308 *  @param[in] CLASS
00309 *    Class name (without namespace)
00310 */
00311 #define __pl_guard(CLASS) \
00312         /* Creation and destruction guard */ \
00313         class _Guard { \
00314             public: \
00315                 /* Constructor */ \
00316                 _Guard() { \
00317                     _Class::GetSingleton(); \
00318                 } \
00319                 \
00320                 /* Destructor */ \
00321                 ~_Guard() { \
00322                     /* Make sure that class instance is removed on shutdown */ \
00323                     _Class::GetSingleton(false); \
00324                 } \
00325         }; \
00326 
00327 /**
00328 *  @brief
00329 *    Create virtual function GetClass()
00330 */
00331 #define __pl_getclass() \
00332         /* Public virtual PLCore::Object function */ \
00333         virtual PLCore::Class *GetClass() const override \
00334         { \
00335             return _Class::GetSingleton()->GetClass(); \
00336         } \
00337 
00338 /**
00339 *  @brief
00340 *    Create class implementation (static variables)
00341 *
00342 *  @param[in] CLASS
00343 *    Class name (without namespace)
00344 */
00345 #define __pl_class_impl(CLASS) \
00346     /* Guard */ \
00347     CLASS::_Guard cGuard_##CLASS; \
00348 
00349 /**
00350 *  @brief
00351 *    Create class for properties
00352 */
00353 #define __pl_prop_meth \
00354         /* Class properties */ \
00355         static inline void _RegisterProperties(PLCore::ClassReal *pClass) { \
00356 
00357 /**
00358 *  @brief
00359 *    Add property
00360 *
00361 *  @param[in] NAME
00362 *    Property name
00363 *  @param[in] VALUE
00364 *    Property value
00365 */
00366 #define __pl_prop_prop(NAME, VALUE) \
00367             static_cast<_Class*>(pClass)->AddProperty(NAME, VALUE); \
00368 
00369 /**
00370 *  @brief
00371 *    End class for properties
00372 */
00373 #define __pl_prop_class_end \
00374         } \
00375 
00376 /**
00377 *  @brief
00378 *    Create get/set storage class for an attribute
00379 *
00380 *  @param[in] NAME
00381 *    Attribute name
00382 *  @param[in] TYPE
00383 *    Attribute type
00384 *  @param[in] STORAGE
00385 *    Attribute storage type (DirectValue/GetSet/ModifyAttr)
00386 */
00387 #define __pl_attr_stor(NAME, TYPE, STORAGE) \
00388         template <typename CLASS> class NAME##_GetSet { \
00389             public: \
00390                 typedef PLCore::StorageGetSet StorageType; \
00391                 typedef PLCore::StorageGetSet BaseStorageType; \
00392                 static inline PLCore::Type<TYPE>::_Type Get(PLCore::Object *pObject) { \
00393                     return static_cast<CLASS*>(pObject)->Get##NAME(); \
00394                 } \
00395                 static inline void Set(PLCore::Object *pObject, const PLCore::Type<TYPE>::_Type &Value) { \
00396                     static_cast<CLASS*>(pObject)->Set##NAME(Value); \
00397                 } \
00398         }; \
00399         \
00400         template <typename BASE> class NAME##_ModAttr { \
00401             public: \
00402                 typedef PLCore::StorageModifyAttr                       StorageType; \
00403                 typedef typename BASE::NAME##_Storage::BaseStorageType  BaseStorageType; \
00404                 static inline PLCore::Type<TYPE>::_Type Get(PLCore::Object *pObject) { \
00405                     return static_cast<BASE*>(pObject)->NAME.Get(); \
00406                 } \
00407                 static inline void Set(PLCore::Object *pObject, const PLCore::Type<TYPE>::_Type &Value) { \
00408                     static_cast<BASE*>(pObject)->NAME.Set(Value); \
00409                 } \
00410         }; \
00411 
00412 /**
00413 *  @brief
00414 *    Create descriptor class for an attribute
00415 *
00416 *  @param[in] NAME
00417 *    Attribute name
00418 *  @param[in] TYPE
00419 *    Attribute type
00420 *  @param[in] DEFAULT
00421 *    Attribute default value
00422 *  @param[in] DESCRIPTION
00423 *    Attribute description
00424 *  @param[in] ANNOTATION
00425 *    Attribute annotation
00426 */
00427 #define __pl_attr_desc(NAME, TYPE, DEFAULT, DESCRIPTION, ANNOTATION) \
00428         class NAME##_Desc : public PLCore::VarDesc { \
00429             public: \
00430                 NAME##_Desc() : PLCore::VarDesc(PLCore::Type<TYPE>::TypeID, PLCore::Type<TYPE>::GetTypeName(), #NAME, DESCRIPTION, ANNOTATION) { \
00431                     bool bRegister = static_cast<bool>(_Self::_RttiExport); \
00432                     if (bRegister) \
00433                         Register(_Class::GetSingleton()); \
00434                 } \
00435                 ~NAME##_Desc() { \
00436                 } \
00437             private: \
00438                 virtual PLCore::String GetDefault() const override { \
00439                     return PLCore::Type<TYPE>::ConvertToString(DEFAULT); \
00440                 } \
00441                 virtual PLCore::DynVar *GetAttribute(const Object &cObject) const override { \
00442                     return &reinterpret_cast<_Self&>(const_cast<Object&>(cObject)).NAME; \
00443                 } \
00444         }; \
00445 
00446 /**
00447 *  @brief
00448 *    Create class for an attribute
00449 *
00450 *  @param[in] NAME
00451 *    Attribute name
00452 *  @param[in] TYPE
00453 *    Attribute type
00454 *  @param[in] DEFAULT
00455 *    Attribute default value
00456 *  @param[in] ACCESS
00457 *    Attribute access type (ReadWrite/ReadOnly)
00458 *  @param[in] STORAGE
00459 *    Attribute storage type (DirectValue/GetSet/ModifyAttr)
00460 */
00461 #define __pl_attr_attr(NAME, TYPE, DEFAULT, ACCESS, STORAGE) \
00462         typedef PLCore::SpecializeIfEqual<PLCore::Storage##STORAGE, PLCore::StorageGetSet,     NAME##_GetSet,  _Self>::Type NAME##_ClassGetSet; \
00463         typedef PLCore::SpecializeIfEqual<PLCore::Storage##STORAGE, PLCore::StorageModifyAttr, NAME##_ModAttr, _Base>::Type NAME##_ClassModAttr; \
00464         typedef PLCore::StorageChooser<PLCore::Storage##STORAGE, NAME##_ClassGetSet, NAME##_ClassModAttr>::Storage          NAME##_Storage; \
00465         \
00466         class NAME##_Attr : public PLCore::Attribute<TYPE, PLCore::Access##ACCESS, NAME##_Storage, NAME##_Desc> { \
00467             public: \
00468                 typedef PLCore::Type< TYPE >::_Type _Type; \
00469                 NAME##_Attr(_Self *pObject) : PLCore::Attribute<TYPE, PLCore::Access##ACCESS, NAME##_Storage, NAME##_Desc>(DEFAULT, pObject) { \
00470                 } \
00471                 \
00472                 NAME##_Attr &operator =(const _Type &Value) { \
00473                     return static_cast<NAME##_Attr&>(PLCore::Attribute<TYPE, PLCore::Access##ACCESS, NAME##_Storage, NAME##_Desc>::operator =(Value)); \
00474                 } \
00475         }; \
00476 
00477 /**
00478 *  @brief
00479 *    Create attribute variable
00480 *
00481 *  @param[in] NAME
00482 *    Attribute name
00483 *  @param[in] TYPE
00484 *    Attribute type
00485 */
00486 #define __pl_attr_decl(NAME, TYPE) \
00487         NAME##_Attr NAME; \
00488 
00489 /**
00490 *  @brief
00491 *    Create descriptor class for a method
00492 *
00493 *  @param[in] NAME
00494 *    Method name
00495 *  @param[in] RET
00496 *    Return type
00497 *  @param[in] T0 - T15
00498 *    Parameter types
00499 *  @param[in] DESCRIPTION
00500 *    Method description
00501 *  @param[in] ANNOTATION
00502 *    Method annotation
00503 */
00504 #define __pl_method_desc(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
00505         class NAME##_Desc : public PLCore::FuncDesc { \
00506             public: \
00507                 typedef _Self                                                                                                                               ClassType; \
00508                 typedef PLCore::Functor<RET,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>                                                          FuncType; \
00509                 typedef PLCore::Signature<RET,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>                                                        SigType; \
00510                 typedef PLCore::ClassTypelist< _Self, PLCore::Typelist<RET,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15> >::TypeMethodSignature    MethType; \
00511             public: \
00512                 NAME##_Desc() : PLCore::FuncDesc(SigType::GetSignatureID(), #NAME, #DESCRIPTION, #ANNOTATION) { \
00513                     bool bRegister = static_cast<bool>(_Self::_RttiExport); \
00514                     if (bRegister) \
00515                         Register(_Class::GetSingleton()); \
00516                 } \
00517                 ~NAME##_Desc() { \
00518                 } \
00519                 virtual PLCore::DynFuncPtr GetMethod(Object &cObject) const override { \
00520                     return new NAME##_Method(reinterpret_cast<_Self&>(cObject)); \
00521                 } \
00522             private: \
00523                 FuncType m_cFunctor; \
00524         }; \
00525 
00526 /**
00527 *  @brief
00528 *    Create class for a method
00529 *
00530 *  @param[in] NAME
00531 *    Method name
00532 */
00533 #define __pl_method_meth(NAME) \
00534         class NAME##_Method : public PLCore::Method<NAME##_Desc> { \
00535             public: \
00536                 /* Cast away the const within the method pointer using a good old C-style cast to be as flexible as possible in here, if this is not done, only non-const methods can be exposed to the RTTI which isn't that comfortable */ \
00537                 NAME##_Method() : PLCore::Method<NAME##_Desc>((NAME##_Desc::MethType::MemFuncType)(&_Self::NAME), nullptr) { \
00538                     /* There are no automatic RTTI class method instances per RTTI class instance because there's no need for it and this safes RTTI class instance memory */ \
00539                 } \
00540                 /* Cast away the const within the method pointer using a good old C-style cast to be as flexible as possible in here, if this is not done, only non-const methods can be exposed to the RTTI which isn't that comfortable */ \
00541                 NAME##_Method(_Self &cObject) : PLCore::Method<NAME##_Desc>((NAME##_Desc::MethType::MemFuncType)(&_Self::NAME), &cObject) { \
00542                 } \
00543         }; \
00544 
00545 /**
00546 *  @brief
00547 *    Create descriptor class for a signal
00548 *
00549 *  @param[in] NAME
00550 *    Signal name
00551 *  @param[in] T0 - T15
00552 *    Parameter types
00553 *  @param[in] DESCRIPTION
00554 *    Signal description
00555 *  @param[in] ANNOTATION
00556 *    Signal annotation
00557 */
00558 #define __pl_signal_desc(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
00559         class NAME##_Desc : public PLCore::EventDesc { \
00560             public: \
00561                 typedef _Self                                                                           ClassType; \
00562                 typedef PLCore::Event<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>            EventType; \
00563                 typedef PLCore::Signature<void,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>   SigType; \
00564             public: \
00565                 NAME##_Desc() : PLCore::EventDesc(SigType::GetSignatureID(), #NAME, #DESCRIPTION, #ANNOTATION) { \
00566                     bool bRegister = static_cast<bool>(_Self::_RttiExport); \
00567                     if (bRegister) \
00568                         Register(_Class::GetSingleton()); \
00569                 } \
00570                 ~NAME##_Desc() { \
00571                 } \
00572             private: \
00573                 virtual PLCore::DynEvent *GetSignal(const Object &cObject) const override { \
00574                     return &reinterpret_cast<_Self&>(const_cast<Object&>(cObject)).NAME; \
00575                 } \
00576         }; \
00577 
00578 /**
00579 *  @brief
00580 *    Create class for a signal
00581 *
00582 *  @param[in] NAME
00583 *    Signal name
00584 */
00585 #define __pl_signal_evnt(NAME) \
00586         class NAME##_Signal : public PLCore::Signal<NAME##_Desc> { \
00587             public: \
00588                 NAME##_Signal() : PLCore::Signal<NAME##_Desc>() { \
00589                 } \
00590         }; \
00591 
00592 /**
00593 *  @brief
00594 *    Create signal variable
00595 *
00596 *  @param[in] NAME
00597 *    Signal name
00598 */
00599 #define __pl_signal_decl(NAME) \
00600         NAME##_Signal NAME; \
00601 
00602 /**
00603 *  @brief
00604 *    Create descriptor class for a slot
00605 *
00606 *  @param[in] NAME
00607 *    Event handler name
00608 *  @param[in] T0 - T15
00609 *    Parameter types
00610 *  @param[in] DESCRIPTION
00611 *    Event handler description
00612 *  @param[in] ANNOTATION
00613 *    Event handler annotation
00614 */
00615 #define __pl_slot_desc(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
00616         class NAME##_Desc : public PLCore::EventHandlerDesc { \
00617             public: \
00618                 typedef _Self                                                                                                                               ClassType; \
00619                 typedef PLCore::EventHandler<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>                                                         EventHandlerType; \
00620                 typedef PLCore::Signature<void,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>                                                       SigType; \
00621                 typedef PLCore::ClassTypelist< _Self, PLCore::Typelist<void,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15> >::TypeMethodSignature   MethType; \
00622             public: \
00623                 NAME##_Desc() : PLCore::EventHandlerDesc(SigType::GetSignatureID(), #NAME, #DESCRIPTION, #ANNOTATION) { \
00624                     bool bRegister = static_cast<bool>(_Self::_RttiExport); \
00625                     if (bRegister) \
00626                         Register(_Class::GetSingleton()); \
00627                 } \
00628                 ~NAME##_Desc() { \
00629                 } \
00630             private: \
00631                 virtual PLCore::DynEventHandler *GetSlot(const Object &cObject) const override { \
00632                     return &reinterpret_cast<_Self&>(const_cast<Object&>(cObject)).Slot##NAME; \
00633                 } \
00634         }; \
00635 
00636 /**
00637 *  @brief
00638 *    Create class for a slot
00639 *
00640 *  @param[in] NAME
00641 *    Slot name
00642 */
00643 #define __pl_slot_evth(NAME) \
00644         class NAME##_Slot : public PLCore::Slot<NAME##_Desc> { \
00645             public: \
00646                 NAME##_Slot(_Self *pObject) : PLCore::Slot<NAME##_Desc>(&_Self::NAME, pObject) { \
00647                 } \
00648         }; \
00649 
00650 /**
00651 *  @brief
00652 *    Create slot variable
00653 *
00654 *  @param[in] NAME
00655 *    Event handler name
00656 */
00657 #define __pl_slot_decl(NAME) \
00658         NAME##_Slot Slot##NAME; \
00659 
00660 /**
00661 *  @brief
00662 *    Create descriptor class for a constructor
00663 *
00664 *  @param[in] NAME
00665 *    Constructor name
00666 *  @param[in] T0 - T15
00667 *    Parameter types
00668 *  @param[in] DESCRIPTION
00669 *    Constructor description
00670 *  @param[in] ANNOTATION
00671 *    Constructor annotation
00672 */
00673 #define __pl_constructor_desc(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
00674         class NAME##_Desc : public PLCore::ConstructorDesc { \
00675             public: \
00676                 typedef _Self                                                                                   ClassType; \
00677                 typedef PLCore::Params<Object*,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>           ParamType; \
00678                 typedef const PLCore::Params<Object*,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>     ConstParamType; \
00679                 typedef PLCore::FuncConstructor<_Self,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>    ConstType; \
00680                 typedef PLCore::Signature<Object*,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>        SigType; \
00681             public: \
00682                 NAME##_Desc() : PLCore::ConstructorDesc(SigType::GetSignatureID(), #NAME, #DESCRIPTION, #ANNOTATION) { \
00683                     bool bRegister = static_cast<bool>(_Self::_RttiExport); \
00684                     if (bRegister) \
00685                         Register(_Class::GetSingleton()); \
00686                 } \
00687                 ~NAME##_Desc() { \
00688                 } \
00689             private: \
00690                 virtual PLCore::DynFunc *GetConstructor() const override { \
00691                     return const_cast<PLCore::DynFunc*>(reinterpret_cast<const PLCore::DynFunc*>(&m_Constructor)); \
00692                 } \
00693                 virtual PLCore::Object *Create(const PLCore::DynParams &cConstParams) override { \
00694                     if (cConstParams.GetSignature() == m_Constructor.GetSignature()) { \
00695                         ParamType cParams = static_cast<ConstParamType&>(cConstParams); \
00696                         m_Constructor.Call(cParams); \
00697                         return static_cast<ParamType&>(cParams).Return; \
00698                     } else return nullptr; \
00699                 } \
00700                 virtual PLCore::Object *Create(const PLCore::String &sConstParams) override { \
00701                     ParamType cParams = ConstParamType::FromString(sConstParams); \
00702                     m_Constructor.Call(cParams); \
00703                     return cParams.Return; \
00704                 } \
00705                 ConstType m_Constructor; \
00706         }; \
00707 
00708 /**
00709 *  @brief
00710 *    Create class for an event handler
00711 *
00712 *  @param[in] NAME
00713 *    Event handler name
00714 */
00715 #define __pl_constructor_cons(NAME) \
00716         class NAME##_Constructor : public PLCore::Constructor<NAME##_Desc> { \
00717             public: \
00718                 NAME##_Constructor() { \
00719                 } \
00720         }; \
00721 
00722 
00723 //[-------------------------------------------------------]
00724 //[ RTTI macros                                           ]
00725 //[-------------------------------------------------------]
00726 /**
00727 *  @brief
00728 *    Get current module ID
00729 */
00730 #define pl_current_module_id() ( PLCore::ModuleID<int>::GetModuleID() )
00731 
00732 /**
00733 *  @brief
00734 *    Declare enumeration type
00735 *
00736 *  @param[in] ENUM
00737 *    Enumeration name
00738 */
00739 #define pl_enum(ENUM) \
00740     __pl_enum(ENUM) \
00741 
00742 /**
00743 *  @brief
00744 *    Declare direct enumeration type (not using enum{}, e.g. for float 'enums')
00745 *
00746 *  @param[in] ENUM
00747 *    Enumeration name
00748 *  @param[in] TYPE
00749 *    Enumeration type
00750 */
00751 #define pl_enum_direct(ENUM, TYPE) \
00752     __pl_enum_direct(ENUM, TYPE) \
00753 
00754 /**
00755 *  @brief
00756 *    Declare base enumeration type (add all values of an existing enumeration type)
00757 *
00758 *  @param[in] ENUM
00759 *    Enumeration name of base data type
00760 */
00761 #define pl_enum_base(ENUM) \
00762     __pl_enum_base(ENUM) \
00763 
00764 /**
00765 *  @brief
00766 *    Declare enumeration value
00767 *
00768 *  @param[in] VALUE
00769 *    Enumeration value
00770 *  @param[in] DESCRIPTION
00771 *    Enumeration description
00772 */
00773 #define pl_enum_value(VALUE, DESCRIPTION) \
00774     __pl_enum_value(VALUE, DESCRIPTION) \
00775 
00776 /**
00777 *  @brief
00778 *    Add enumeration value by directly specifying the value
00779 *
00780 *  @param[in] NAME
00781 *    Enumeration name
00782 *  @param[in] VALUE
00783 *    Enumeration value
00784 *  @param[in] DESCRIPTION
00785 *    Enumeration description
00786 */
00787 #define pl_enum_value_direct(NAME, VALUE, DESCRIPTION) \
00788     __pl_enum_value_direct(NAME, VALUE, DESCRIPTION) \
00789 
00790 /**
00791 *  @brief
00792 *    End enumeration
00793 */
00794 #define pl_enum_end \
00795     __pl_enum_end \
00796 
00797 /**
00798 *  @brief
00799 *    Declare class
00800 *
00801 *  @param[in] EXPORT
00802 *    Export definition (must be defined as either 1 or 0)
00803 *  @param[in] CLASS
00804 *    Class name (without namespace)
00805 *  @param[in] NAMESPACE
00806 *    Namespace
00807 *  @param[in] BASECLASS
00808 *    Base class name (with namespace)
00809 *  @param[in] DESCRIPTION
00810 *    Class description
00811 */
00812 #define pl_class(EXPORT, CLASS, NAMESPACE, BASECLASS, DESCRIPTION) \
00813     __pl_class(CLASS, NAMESPACE, BASECLASS, #BASECLASS, DESCRIPTION) \
00814     __pl_guard(CLASS) \
00815     __pl_getclass() \
00816     __pl_rtti_export(EXPORT) \
00817 
00818 /**
00819 *  @brief
00820 *    Export RTTI class (use in macro pl_class)
00821 *
00822 *  @remarks
00823 *    Use pl_rtti_export to mark a class as being exported to other libraries/applications. Usually, you should
00824 *    define this in a global header file for your project to either pl_rtti_export(1) or pl_rtti_import(0),
00825 *    depending on whether the project is currently built itself or imported into another project (just as the
00826 *    dllimport/dllexport macros). However, if your project is an application that is not included anywhere else, you can
00827 *    directly pass pl_rtti_export to pl_class, as your classes are only exported and never imported.
00828 */
00829 #define pl_rtti_export 1
00830 
00831 /**
00832 *  @brief
00833 *    Export RTTI class (use in macro pl_class)
00834 *
00835 *  @remarks
00836 *    Use pl_rtti_import to mark a class as being imported by other libraries/applications (see pl_rtti_export).
00837 */
00838 #define pl_rtti_import 0
00839 
00840 /**
00841 *  @brief
00842 *    Declare class - internal (only for PLCore::Object)
00843 *
00844 *  @param[in] EXPORT
00845 *    Export definition (must be defined as either 1 or 0)
00846 *  @param[in] CLASS
00847 *    Class name (without namespace)
00848 *  @param[in] NAMESPACE
00849 *    Namespace
00850 *  @param[in] BASECLASS
00851 *    Base class name (with namespace)
00852 *  @param[in] DESCRIPTION
00853 *    Class description
00854 *
00855 *  @remarks
00856 *    This macro is only used for PLCore::Object. As this is the base class for all
00857 *    RTTI classes, the virtual function GetClass() can not be overwritten here.
00858 */
00859 #define pl_class_internal(EXPORT, CLASS, NAMESPACE, BASECLASS, DESCRIPTION) \
00860     __pl_class(CLASS, NAMESPACE, PLCore::ObjectBase, #BASECLASS, DESCRIPTION) \
00861     __pl_guard(CLASS) \
00862     __pl_getclass() \
00863     __pl_rtti_export(EXPORT) \
00864 
00865 /**
00866 *  @brief
00867 *    Begin class properties
00868 */
00869 #define pl_properties \
00870     __pl_prop_meth \
00871 
00872 /**
00873 *  @brief
00874 *    Declare class property
00875 *
00876 *  @param[in] NAME
00877 *    Property name
00878 *  @param[in] VALUE
00879 *    Property value
00880 */
00881 #define pl_property(NAME, VALUE) \
00882     __pl_prop_prop(NAME, VALUE) \
00883 
00884 /**
00885 *  @brief
00886 *    End class properties
00887 */
00888 #define pl_properties_end \
00889     __pl_prop_class_end \
00890 
00891 /**
00892 *  @brief
00893 *    Declare attribute
00894 *
00895 *  @param[in] NAME
00896 *    Attribute name
00897 *  @param[in] TYPE
00898 *    Attribute type
00899 *  @param[in] DEFAULT
00900 *    Attribute default value
00901 *  @param[in] ACCESS
00902 *    Attribute access type (ReadWrite/ReadOnly)
00903 *  @param[in] STORAGE
00904 *    Attribute storage type (DirectValue/GetSet/ModifyAttr)
00905 *  @param[in] DESCRIPTION
00906 *    Attribute description
00907 *  @param[in] ANNOTATION
00908 *    Attribute annotation
00909 */
00910 #define pl_attribute(NAME, TYPE, DEFAULT, ACCESS, STORAGE, DESCRIPTION, ANNOTATION) \
00911     __pl_attr_stor(NAME, TYPE, STORAGE) \
00912     __pl_attr_desc(NAME, TYPE, DEFAULT, DESCRIPTION, ANNOTATION) \
00913     __pl_attr_attr(NAME, TYPE, DEFAULT, ACCESS, STORAGE) \
00914     __pl_attr_decl(NAME, TYPE) \
00915 
00916 /**
00917 *  @brief
00918 *    Declare an enum type for an attribute
00919 *
00920 *  @param[in] ENUM
00921 *    Name of enum type
00922 */
00923 #define pl_enum_type(ENUM) PLCore::EnumType< ENUM##__plcore_enum__ >
00924 
00925 /**
00926 *  @brief
00927 *    Declare a flags type for an attribute
00928 *
00929 *  @param[in] ENUM
00930 *    Name of enum type
00931 */
00932 #define pl_flag_type(ENUM) PLCore::FlagType< ENUM##__plcore_enum__ >
00933 
00934 /**
00935 *  @brief
00936 *    Declare method
00937 *
00938 *  @param[in] NAME
00939 *    Method name
00940 *  @param[in] RET
00941 *    Return type
00942 *  @param[in] T0 - T15
00943 *    Parameter types
00944 *  @param[in] DESCRIPTION
00945 *    Method description
00946 *  @param[in] ANNOTATION
00947 *    Method annotation
00948 */
00949 #define pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
00950     private: /* RTTI class methods are private to avoid misuse */ \
00951     __pl_method_desc(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
00952     __pl_method_meth(NAME) \
00953     public: \
00954 
00955 #define pl_method_15(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, DESCRIPTION, ANNOTATION) \
00956     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, PLCore::NullType, DESCRIPTION, ANNOTATION)
00957 
00958 #define pl_method_14(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, DESCRIPTION, ANNOTATION) \
00959     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00960 
00961 #define pl_method_13(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, DESCRIPTION, ANNOTATION) \
00962     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00963 
00964 #define pl_method_12(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, DESCRIPTION, ANNOTATION) \
00965     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00966 
00967 #define pl_method_11(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, DESCRIPTION, ANNOTATION) \
00968     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00969 
00970 #define pl_method_10(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, DESCRIPTION, ANNOTATION) \
00971     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00972 
00973 #define pl_method_9(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, DESCRIPTION, ANNOTATION) \
00974     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, T8, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00975 
00976 #define pl_method_8(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, DESCRIPTION, ANNOTATION) \
00977     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, T6, T7, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00978 
00979 #define pl_method_7(NAME, RET, T0, T1, T2, T3, T4, T5, T6, DESCRIPTION, ANNOTATION) \
00980     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, T6, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00981 
00982 #define pl_method_6(NAME, RET, T0, T1, T2, T3, T4, T5, DESCRIPTION, ANNOTATION) \
00983     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, T5, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00984 
00985 #define pl_method_5(NAME, RET, T0, T1, T2, T3, T4, DESCRIPTION, ANNOTATION) \
00986     pl_method_16(NAME, RET, T0, T1, T2, T3, T4, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00987 
00988 #define pl_method_4(NAME, RET, T0, T1, T2, T3, DESCRIPTION, ANNOTATION) \
00989     pl_method_16(NAME, RET, T0, T1, T2, T3, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00990 
00991 #define pl_method_3(NAME, RET, T0, T1, T2, DESCRIPTION, ANNOTATION) \
00992     pl_method_16(NAME, RET, T0, T1, T2, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00993 
00994 #define pl_method_2(NAME, RET, T0, T1, DESCRIPTION, ANNOTATION) \
00995     pl_method_16(NAME, RET, T0, T1, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00996 
00997 #define pl_method_1(NAME, RET, T0, DESCRIPTION, ANNOTATION) \
00998     pl_method_16(NAME, RET, T0, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
00999 
01000 #define pl_method_0(NAME, RET, DESCRIPTION, ANNOTATION) \
01001     pl_method_16(NAME, RET, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01002 
01003 /**
01004 *  @brief
01005 *    Declare signal
01006 *
01007 *  @param[in] NAME
01008 *    Event name
01009 *  @param[in] T0 - T15
01010 *    Parameter types
01011 *  @param[in] DESCRIPTION
01012 *    Event description
01013 *  @param[in] ANNOTATION
01014 *    Event annotation
01015 */
01016 #define pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
01017     __pl_signal_desc(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
01018     __pl_signal_evnt(NAME) \
01019     __pl_signal_decl(NAME) \
01020 
01021 #define pl_signal_15(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, DESCRIPTION, ANNOTATION) \
01022     pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, PLCore::NullType, DESCRIPTION, ANNOTATION)
01023 
01024 #define pl_signal_14(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, DESCRIPTION, ANNOTATION) \
01025     pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01026 
01027 #define pl_signal_13(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, DESCRIPTION, ANNOTATION) \
01028     pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01029 
01030 #define pl_signal_12(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, DESCRIPTION, ANNOTATION) \
01031     pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01032 
01033 #define pl_signal_11(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, DESCRIPTION, ANNOTATION) \
01034     pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01035 
01036 #define pl_signal_10(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, DESCRIPTION, ANNOTATION) \
01037     pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01038 
01039 #define pl_signal_9(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, DESCRIPTION, ANNOTATION) \
01040     pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01041 
01042 #define pl_signal_8(NAME, T0, T1, T2, T3, T4, T5, T6, T7, DESCRIPTION, ANNOTATION) \
01043     pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01044 
01045 #define pl_signal_7(NAME, T0, T1, T2, T3, T4, T5, T6, DESCRIPTION, ANNOTATION) \
01046     pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, T6, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01047 
01048 #define pl_signal_6(NAME, T0, T1, T2, T3, T4, T5, DESCRIPTION, ANNOTATION) \
01049     pl_signal_16(NAME, T0, T1, T2, T3, T4, T5, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01050 
01051 #define pl_signal_5(NAME, T0, T1, T2, T3, T4, DESCRIPTION, ANNOTATION) \
01052     pl_signal_16(NAME, T0, T1, T2, T3, T4, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01053 
01054 #define pl_signal_4(NAME, T0, T1, T2, T3, DESCRIPTION, ANNOTATION) \
01055     pl_signal_16(NAME, T0, T1, T2, T3, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01056 
01057 #define pl_signal_3(NAME, T0, T1, T2, DESCRIPTION, ANNOTATION) \
01058     pl_signal_16(NAME, T0, T1, T2, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01059 
01060 #define pl_signal_2(NAME, T0, T1, DESCRIPTION, ANNOTATION) \
01061     pl_signal_16(NAME, T0, T1, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01062 
01063 #define pl_signal_1(NAME, T0, DESCRIPTION, ANNOTATION) \
01064     pl_signal_16(NAME, T0, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01065 
01066 #define pl_signal_0(NAME, DESCRIPTION, ANNOTATION) \
01067     pl_signal_16(NAME, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01068 
01069 /**
01070 *  @brief
01071 *    Declare slot
01072 *
01073 *  @param[in] NAME
01074 *    Event handler name
01075 *  @param[in] T0 - T15
01076 *    Parameter types
01077 *  @param[in] DESCRIPTION
01078 *    Event handler description
01079 *  @param[in] ANNOTATION
01080 *    Event handler annotation
01081 */
01082 #define pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
01083     __pl_slot_desc(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
01084     __pl_slot_evth(NAME) \
01085     __pl_slot_decl(NAME) \
01086 
01087 #define pl_slot_15(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, DESCRIPTION, ANNOTATION) \
01088     pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, PLCore::NullType, DESCRIPTION, ANNOTATION)
01089 
01090 #define pl_slot_14(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, DESCRIPTION, ANNOTATION) \
01091     pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01092 
01093 #define pl_slot_13(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, DESCRIPTION, ANNOTATION) \
01094     pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01095 
01096 #define pl_slot_12(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, DESCRIPTION, ANNOTATION) \
01097     pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01098 
01099 #define pl_slot_11(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, DESCRIPTION, ANNOTATION) \
01100     pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01101 
01102 #define pl_slot_10(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, DESCRIPTION, ANNOTATION) \
01103     pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01104 
01105 #define pl_slot_9(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, DESCRIPTION, ANNOTATION) \
01106     pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01107 
01108 #define pl_slot_8(NAME, T0, T1, T2, T3, T4, T5, T6, T7, DESCRIPTION, ANNOTATION) \
01109     pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01110 
01111 #define pl_slot_7(NAME, T0, T1, T2, T3, T4, T5, T6, DESCRIPTION, ANNOTATION) \
01112     pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, T6, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01113 
01114 #define pl_slot_6(NAME, T0, T1, T2, T3, T4, T5, DESCRIPTION, ANNOTATION) \
01115     pl_slot_16(NAME, T0, T1, T2, T3, T4, T5, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01116 
01117 #define pl_slot_5(NAME, T0, T1, T2, T3, T4, DESCRIPTION, ANNOTATION) \
01118     pl_slot_16(NAME, T0, T1, T2, T3, T4, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01119 
01120 #define pl_slot_4(NAME, T0, T1, T2, T3, DESCRIPTION, ANNOTATION) \
01121     pl_slot_16(NAME, T0, T1, T2, T3, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01122 
01123 #define pl_slot_3(NAME, T0, T1, T2, DESCRIPTION, ANNOTATION) \
01124     pl_slot_16(NAME, T0, T1, T2, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01125 
01126 #define pl_slot_2(NAME, T0, T1, DESCRIPTION, ANNOTATION) \
01127     pl_slot_16(NAME, T0, T1, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01128 
01129 #define pl_slot_1(NAME, T0, DESCRIPTION, ANNOTATION) \
01130     pl_slot_16(NAME, T0, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01131 
01132 #define pl_slot_0(NAME, DESCRIPTION, ANNOTATION) \
01133     pl_slot_16(NAME, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01134 
01135 /**
01136 *  @brief
01137 *    Declare constructor
01138 *
01139 *  @param[in] NAME
01140 *    Constructor name
01141 *  @param[in] T0 - T15
01142 *    Parameter types
01143 *  @param[in] DESCRIPTION
01144 *    Constructor  description
01145 *  @param[in] ANNOTATION
01146 *    Constructor  annotation
01147 */
01148 #define pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
01149     __pl_constructor_desc(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, DESCRIPTION, ANNOTATION) \
01150     __pl_constructor_cons(NAME) \
01151 
01152 #define pl_constructor_15(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, DESCRIPTION, ANNOTATION) \
01153     pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, PLCore::NullType, DESCRIPTION, ANNOTATION)
01154 
01155 #define pl_constructor_14(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, DESCRIPTION, ANNOTATION) \
01156     pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01157 
01158 #define pl_constructor_13(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, DESCRIPTION, ANNOTATION) \
01159     pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01160 
01161 #define pl_constructor_12(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, DESCRIPTION, ANNOTATION) \
01162     pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01163 
01164 #define pl_constructor_11(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, DESCRIPTION, ANNOTATION) \
01165     pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01166 
01167 #define pl_constructor_10(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, DESCRIPTION, ANNOTATION) \
01168     pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01169 
01170 #define pl_constructor_9(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, DESCRIPTION, ANNOTATION) \
01171     pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, T8, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01172 
01173 #define pl_constructor_8(NAME, T0, T1, T2, T3, T4, T5, T6, T7, DESCRIPTION, ANNOTATION) \
01174     pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, T6, T7, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01175 
01176 #define pl_constructor_7(NAME, T0, T1, T2, T3, T4, T5, T6, DESCRIPTION, ANNOTATION) \
01177     pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, T6, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01178 
01179 #define pl_constructor_6(NAME, T0, T1, T2, T3, T4, T5, DESCRIPTION, ANNOTATION) \
01180     pl_constructor_16(NAME, T0, T1, T2, T3, T4, T5, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01181 
01182 #define pl_constructor_5(NAME, T0, T1, T2, T3, T4, DESCRIPTION, ANNOTATION) \
01183     pl_constructor_16(NAME, T0, T1, T2, T3, T4, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01184 
01185 #define pl_constructor_4(NAME, T0, T1, T2, T3, DESCRIPTION, ANNOTATION) \
01186     pl_constructor_16(NAME, T0, T1, T2, T3, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01187 
01188 #define pl_constructor_3(NAME, T0, T1, T2, DESCRIPTION, ANNOTATION) \
01189     pl_constructor_16(NAME, T0, T1, T2, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01190 
01191 #define pl_constructor_2(NAME, T0, T1, DESCRIPTION, ANNOTATION) \
01192     pl_constructor_16(NAME, T0, T1, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01193 
01194 #define pl_constructor_1(NAME, T0, DESCRIPTION, ANNOTATION) \
01195     pl_constructor_16(NAME, T0, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01196 
01197 #define pl_constructor_0(NAME, DESCRIPTION, ANNOTATION) \
01198     pl_constructor_16(NAME, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, PLCore::NullType, DESCRIPTION, ANNOTATION)
01199 
01200 /**
01201 *  @brief
01202 *    Declare return type for a method
01203 *
01204 *  @param[in] RET
01205 *    Return type
01206 *
01207 *  @remarks
01208 *    This macro is there to provide a better readability of the RTTI declaration macros by marking the first type
01209 *    explicitly as a return type. Actually you don't need to use it, but it is recommended to do so :-)
01210 */
01211 #define pl_ret_type(RET) RET
01212 
01213 /**
01214 *  @brief
01215 *    End class declaration
01216 */
01217 #define pl_class_end
01218 
01219 /**
01220 *  @brief
01221 *    Define class
01222 *
01223 *  @param[in] CLASS
01224 *    Class name (without namespace)
01225 */
01226 #define pl_implement_class(CLASS) \
01227     __pl_class_impl(CLASS) \
01228 
01229 
01230 //[-------------------------------------------------------]
01231 //[ Namespace                                             ]
01232 //[-------------------------------------------------------]
01233 } // PLCore
01234 
01235 
01236 #endif // __PLCORE_RTTI_H__


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:00
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported