Code::Blocks  SVN r11506
Public Types | Public Member Functions | Protected Attributes | List of all members
ProjectLoaderHooks::HookFunctor< T > Class Template Reference

Functor class for use as a project loading/saving hook. More...

#include <projectloader_hooks.h>

Inheritance diagram for ProjectLoaderHooks::HookFunctor< T >:
Collaboration diagram for ProjectLoaderHooks::HookFunctor< T >:

Public Types

typedef void(T::* Func) (cbProject *, TiXmlElement *, bool)
 

Public Member Functions

 HookFunctor (T *obj, Func func)
 
void Call (cbProject *project, TiXmlElement *elem, bool isLoading) const override
 
- Public Member Functions inherited from ProjectLoaderHooks::HookFunctorBase
virtual ~HookFunctorBase ()
 

Protected Attributes

T * m_pObj
 
Func m_pFunc
 

Detailed Description

template<class T>
class ProjectLoaderHooks::HookFunctor< T >

Functor class for use as a project loading/saving hook.

Passed as the first parameter in RegisterHook() and UnregisterHook().

example: ProjectLoaderHooks::HookFunctorBase* myhook = new ProjectLoaderHooks::HookFunctor<MyClass>(this, &MyClass::OnHookCalled); int id = ProjectLoaderHooks::RegisterHook(myhook); ... (and before your class' destruction - or earlier): ProjectLoaderHooks::UnregisterHook(id, true);

Member functions used as hook callbacks must have the following signature: void YourFunctionName(cbProject*, TiXmlElement*, bool)

Use normal TinyXML procedures to work with the TiXmlElement* argument. The isLoading argument is true if your hook is called when the project is being loaded, and false when the project is saved.

Definition at line 43 of file projectloader_hooks.h.

Member Typedef Documentation

◆ Func

template<class T>
typedef void(T::* ProjectLoaderHooks::HookFunctor< T >::Func) (cbProject *, TiXmlElement *, bool)

Definition at line 46 of file projectloader_hooks.h.

Constructor & Destructor Documentation

◆ HookFunctor()

template<class T>
ProjectLoaderHooks::HookFunctor< T >::HookFunctor ( T *  obj,
Func  func 
)
inline

Definition at line 47 of file projectloader_hooks.h.

Member Function Documentation

◆ Call()

template<class T>
void ProjectLoaderHooks::HookFunctor< T >::Call ( cbProject project,
TiXmlElement *  elem,
bool  isLoading 
) const
inlineoverridevirtual

Implements ProjectLoaderHooks::HookFunctorBase.

Definition at line 49 of file projectloader_hooks.h.

Member Data Documentation

◆ m_pFunc

template<class T>
Func ProjectLoaderHooks::HookFunctor< T >::m_pFunc
protected

Definition at line 56 of file projectloader_hooks.h.

◆ m_pObj

template<class T>
T* ProjectLoaderHooks::HookFunctor< T >::m_pObj
protected

Definition at line 55 of file projectloader_hooks.h.


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