Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

Public Types | Public Member Functions | Protected Attributes

ProjectLoaderHooks::HookFunctor< T > Class Template Reference

#include <projectloader_hooks.h>

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

List of all members.

Public Types

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

Public Member Functions

virtual void Call (cbProject *project, TiXmlElement *elem, bool isLoading) const
 HookFunctor (T *obj, Func func)

Protected Attributes

Func m_pFunc
T * m_pObj

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.

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

Generated by  Doxygen 1.6.0   Back to index