PixelLightAPI  .
ClassReal.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: ClassReal.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_REAL_H__
00024 #define __PLCORE_CLASS_REAL_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 *    Real 'Class' implementation
00046 *
00047 *  @note
00048 *    - The class instance is created and destroyed automatically by the RTTI system (see "pl_class"-macro)
00049 */
00050 class ClassReal : public ClassImpl {
00051 
00052 
00053     //[-------------------------------------------------------]
00054     //[ Friends                                               ]
00055     //[-------------------------------------------------------]
00056     friend class MemberDesc;
00057     friend class ClassManager;
00058 
00059 
00060     //[-------------------------------------------------------]
00061     //[ Protected virtual ClassImpl functions                 ]
00062     //[-------------------------------------------------------]
00063     protected:
00064         PLCORE_API virtual bool IsDummy() const override;
00065         PLCORE_API virtual void InitClass() const override;
00066         PLCORE_API virtual void DeInitClass() const override;
00067         PLCORE_API virtual const List<VarDesc*> &GetAttributes() const override;
00068         PLCORE_API virtual const VarDesc *GetAttribute(const String &sName) const override;
00069         PLCORE_API virtual const List<FuncDesc*> &GetMethods() const override;
00070         PLCORE_API virtual const FuncDesc *GetMethod(const String &sName) const override;
00071         PLCORE_API virtual const List<EventDesc*> &GetSignals() const override;
00072         PLCORE_API virtual const EventDesc *GetSignal(const String &sName) const override;
00073         PLCORE_API virtual const List<EventHandlerDesc*> &GetSlots() const override;
00074         PLCORE_API virtual const EventHandlerDesc *GetSlot(const String &sName) const override;
00075         PLCORE_API virtual bool HasConstructor() const override;
00076         PLCORE_API virtual bool HasDefaultConstructor() const override;
00077         PLCORE_API virtual const List<ConstructorDesc*> &GetConstructors() const override;
00078         PLCORE_API virtual const ConstructorDesc *GetConstructor(const String &sName) const override;
00079         PLCORE_API virtual Object *Create() const override;
00080         PLCORE_API virtual Object *Create(const DynParams &cParams) const override;
00081         PLCORE_API virtual Object *Create(const String &sName, const DynParams &cParams) const override;
00082         PLCORE_API virtual Object *Create(const String &sName, const String &sParams) const override;
00083 
00084 
00085     //[-------------------------------------------------------]
00086     //[ Protected functions                                   ]
00087     //[-------------------------------------------------------]
00088     protected:
00089         /**
00090         *  @brief
00091         *    Constructor
00092         *
00093         *  @param[in] nModuleID
00094         *    ID of owner module
00095         *  @param[in] sName
00096         *    Name
00097         *  @param[in] sDescription
00098         *    Description
00099         *  @param[in] sNamespace
00100         *    Namespace
00101         *  @param[in] sBaseClass
00102         *    Base class
00103         */
00104         PLCORE_API ClassReal(uint32 nModuleID, const String &sName, const String &sDescription, const String &sNamespace, const String &sBaseClass);
00105 
00106         /**
00107         *  @brief
00108         *    Destructor
00109         */
00110         PLCORE_API virtual ~ClassReal();
00111 
00112 
00113     //[-------------------------------------------------------]
00114     //[ Protected functions                                   ]
00115     //[-------------------------------------------------------]
00116     protected:
00117         /**
00118         *  @brief
00119         *    Add member
00120         *
00121         *  @param[in] pMemberDesc
00122         *    Member descriptor
00123         */
00124         PLCORE_API void AddMember(MemberDesc *pMemberDesc);
00125 
00126 
00127     //[-------------------------------------------------------]
00128     //[ Protected data                                        ]
00129     //[-------------------------------------------------------]
00130     protected:
00131         // Own data (does not include data from base classes)
00132         List<MemberDesc*>                       m_lstOwnMembers;    /**< List of members */
00133         // Member lists (also including the members from base classes)
00134         mutable HashMap<String, MemberDesc*>    m_mapMembers;       /**< Hash map of names -> members */
00135         mutable List<VarDesc*>                  m_lstAttributes;    /**< List of attributes */
00136         mutable List<FuncDesc*>                 m_lstMethods;       /**< List of methods */
00137         mutable List<EventDesc*>                m_lstSignals;       /**< List of signals */
00138         mutable List<EventHandlerDesc*>         m_lstSlots;         /**< List of slots */
00139         mutable List<ConstructorDesc*>          m_lstConstructors;  /**< List of constructors */
00140 
00141 
00142 };
00143 
00144 
00145 //[-------------------------------------------------------]
00146 //[ Namespace                                             ]
00147 //[-------------------------------------------------------]
00148 } // PLCore
00149 
00150 
00151 #endif // __PLCORE_CLASS_REAL_H__


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