PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: ConstructorDesc.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_CONSTRUCTORDESC_H__ 00024 #define __PLCORE_CONSTRUCTORDESC_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLCore/Base/MemberDesc.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLCore { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Forward declarations ] 00042 //[-------------------------------------------------------] 00043 class Object; 00044 class DynFunc; 00045 class DynParams; 00046 00047 00048 //[-------------------------------------------------------] 00049 //[ Classes ] 00050 //[-------------------------------------------------------] 00051 /** 00052 * @brief 00053 * Constructor descriptor 00054 * 00055 * @remarks 00056 * This class contains a descriptor for a specific constructor of a class 00057 */ 00058 class ConstructorDesc : public MemberDesc { 00059 00060 00061 //[-------------------------------------------------------] 00062 //[ Public functions ] 00063 //[-------------------------------------------------------] 00064 public: 00065 /** 00066 * @brief 00067 * Constructor 00068 * 00069 * @param[in] sSignature 00070 * Signature 00071 * @param[in] sName 00072 * Name 00073 * @param[in] sDescription 00074 * Description 00075 * @param[in] sAnnotation 00076 * Annotation 00077 */ 00078 PLCORE_API ConstructorDesc(const String &sSignature, const String &sName, const String &sDescription, const String &sAnnotation); 00079 00080 /** 00081 * @brief 00082 * Destructor 00083 */ 00084 PLCORE_API virtual ~ConstructorDesc(); 00085 00086 /** 00087 * @brief 00088 * Initialize instance 00089 * 00090 * @remarks 00091 * This method is just here to ensure, that the compiler will actually create static instances 00092 */ 00093 PLCORE_API void Dummy(); 00094 00095 /** 00096 * @brief 00097 * Get signature 00098 * 00099 * @return 00100 * Signature 00101 */ 00102 inline String GetSignature() const; 00103 00104 /** 00105 * @brief 00106 * Check if this is a default constructor 00107 * 00108 * @return 00109 * 'true' if the constructor is a default constructor, else 'false' 00110 */ 00111 inline bool IsDefaultConstructor() const; 00112 00113 00114 //[-------------------------------------------------------] 00115 //[ Public virtual ConstructorDesc functions ] 00116 //[-------------------------------------------------------] 00117 public: 00118 /** 00119 * @brief 00120 * Get constructor 00121 * 00122 * @return 00123 * Pointer to constructor (can be a null pointer) 00124 */ 00125 PLCORE_API virtual DynFunc *GetConstructor() const; 00126 00127 /** 00128 * @brief 00129 * Create object by using typed constructor parameters 00130 * 00131 * @param[in] cParams 00132 * Constructor parameters 00133 * 00134 * @return 00135 * Pointer to new object (can be a null pointer) 00136 */ 00137 PLCORE_API virtual Object *Create(const DynParams &cParams); 00138 00139 /** 00140 * @brief 00141 * Create object by using typeless constructor parameters 00142 * 00143 * @param[in] sParams 00144 * Constructor parameters 00145 * 00146 * @return 00147 * Pointer to new object (can be a null pointer) 00148 */ 00149 PLCORE_API virtual Object *Create(const String &sParams); 00150 00151 00152 //[-------------------------------------------------------] 00153 //[ Protected data ] 00154 //[-------------------------------------------------------] 00155 protected: 00156 String m_sSignature; /**< Signature */ 00157 00158 00159 }; 00160 00161 00162 //[-------------------------------------------------------] 00163 //[ Namespace ] 00164 //[-------------------------------------------------------] 00165 } // PLCore 00166 00167 00168 //[-------------------------------------------------------] 00169 //[ Implementation ] 00170 //[-------------------------------------------------------] 00171 #include "PLCore/Base/Func/ConstructorDesc.inl" 00172 00173 00174 #endif // __PLCORE_CONSTRUCTORDESC_H__
|