PixelLightAPI  .
Public Member Functions
PLCore::Class Class Reference

Description and interface for classes. More...

#include <Class.h>

List of all members.

Public Member Functions

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.
const ClassGetBaseClass () const
 Get base class.
bool IsDerivedFrom (const Class &cBaseClass) const
 Check if class is derived from another class.
bool IsDerivedFrom (const String &sBaseClass) const
 Check if class is derived from another class.
PLCORE_API void GetDerivedClasses (List< const Class * > &lstClasses) const
 Get derived classes.
const HashMap< String, String > & GetProperties () const
 Get properties.
const List< VarDesc * > & GetAttributes () const
 Get attributes.
const VarDescGetAttribute (const String &sName) const
 Get attribute.
const List< FuncDesc * > & GetMethods () const
 Get methods.
const FuncDescGetMethod (const String &sName) const
 Get method.
const List< EventDesc * > & GetSignals () const
 Get signals.
const EventDescGetSignal (const String &sName) const
 Get signal.
const List< EventHandlerDesc * > & GetSlots () const
 Get slot.
const EventHandlerDescGetSlot (const String &sName) const
 Get slot.
bool HasConstructor () const
 Check if class has any constructors.
bool HasDefaultConstructor () const
 Check if class has a default constructor.
const List< ConstructorDesc * > & GetConstructors () const
 Get constructors.
const ConstructorDescGetConstructor (const String &sName) const
 Get constructor.
ObjectCreate () const
 Create object by using the default constructor.
ObjectCreate (const DynParams &cParams) const
 Create object by using typed constructor parameters in order to identity the constructor automatically.
ObjectCreate (const String &sName, const DynParams &cParams) const
 Create object by using a given constructor name and typed constructor parameters.
ObjectCreate (const String &sName, const String &sParams) const
 Create object by using a given constructor name and typeless constructor parameters.

Detailed Description

Description and interface for classes.

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

Member Function Documentation

const Module * PLCore::Class::GetModule ( ) const [inline]

Get module the class belongs to.

Returns:
Module (always valid, do not destroy the returned instance!)
String PLCore::Class::GetClassName ( ) const [inline]

Get full class name (with namespace)

Returns:
Name of class and namespace

Get full name of base class (with namespace)

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

Get class name (without namespace)

Get class name.

Returns:
Name of class

Get class description.

Returns:
Description
String PLCore::Class::GetNamespace ( ) const [inline]

Get namespace.

Returns:
Namespace
const Class * PLCore::Class::GetBaseClass ( ) const [inline]

Get base class.

Returns:
Pointer to base class (can be a null pointer, do not destroy the returned instance!)
bool PLCore::Class::IsDerivedFrom ( const Class cBaseClass) const [inline]

Check if class is derived from another class.

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

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'
PLCORE_API void PLCore::Class::GetDerivedClasses ( List< const Class * > &  lstClasses) const

Get derived classes.

Parameters:
[out]lstClassesReceives the list of derived classes, given list is not cleared before adding new elements, do not destroy the returned instances!
Remarks:
This method always returns all sub-classes of a class. If you want to search for classes with more specific search criteria, have a look at ClassManager::GetClasses().
const HashMap< String, String > & PLCore::Class::GetProperties ( ) const [inline]

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"
const List< VarDesc * > & PLCore::Class::GetAttributes ( ) const [inline]

Get attributes.

Returns:
List of attribute descriptors, do not destroy the returned instances!
const VarDesc * PLCore::Class::GetAttribute ( const String sName) const [inline]

Get attribute.

Parameters:
[in]sNameAttribute name
Returns:
Attribute descriptor (can be a null pointer, if no member with that name could be found, do not destroy the returned instance!)
const List< FuncDesc * > & PLCore::Class::GetMethods ( ) const [inline]

Get methods.

Returns:
List of method descriptors, do not destroy the returned instances!
const FuncDesc * PLCore::Class::GetMethod ( const String sName) const [inline]

Get method.

Parameters:
[in]sNameMethod name
Returns:
Method descriptor (can be a null pointer, if no member with that name could be found, do not destroy the returned instance!)
const List< EventDesc * > & PLCore::Class::GetSignals ( ) const [inline]

Get signals.

Returns:
List of signal descriptors, do not destroy the returned instances!
const EventDesc * PLCore::Class::GetSignal ( const String sName) const [inline]

Get signal.

Parameters:
[in]sNameSignal name
Returns:
Signal descriptor (can be a null pointer, if no member with that name could be found, do not destroy the returned instance!)
const List< EventHandlerDesc * > & PLCore::Class::GetSlots ( ) const [inline]

Get slot.

Get slots.

Returns:
List of slot descriptors, do not destroy the returned instances!
const EventHandlerDesc * PLCore::Class::GetSlot ( const String sName) const [inline]

Get slot.

Parameters:
[in]sNameSlot name
Returns:
Slot descriptor (can be a null pointer, if no member with that name could be found, do not destroy the returned instance!)
bool PLCore::Class::HasConstructor ( ) const [inline]

Check if class has any constructors.

Returns:
'true' if class has at least one constructor, else 'false'
bool PLCore::Class::HasDefaultConstructor ( ) const [inline]

Check if class has a default constructor.

Returns:
'true' if class has a default constructor, else 'false'
const List< ConstructorDesc * > & PLCore::Class::GetConstructors ( ) const [inline]

Get constructors.

Returns:
List of constructor descriptors, do not destroy the returned instances!
const ConstructorDesc * PLCore::Class::GetConstructor ( const String sName) const [inline]

Get constructor.

Parameters:
[in]sNameConstructor name
Returns:
Constructor descriptor (can be a null pointer, if no member with that name could be found, do not destroy the returned instance!)
Object * PLCore::Class::Create ( ) const [inline]

Create object by using the default constructor.

Returns:
Pointer to created object (can be a null pointer, destroy the returned instance when you no longer need it)
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.
Object * PLCore::Class::Create ( const DynParams cParams) const [inline]

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, destroy the returned instance when you no longer need it)
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.
Object * PLCore::Class::Create ( const String sName,
const DynParams cParams 
) const [inline]

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, 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, or the given parameters do not match the signature of the constructor, the function will fail and return a null pointer.
Object * PLCore::Class::Create ( const String sName,
const String sParams 
) const [inline]

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.

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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:07
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported