PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: FuncDesc.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_FUNCDESC_H__ 00024 #define __PLCORE_FUNCDESC_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLCore/Base/Func/DynFunc.h" 00032 #include "PLCore/Base/MemberDesc.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLCore { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Forward declarations ] 00043 //[-------------------------------------------------------] 00044 class Object; 00045 00046 00047 //[-------------------------------------------------------] 00048 //[ Classes ] 00049 //[-------------------------------------------------------] 00050 /** 00051 * @brief 00052 * Function descriptor 00053 * 00054 * @remarks 00055 * This class contains a descriptor for a method and consists of information 00056 * belonging to a specific method, such as it's name and signature. 00057 */ 00058 class FuncDesc : public MemberDesc { 00059 00060 00061 //[-------------------------------------------------------] 00062 //[ Public functions ] 00063 //[-------------------------------------------------------] 00064 public: 00065 /** 00066 * @brief 00067 * Constructor 00068 * 00069 * @param[in] sSignature 00070 * Function signature 00071 * @param[in] sName 00072 * Function name 00073 * @param[in] sDescription 00074 * Function description 00075 * @param[in] sAnnotation 00076 * Function annotation 00077 */ 00078 PLCORE_API FuncDesc(const String &sSignature, const String &sName, const String &sDescription, const String &sAnnotation); 00079 00080 /** 00081 * @brief 00082 * Destructor 00083 */ 00084 PLCORE_API virtual ~FuncDesc(); 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 //[-------------------------------------------------------] 00106 //[ Public virtual FuncDesc functions ] 00107 //[-------------------------------------------------------] 00108 public: 00109 /** 00110 * @brief 00111 * Get callable method 00112 * 00113 * @param[in] cObject 00114 * RTTI class instance 00115 * 00116 * @return 00117 * Smart pointer to callable method (can be a null pointer) 00118 * 00119 * @note 00120 * - The default implementations returns a null pointer 00121 */ 00122 PLCORE_API virtual DynFuncPtr GetMethod(Object &cObject) const; 00123 00124 00125 //[-------------------------------------------------------] 00126 //[ Protected data ] 00127 //[-------------------------------------------------------] 00128 protected: 00129 String m_sSignature; /**< Signature */ 00130 00131 00132 }; 00133 00134 00135 //[-------------------------------------------------------] 00136 //[ Namespace ] 00137 //[-------------------------------------------------------] 00138 } // PLCore 00139 00140 00141 //[-------------------------------------------------------] 00142 //[ Implementation ] 00143 //[-------------------------------------------------------] 00144 #include "PLCore/Base/Func/FuncDesc.inl" 00145 00146 00147 #endif // __PLCORE_FUNCDESC_H__
|