#include <functor.h>

Public Types | |
| typedef void(Functor::* | BaseMemFunc )() |
| typedef void(* | BaseFunc )() |
Public Member Functions | |
| BaseFunc | getBaseFunc () const |
| void * | getCallee () const |
| const char * | getMemFunc () const |
Protected Member Functions | |
| Functor () | |
| Functor (const void *c, BaseFunc f, const void *mf, size_t sz) | |
Protected Attributes | |
| union { | |
| BaseFunc f | |
| char memFunc [16] | |
| }; | |
| void * | callee |
| Generic pointer to a class instance who's member function the functor should invoke. | |
A Functor is an object that acts like a function. It is therefore, an object-oriented way of encapsulating function pointers. These can be quite handy for complex callback mechanisms. Much of this Functor and its set of classes was inspired by the paper: CALLBACKS IN C++ USING TEMPLATE FUNCTORS, by Rich Hickey
| typedef void(Functor::* dtDAL::Functor::BaseMemFunc)() |
| typedef void(* dtDAL::Functor::BaseFunc)() |
| dtDAL::Functor::Functor | ( | ) | [inline, protected] |
| dtDAL::Functor::Functor | ( | const void * | c, | |
| BaseFunc | f, | |||
| const void * | mf, | |||
| size_t | sz | |||
| ) | [inline, protected] |
| BaseFunc dtDAL::Functor::getBaseFunc | ( | ) | const [inline] |
| void* dtDAL::Functor::getCallee | ( | ) | const [inline] |
| const char* dtDAL::Functor::getMemFunc | ( | ) | const [inline] |
| char dtDAL::Functor::memFunc[16] |
union { ... } [protected] |
void* dtDAL::Functor::callee [protected] |
Generic pointer to a class instance who's member function the functor should invoke.
This is typecast'd to the appropriate class in the specific functor implementation.