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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:08:59
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported