Go to the source code of this file.
Macros | |
#define | SB_DATATYPE_CALL(Function, Params, Type) |
This macro takes a function template with one argument and instanciate it according to the data type given. | |
#define | SB_DATATYPE_CALL_ASSIGN(Function, Params, Dest, Type) |
This macro takes a function template with one argument returning one value, and instanciate it according to the data type given. | |
#define SB_DATATYPE_CALL | ( | Function, | |
Params, | |||
Type | |||
) |
This macro takes a function template with one argument and instanciate it according to the data type given.
A typical usage, is the case where you have a void* pointer and its type and you want to apply a function on elements of the pointer. By defining a function template like this :
And then calling it like this:
You avoid the use of a switch. Furthermore, because myFunc is a template and not a macro, it's still debuggable without problems.
Function | is a function template |
Params | is a list of parameters enclosed by parens to pass to Function |
Type | is a SbDataType |
Definition at line 56 of file SbDataTypeMacros.h.
#define SB_DATATYPE_CALL_ASSIGN | ( | Function, | |
Params, | |||
Dest, | |||
Type | |||
) |
This macro takes a function template with one argument returning one value, and instanciate it according to the data type given.
See SB_DATATYPE_CALL for an usage example.
Function | is a function template |
Params | is a list of parameters enclosed by parens to pass to Function |
Dest | is filled with the return value of Function |
Type | is a SbDataType |
Definition at line 104 of file SbDataTypeMacros.h.