PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: ClassDummy.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_CLASS_DUMMY_H__ 00024 #define __PLCORE_CLASS_DUMMY_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLCore/Base/ClassImpl.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLCore { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * Dummy 'Class' implementation 00046 */ 00047 class ClassDummy : public ClassImpl { 00048 00049 00050 //[-------------------------------------------------------] 00051 //[ Friends ] 00052 //[-------------------------------------------------------] 00053 friend class ClassManager; 00054 00055 00056 //[-------------------------------------------------------] 00057 //[ Protected virtual ClassImpl functions ] 00058 //[-------------------------------------------------------] 00059 protected: 00060 virtual bool IsDummy() const override; 00061 virtual void InitClass() const override; 00062 virtual void DeInitClass() const override; 00063 virtual const List<VarDesc*> &GetAttributes() const override; 00064 virtual const VarDesc *GetAttribute(const String &sName) const override; 00065 virtual const List<FuncDesc*> &GetMethods() const override; 00066 virtual const FuncDesc *GetMethod(const String &sName) const override; 00067 virtual const List<EventDesc*> &GetSignals() const override; 00068 virtual const EventDesc *GetSignal(const String &sName) const override; 00069 virtual const List<EventHandlerDesc*> &GetSlots() const override; 00070 virtual const EventHandlerDesc *GetSlot(const String &sName) const override; 00071 virtual bool HasConstructor() const override; 00072 virtual bool HasDefaultConstructor() const override; 00073 virtual const List<ConstructorDesc*> &GetConstructors() const override; 00074 virtual const ConstructorDesc *GetConstructor(const String &sName) const override; 00075 virtual Object *Create() const override; 00076 virtual Object *Create(const DynParams &cParams) const override; 00077 virtual Object *Create(const String &sName, const DynParams &cParams) const override; 00078 virtual Object *Create(const String &sName, const String &sParams) const override; 00079 00080 00081 //[-------------------------------------------------------] 00082 //[ Private functions ] 00083 //[-------------------------------------------------------] 00084 private: 00085 /** 00086 * @brief 00087 * Constructor 00088 * 00089 * @param[in] nModuleID 00090 * ID of owner module 00091 * @param[in] sName 00092 * Name 00093 * @param[in] sDescription 00094 * Description 00095 * @param[in] sNamespace 00096 * Namespace 00097 * @param[in] sBaseClass 00098 * Base class 00099 * @param[in] bHasConstructor 00100 * Class has any constructors? 00101 * @param[in] bHasDefaultConstructor 00102 * Class has a default constructor? 00103 */ 00104 ClassDummy(uint32 nModuleID, const String &sName, const String &sDescription, const String &sNamespace, const String &sBaseClass, bool bHasConstructor, bool bHasDefaultConstructor); 00105 00106 /** 00107 * @brief 00108 * Destructor 00109 */ 00110 virtual ~ClassDummy(); 00111 00112 /* 00113 * @brief 00114 * Requests the real class implementation 00115 * 00116 * @return 00117 * The real class implementation if all went fine, else a null pointer 00118 * 00119 * @note 00120 * - Please note that it's not valid to use this dummy class implementation after this method was call because it may have been killed! 00121 */ 00122 ClassImpl *GetRealClassImpl() const; 00123 00124 00125 //[-------------------------------------------------------] 00126 //[ Private static data ] 00127 //[-------------------------------------------------------] 00128 private: 00129 // Member lists (also including the members from base classes) - static because those are just dummies in here 00130 static HashMap<String, MemberDesc*> m_mapMembers; /**< Hash map of names -> members */ 00131 static List<VarDesc*> m_lstAttributes; /**< List of attributes */ 00132 static List<FuncDesc*> m_lstMethods; /**< List of methods */ 00133 static List<EventDesc*> m_lstSignals; /**< List of signals */ 00134 static List<EventHandlerDesc*> m_lstSlots; /**< List of slots */ 00135 static List<ConstructorDesc*> m_lstConstructors; /**< List of constructors */ 00136 00137 00138 //[-------------------------------------------------------] 00139 //[ Private data ] 00140 //[-------------------------------------------------------] 00141 private: 00142 bool m_bHasConstructor; /**< Class has any constructors? */ 00143 bool m_bHasDefaultConstructor; /**< Class has a default constructor? */ 00144 00145 00146 }; 00147 00148 00149 //[-------------------------------------------------------] 00150 //[ Namespace ] 00151 //[-------------------------------------------------------] 00152 } // PLCore 00153 00154 00155 #endif // __PLCORE_CLASS_DUMMY_H__
|