PixelLightAPI  .
Public Member Functions | Protected Member Functions | Protected Attributes
PLCore::ClassImpl Class Reference

Abstract class implementation base class. More...

#include <ClassImpl.h>

Inheritance diagram for PLCore::ClassImpl:
Inheritance graph
[legend]

List of all members.

Public Member Functions

ClassGetClass () const
 Return the pointer to the owner class instance wrapping this class implementation.

Protected Member Functions

PLCORE_API ClassImpl (uint32 nModuleID, const String &sName, const String &sDescription, const String &sNamespace, const String &sBaseClass)
 Constructor.
virtual PLCORE_API ~ClassImpl ()
 Destructor.
PLCORE_API const ModuleGetModule () const
 Get module the class belongs to.
String GetClassName () const
 Get full class name (with namespace)
String GetBaseClassName () const
 Get full name of base class (with namespace)
String GetName () const
 Get class name (without namespace)
String GetDescription () const
 Get class description.
String GetNamespace () const
 Get namespace.
PLCORE_API const ClassGetBaseClass () const
 Get base class.
PLCORE_API bool IsDerivedFrom (const Class &cBaseClass) const
 Check if class is derived from another class.
PLCORE_API bool IsDerivedFrom (const String &sBaseClass) const
 Check if class is derived from another class.
const HashMap< String, String > & GetProperties () const
 Get properties.
PLCORE_API void AddProperty (const String &sName, const String &sValue)
 Add property.
virtual bool IsDummy () const =0
 Return whether or not the class implementation is a dummy used for delayed shared library loading.
virtual void InitClass () const =0
 Initialize class and class members.
virtual void DeInitClass () const =0
 De-Initialize class and class members.
virtual const List< VarDesc * > & GetAttributes () const =0
 Get attributes.
virtual const VarDescGetAttribute (const String &sName) const =0
 Get attribute.
virtual const List< FuncDesc * > & GetMethods () const =0
 Get methods.
virtual const FuncDescGetMethod (const String &sName) const =0
 Get method.
virtual const List< EventDesc * > & GetSignals () const =0
 Get signals.
virtual const EventDescGetSignal (const String &sName) const =0
 Get signal.
virtual const List
< EventHandlerDesc * > & 
GetSlots () const =0
 Get slot.
virtual const EventHandlerDescGetSlot (const String &sName) const =0
 Get slot.
virtual bool HasConstructor () const =0
 Check if class has any constructors.
virtual bool HasDefaultConstructor () const =0
 Check if class has a default constructor.
virtual const List
< ConstructorDesc * > & 
GetConstructors () const =0
 Get constructors.
virtual const ConstructorDescGetConstructor (const String &sName) const =0
 Get constructor.
virtual ObjectCreate () const =0
 Create object by using the default constructor.
virtual ObjectCreate (const DynParams &cParams) const =0
 Create object by using typed constructor parameters in order to identity the constructor automatically.
virtual ObjectCreate (const String &sName, const DynParams &cParams) const =0
 Create object by using a given constructor name and typed constructor parameters.
virtual ObjectCreate (const String &sName, const String &sParams) const =0
 Create object by using a given constructor name and typeless constructor parameters.

Protected Attributes

Classm_pClass
String m_sName
String m_sNamespace
String m_sClassName
String m_sDescription
String m_sBaseClass
HashMap< String, Stringm_mapOwnProperties
uint32 m_nModuleID
bool m_bInitialized
const Classm_pBaseClass
HashMap< String, Stringm_mapProperties

Detailed Description

Abstract class implementation base class.

Note:
  • Implementation of the bridge design pattern, this class is the implementor of the 'Class' abstraction

Constructor & Destructor Documentation

PLCORE_API PLCore::ClassImpl::ClassImpl ( uint32  nModuleID,
const String sName,
const String sDescription,
const String sNamespace,
const String sBaseClass 
) [protected]

Constructor.

Parameters:
[in]nModuleIDID of owner module
[in]sNameName
[in]sDescriptionDescription
[in]sNamespaceNamespace
[in]sBaseClassBase class
virtual PLCORE_API PLCore::ClassImpl::~ClassImpl ( ) [protected, virtual]

Destructor.


Member Function Documentation

Class * PLCore::ClassImpl::GetClass ( ) const [inline]

Return the pointer to the owner class instance wrapping this class implementation.

Returns:
Pointer to the owner class instance (should never be a null pointer, unless something is *terribly* wrong ;-) )
PLCORE_API const Module* PLCore::ClassImpl::GetModule ( ) const [protected]

Get module the class belongs to.

Returns:
Module (always valid)
String PLCore::ClassImpl::GetClassName ( ) const [inline, protected]

Get full class name (with namespace)

Returns:
Name of class and namespace
String PLCore::ClassImpl::GetBaseClassName ( ) const [inline, protected]

Get full name of base class (with namespace)

Returns:
Name of base class and namespace
String PLCore::ClassImpl::GetName ( ) const [inline, protected]

Get class name (without namespace)

Returns:
Name of class
String PLCore::ClassImpl::GetDescription ( ) const [inline, protected]

Get class description.

Returns:
Description
String PLCore::ClassImpl::GetNamespace ( ) const [inline, protected]

Get namespace.

Returns:
Namespace
PLCORE_API const Class* PLCore::ClassImpl::GetBaseClass ( ) const [protected]

Get base class.

Returns:
Pointer to base class (can be a null pointer)
PLCORE_API bool PLCore::ClassImpl::IsDerivedFrom ( const Class cBaseClass) const [protected]

Check if class is derived from another class.

Parameters:
[in]cBaseClassBase class
Returns:
'true' if class is derived from given base class, else 'false'
PLCORE_API bool PLCore::ClassImpl::IsDerivedFrom ( const String sBaseClass) const [protected]

Check if class is derived from another class.

Parameters:
[in]sBaseClassBase class name (with namespace)
Returns:
'true' if class is derived from given base class, else 'false'
const HashMap< String, String > & PLCore::ClassImpl::GetProperties ( ) const [inline, protected]

Get properties.

Returns:
Hash map of properties (name -> value)
Remarks:
A property is a name/value pair of strings, that can be assigned to a class. Use this to transport additional information for your class, e.g. "PluginType" -> "Widget" "FileFormats" -> "avi mpg mp4"
PLCORE_API void PLCore::ClassImpl::AddProperty ( const String sName,
const String sValue 
) [protected]

Add property.

Parameters:
[in]sNameProperty name
[in]sValueProperty value
virtual bool PLCore::ClassImpl::IsDummy ( ) const [protected, pure virtual]

Return whether or not the class implementation is a dummy used for delayed shared library loading.

Returns:
'true' if the class implementation is a dummy used for delayed shared library loading, else 'false'

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual void PLCore::ClassImpl::InitClass ( ) const [protected, pure virtual]

Initialize class and class members.

Remarks:
This function is called automatically when it is necessary, e.g. the first time any members are being accessed. It will search for the base class of the class and initialize all members. If later a class is changed (e.g. a new member is registered at one of the base classes), that class and all derived classes will destroy their information and must be initialized again.

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual void PLCore::ClassImpl::DeInitClass ( ) const [protected, pure virtual]

De-Initialize class and class members.

Remarks:
This function destroys all data about the class and it's members. See InitClass() for more information about why this is necessary and when.

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual const List<VarDesc*>& PLCore::ClassImpl::GetAttributes ( ) const [protected, pure virtual]

Get attributes.

Returns:
List of attribute descriptors

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual const VarDesc* PLCore::ClassImpl::GetAttribute ( const String sName) const [protected, pure virtual]

Get attribute.

Parameters:
[in]sNameAttribute name
Returns:
Attribute descriptor (can be a null pointer, if no member with that name could be found)

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual const List<FuncDesc*>& PLCore::ClassImpl::GetMethods ( ) const [protected, pure virtual]

Get methods.

Returns:
List of method descriptors

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual const FuncDesc* PLCore::ClassImpl::GetMethod ( const String sName) const [protected, pure virtual]

Get method.

Parameters:
[in]sNameMethod name
Returns:
Method descriptor (can be a null pointer, if no member with that name could be found)

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual const List<EventDesc*>& PLCore::ClassImpl::GetSignals ( ) const [protected, pure virtual]

Get signals.

Returns:
List of signal descriptors

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual const EventDesc* PLCore::ClassImpl::GetSignal ( const String sName) const [protected, pure virtual]

Get signal.

Parameters:
[in]sNameSignal name
Returns:
Signal descriptor (can be a null pointer, if no member with that name could be found)

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual const List<EventHandlerDesc*>& PLCore::ClassImpl::GetSlots ( ) const [protected, pure virtual]

Get slot.

Returns:
List of slot descriptors

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual const EventHandlerDesc* PLCore::ClassImpl::GetSlot ( const String sName) const [protected, pure virtual]

Get slot.

Parameters:
[in]sNameSlot name
Returns:
Slot descriptor (can be a null pointer, if no member with that name could be found)

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual bool PLCore::ClassImpl::HasConstructor ( ) const [protected, pure virtual]

Check if class has any constructors.

Returns:
'true' if class has at least one constructor, else 'false'

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual bool PLCore::ClassImpl::HasDefaultConstructor ( ) const [protected, pure virtual]

Check if class has a default constructor.

Returns:
'true' if class has a default constructor, else 'false'

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual const List<ConstructorDesc*>& PLCore::ClassImpl::GetConstructors ( ) const [protected, pure virtual]

Get constructors.

Returns:
List of constructor descriptors

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual const ConstructorDesc* PLCore::ClassImpl::GetConstructor ( const String sName) const [protected, pure virtual]

Get constructor.

Parameters:
[in]sNameConstructor name
Returns:
Constructor descriptor (can be a null pointer, if no member with that name could be found)

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual Object* PLCore::ClassImpl::Create ( ) const [protected, pure virtual]

Create object by using the default constructor.

Returns:
Pointer to created object (can be a null pointer)
Remarks:
This function will call the default constructor of the class. If the class has no default constructor, the function will fail and return a null pointer.

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual Object* PLCore::ClassImpl::Create ( const DynParams cParams) const [protected, pure virtual]

Create object by using typed constructor parameters in order to identity the constructor automatically.

Parameters:
[in]cParamsConstructor parameters
Returns:
Pointer to created object (can be a null pointer)
Remarks:
This function will search for a constructor that matches the signature of the given parameters. If no such constructor can be found, the function will fail and return a null pointer.

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual Object* PLCore::ClassImpl::Create ( const String sName,
const DynParams cParams 
) const [protected, pure virtual]

Create object by using a given constructor name and typed constructor parameters.

Parameters:
[in]sNameConstructor name
[in]cParamsConstructor parameters
Returns:
Pointer to created object (can be a null pointer)
Remarks:
This function will search for a constructor with the specified name. If no such constructor can be found, or the given parameters do not match the signature of the constructor, the function will fail and return a null pointer.

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.

virtual Object* PLCore::ClassImpl::Create ( const String sName,
const String sParams 
) const [protected, pure virtual]

Create object by using a given constructor name and typeless constructor parameters.

Parameters:
[in]sNameConstructor name
[in]sParamsConstructor parameters
Returns:
Pointer to created object (can be a null pointer, destroy the returned instance when you no longer need it)
Remarks:
This function will search for a constructor with the specified name. If no such constructor can be found, the function will fail and return a null pointer.

Implemented in PLCore::ClassReal, and PLCore::ClassDummy.


Member Data Documentation

Class instance wrapping this class implementation (can be a null pointer, set and managed by the class manager)

Name of class

Namespace of class

Name of class (with namespace)

Description of class

Name of base class (with namespace)

Hash map of properties (name -> value)

uint32 PLCore::ClassImpl::m_nModuleID [mutable, protected]

ID of owner module

bool PLCore::ClassImpl::m_bInitialized [mutable, protected]

Is the class initialized?

const Class* PLCore::ClassImpl::m_pBaseClass [mutable, protected]

Pointer to base class

Hash map of properties (name -> value)


The documentation for this class was generated from the following files:


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