MeVisLab Toolbox Reference
|
Go to the source code of this file.
Macros | |
#define | ML_EMPTY_SPACE |
In this header some macros are defined which implement some c-wrapper stuff to address member functions via a pointer. | |
#define | IMPLEMENT_DIM_DISPATCHER_P0(FUNC_NAME, CLASS_NAME, RET_TYPE, RET_COMMAND) |
This macro defines a function type and six static functions of this type. | |
#define | IMPLEMENT_DIM_DISPATCHER_P1(FUNC_NAME, CLASS_NAME, RET_TYPE, RET_COMMAND, P_TYPE) |
For documentation see IMPLEMENT_DIM_DISPATCHER_P0. | |
#define | IMPLEMENT_EXC_DISPATCHER_P0(FUNC_NAME, CLASS_NAME, RET_TYPE, RET_COMMAND) |
This macro defines a function type and 12 static functions of this type. | |
#define IMPLEMENT_DIM_DISPATCHER_P0 | ( | FUNC_NAME, | |
CLASS_NAME, | |||
RET_TYPE, | |||
RET_COMMAND ) |
This macro defines a function type and six static functions of this type.
The function type is given from FUNC_NAME + "TYPE". The six functions are named FUNC_NAME + "1DCB", ..., FUNC_NAME + "6DCB" for callback versions from 1D to 6D. These 6 static functions call the corresponding functions named FUNC_NAME + "1D", ..., FUNC_NAME + "6D" which must be implemented as members of the object passed as obj which is of the type given by CLASS_NAME.
The return type of the callback function is passed by RET_TYPE. Pass 'void' for no return value. The return command (usually 'return') is passed as RET_COMMAND. Use ML_EMPTY_SPACE for no return command.
Moreover a member of the function type is created with name FUNC_NAME. Also an initialization function with name "_init" + FUNC_NAME + "TYPE" is implemented which sets the member to address of the n-dth function if n is passed as parameter. So the function for dimension can be called by simply calling the member and passing the this-pointer of the object.
Usually the dimension of an image is calculated and the member is set to the optimized implementation for that dimension by calling the init function. So the code is always adapted to the current image dimension.
Definition at line 79 of file mlWrapperMacros.h.
#define IMPLEMENT_DIM_DISPATCHER_P1 | ( | FUNC_NAME, | |
CLASS_NAME, | |||
RET_TYPE, | |||
RET_COMMAND, | |||
P_TYPE ) |
For documentation see IMPLEMENT_DIM_DISPATCHER_P0.
The difference is that here an additional parameter type P_TYPE must be specified which must be passed to calls the static function and so also to calls of the member variable.
Definition at line 112 of file mlWrapperMacros.h.
#define IMPLEMENT_EXC_DISPATCHER_P0 | ( | FUNC_NAME, | |
CLASS_NAME, | |||
RET_TYPE, | |||
RET_COMMAND ) |
This macro defines a function type and 12 static functions of this type.
The function type is given from FUNC_NAME + "TYPE". The 12 functions are named FUNC_NAME + "1DCBN", ..., FUNC_NAME + "6DCBN" and FUNC_NAME + "1DCBE", ..., FUNC_NAME + "6DCBE" for callback versions from 1D to 6D without exception handling and for versions from 1D to 6D with exception handling. These 12 static functions call the corresponding functions named FUNC_NAME + "1D", ..., FUNC_NAME + "6D" and FUNC_NAME + "1DE", ..., FUNC_NAME + "6DE" which must be implemented as members of the object passed as obj which is of the type given by CLASS_NAME.
The return type of the callback function is passed by RET_TYPE. Pass 'void' for no return value. The return command (usually 'return') is passed as RET_COMMAND. Use ML_EMPTY_SPACE for no return command.
Moreover six members of the function type are created with names FUNC_NAME + "1", ..., FUNC_NAME + "6". Also an initialization function with name "_init" + FUNC_NAME + "TYPE" is implemented which sets the 6 members to the addresses of the functions terminating with "CBE" if useException is passed as true. Otherwise they are set to the functions terminating with "CBN" for normal implementation. So always the code with/without exception handling is used dynamically by simply calling the member and passing the this-pointer of the object.
Definition at line 166 of file mlWrapperMacros.h.
#define ML_EMPTY_SPACE |
In this header some macros are defined which implement some c-wrapper stuff to address member functions via a pointer.
The problem to be solved is to implement a function or method in a class which is highly efficient, but the performance differs strongly, for example dependent on the dynamic image dimension. There are two cases:
Since c++ does not permit function pointers to member functions this needs to be done with static c functions which then call the member function. These macros are specialized to implement these static functions and an initialization method which sets the correct function dependent on the image dimension. A simple macro containing nothing to be passed as macro parameter which has no content.
Definition at line 52 of file mlWrapperMacros.h.