PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: EventDesc.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_EVENTDESC_H__ 00024 #define __PLCORE_EVENTDESC_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 DynEvent; 00045 00046 00047 //[-------------------------------------------------------] 00048 //[ Classes ] 00049 //[-------------------------------------------------------] 00050 /** 00051 * @brief 00052 * Event descriptor 00053 * 00054 * @remarks 00055 * This class contains a descriptor for an event and consists of information 00056 * belonging to a specific event, such as it's name and signature. 00057 */ 00058 class EventDesc : 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 EventDesc(const String &sSignature, const String &sName, const String &sDescription, const String &sAnnotation); 00079 00080 /** 00081 * @brief 00082 * Destructor 00083 */ 00084 PLCORE_API virtual ~EventDesc(); 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 EventDesc functions ] 00107 //[-------------------------------------------------------] 00108 public: 00109 /** 00110 * @brief 00111 * Get signal 00112 * 00113 * @param[in] cObject 00114 * Object to return the signal pointer from 00115 * 00116 * @return 00117 * Pointer to signal (can be a null pointer, do not destroy the returned instance) 00118 */ 00119 PLCORE_API virtual DynEvent *GetSignal(const Object &cObject) const; 00120 00121 00122 //[-------------------------------------------------------] 00123 //[ Protected data ] 00124 //[-------------------------------------------------------] 00125 protected: 00126 String m_sSignature; /**< Signature */ 00127 00128 00129 }; 00130 00131 00132 //[-------------------------------------------------------] 00133 //[ Namespace ] 00134 //[-------------------------------------------------------] 00135 } // PLCore 00136 00137 00138 //[-------------------------------------------------------] 00139 //[ Implementation ] 00140 //[-------------------------------------------------------] 00141 #include "PLCore/Base/Event/EventDesc.inl" 00142 00143 00144 #endif // __PLCORE_EVENTDESC_H__
|