Code::Blocks
SVN r11506
|
Functor class for use as a project loading/saving hook. More...
#include <projectloader_hooks.h>
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 |
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.
typedef void(T::* ProjectLoaderHooks::HookFunctor< T >::Func) (cbProject *, TiXmlElement *, bool) |
Definition at line 46 of file projectloader_hooks.h.
|
inline |
Definition at line 47 of file projectloader_hooks.h.
|
inlineoverridevirtual |
Implements ProjectLoaderHooks::HookFunctorBase.
Definition at line 49 of file projectloader_hooks.h.
|
protected |
Definition at line 56 of file projectloader_hooks.h.
|
protected |
Definition at line 55 of file projectloader_hooks.h.