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

Virtual base class for events. More...

#include <DynEvent.h>

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

List of all members.

Public Types

typedef Signature< void,
DynParams &, void * >
::FuncType 
FUNC

Public Member Functions

PLCORE_API DynEvent ()
 Constructor.
virtual PLCORE_API ~DynEvent ()
 Destructor.
PLCORE_API void Connect (DynEventHandler &cHandler)
 Connect event handler to the event.
PLCORE_API void Disconnect (DynEventHandler &cHandler)
 Disconnect event handler from the event.
uint32 GetNumOfConnects () const
 Return the number of connections.
virtual PLCORE_API const
EventDesc
GetDesc () const
 Get event descriptor.
virtual PLCORE_API
DynEventHandler
CreateGenericEventHandler (const FUNC &pFunc, void *pUserData=nullptr) const
 Create a generic event handler which is compatible with this dynamic event.
virtual PLCORE_API void Emit (DynParams &cParams) const
 Emit event.
virtual PLCORE_API void Emit (const DynParams &cParams) const
 Emit event.
virtual PLCORE_API void Emit (const String &sParams) const
 Emit event.
virtual PLCORE_API void Emit (const XmlElement &cElement) const
 Emit event.

Protected Attributes

SimpleList< DynEventHandler * > m_lstHandlers

Detailed Description

Virtual base class for events.

Remarks:
This is the virtual base class to access events dynamically.
Note:
  • Implementation of the observer design pattern (this class is the subject/observable, the source)

Member Typedef Documentation

typedef Signature<void, DynParams&, void*>::FuncType PLCore::DynEvent::FUNC

Constructor & Destructor Documentation

virtual PLCORE_API PLCore::DynEvent::~DynEvent ( ) [virtual]

Destructor.


Member Function Documentation

PLCORE_API void PLCore::DynEvent::Connect ( DynEventHandler cHandler)

Connect event handler to the event.

Parameters:
[in]cHandlerEvent handler
PLCORE_API void PLCore::DynEvent::Disconnect ( DynEventHandler cHandler)

Disconnect event handler from the event.

Parameters:
[in]cHandlerEvent handler
uint32 PLCore::DynEvent::GetNumOfConnects ( ) const [inline]

Return the number of connections.

Returns:
The number of connections
Note:
  • Don't use this method within performance critical situations because due internal implementation, this request has a linear, not constant runtime!
virtual PLCORE_API const EventDesc* PLCore::DynEvent::GetDesc ( ) const [virtual]

Get event descriptor.

Returns:
Descriptor (can be a null pointer)
virtual PLCORE_API DynEventHandler* PLCore::DynEvent::CreateGenericEventHandler ( const FUNC pFunc,
void *  pUserData = nullptr 
) const [virtual]

Create a generic event handler which is compatible with this dynamic event.

Parameters:
[in]pFuncFunction to be called by the dynamic event handler
[in]pUserDataOptional pointer to user data to pass on to the given generic function when the event was emitted, can be a null pointer
Returns:
The generic event handler which is compatible with this dynamic event, null pointer on error (delete the created instance if you no longer need it)
Note:
  • This method just creates an instance of the generic event handler and does not automatically connect it with this dynamic event
  • Use typed instead of generic event handlers whenever possible, this method only exists for situations were no type information is available at compile time

Reimplemented in PLCore::Event<>, PLCore::Event< T0 >, PLCore::Event< T0, T1 >, PLCore::Event< T0, T1, T2 >, PLCore::Event< T0, T1, T2, T3 >, PLCore::Event< T0, T1, T2, T3, T4 >, PLCore::Event< T0, T1, T2, T3, T4, T5 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 >, PLCore::Event< Effect & >, PLCore::Event< AbstractToggleButton * >, PLCore::Event< const PLMath::Vector2i & >, PLCore::Event< Material & >, PLCore::Event< const Class * >, PLCore::Event< Buffer & >, PLCore::Event< const Module * >, PLCore::Event< int >, PLCore::Event< Parameter & >, PLCore::Event< GraphPath & >, PLCore::Event< SceneRenderer & >, PLCore::Event< Widget * >, PLCore::Event< PLCore::uint32, const PLMath::Vector2i & >, PLCore::Event< const struct AInputEvent & >, PLCore::Event< Program * >, PLCore::Event< Graph & >, PLCore::Event< Mesh & >, PLCore::Event< AType & >, PLCore::Event< Skeleton & >, PLCore::Event< bool >, PLCore::Event< Texture & >, PLCore::Event< Controller *, PLCore::String >, and PLCore::Event< TabBarEntry * >.

virtual PLCORE_API void PLCore::DynEvent::Emit ( DynParams cParams) const [virtual]

Emit event.

Parameters:
[in]cParamsParameters

Reimplemented in PLCore::Event<>, PLCore::Event< T0 >, PLCore::Event< T0, T1 >, PLCore::Event< T0, T1, T2 >, PLCore::Event< T0, T1, T2, T3 >, PLCore::Event< T0, T1, T2, T3, T4 >, PLCore::Event< T0, T1, T2, T3, T4, T5 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 >, PLCore::Event< Effect & >, PLCore::Event< AbstractToggleButton * >, PLCore::Event< const PLMath::Vector2i & >, PLCore::Event< Material & >, PLCore::Event< const Class * >, PLCore::Event< Buffer & >, PLCore::Event< const Module * >, PLCore::Event< int >, PLCore::Event< Parameter & >, PLCore::Event< GraphPath & >, PLCore::Event< SceneRenderer & >, PLCore::Event< Widget * >, PLCore::Event< PLCore::uint32, const PLMath::Vector2i & >, PLCore::Event< const struct AInputEvent & >, PLCore::Event< Program * >, PLCore::Event< Graph & >, PLCore::Event< Mesh & >, PLCore::Event< AType & >, PLCore::Event< Skeleton & >, PLCore::Event< bool >, PLCore::Event< Texture & >, PLCore::Event< Controller *, PLCore::String >, and PLCore::Event< TabBarEntry * >.

virtual PLCORE_API void PLCore::DynEvent::Emit ( const DynParams cParams) const [virtual]

Emit event.

Parameters:
[in]cParamsParameters

Reimplemented in PLCore::Event<>, PLCore::Event< T0 >, PLCore::Event< T0, T1 >, PLCore::Event< T0, T1, T2 >, PLCore::Event< T0, T1, T2, T3 >, PLCore::Event< T0, T1, T2, T3, T4 >, PLCore::Event< T0, T1, T2, T3, T4, T5 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 >, PLCore::Event< Effect & >, PLCore::Event< AbstractToggleButton * >, PLCore::Event< const PLMath::Vector2i & >, PLCore::Event< Material & >, PLCore::Event< const Class * >, PLCore::Event< Buffer & >, PLCore::Event< const Module * >, PLCore::Event< int >, PLCore::Event< Parameter & >, PLCore::Event< GraphPath & >, PLCore::Event< SceneRenderer & >, PLCore::Event< Widget * >, PLCore::Event< PLCore::uint32, const PLMath::Vector2i & >, PLCore::Event< const struct AInputEvent & >, PLCore::Event< Program * >, PLCore::Event< Graph & >, PLCore::Event< Mesh & >, PLCore::Event< AType & >, PLCore::Event< Skeleton & >, PLCore::Event< bool >, PLCore::Event< Texture & >, PLCore::Event< Controller *, PLCore::String >, and PLCore::Event< TabBarEntry * >.

virtual PLCORE_API void PLCore::DynEvent::Emit ( const String sParams) const [virtual]

Emit event.

Parameters:
[in]sParamsParameters as string

Reimplemented in PLCore::Event<>, PLCore::Event< T0 >, PLCore::Event< T0, T1 >, PLCore::Event< T0, T1, T2 >, PLCore::Event< T0, T1, T2, T3 >, PLCore::Event< T0, T1, T2, T3, T4 >, PLCore::Event< T0, T1, T2, T3, T4, T5 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 >, PLCore::Event< Effect & >, PLCore::Event< AbstractToggleButton * >, PLCore::Event< const PLMath::Vector2i & >, PLCore::Event< Material & >, PLCore::Event< const Class * >, PLCore::Event< Buffer & >, PLCore::Event< const Module * >, PLCore::Event< int >, PLCore::Event< Parameter & >, PLCore::Event< GraphPath & >, PLCore::Event< SceneRenderer & >, PLCore::Event< Widget * >, PLCore::Event< PLCore::uint32, const PLMath::Vector2i & >, PLCore::Event< const struct AInputEvent & >, PLCore::Event< Program * >, PLCore::Event< Graph & >, PLCore::Event< Mesh & >, PLCore::Event< AType & >, PLCore::Event< Skeleton & >, PLCore::Event< bool >, PLCore::Event< Texture & >, PLCore::Event< Controller *, PLCore::String >, and PLCore::Event< TabBarEntry * >.

virtual PLCORE_API void PLCore::DynEvent::Emit ( const XmlElement cElement) const [virtual]

Emit event.

Parameters:
[in]cElementParameters as XML

Reimplemented in PLCore::Event<>, PLCore::Event< T0 >, PLCore::Event< T0, T1 >, PLCore::Event< T0, T1, T2 >, PLCore::Event< T0, T1, T2, T3 >, PLCore::Event< T0, T1, T2, T3, T4 >, PLCore::Event< T0, T1, T2, T3, T4, T5 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 >, PLCore::Event< T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 >, PLCore::Event< Effect & >, PLCore::Event< AbstractToggleButton * >, PLCore::Event< const PLMath::Vector2i & >, PLCore::Event< Material & >, PLCore::Event< const Class * >, PLCore::Event< Buffer & >, PLCore::Event< const Module * >, PLCore::Event< int >, PLCore::Event< Parameter & >, PLCore::Event< GraphPath & >, PLCore::Event< SceneRenderer & >, PLCore::Event< Widget * >, PLCore::Event< PLCore::uint32, const PLMath::Vector2i & >, PLCore::Event< const struct AInputEvent & >, PLCore::Event< Program * >, PLCore::Event< Graph & >, PLCore::Event< Mesh & >, PLCore::Event< AType & >, PLCore::Event< Skeleton & >, PLCore::Event< bool >, PLCore::Event< Texture & >, PLCore::Event< Controller *, PLCore::String >, and PLCore::Event< TabBarEntry * >.


Member Data Documentation

List of event handlers


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:04
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported