KDBindings API Documentation
1.0.95
|
Go to the source code of this file.
Classes | |
struct | KDBindings::node_abs |
An example struct that is used with a call to KDBINDINGS_DECLARE_FUNCTION to declare all overloads of std::abs as usable in data binding. More... | |
Namespaces | |
KDBindings | |
The main namespace of the KDBindings library. | |
Macros | |
#define | KDBINDINGS_DECLARE_FUNCTION(NAME, FUNC) |
KDBINDINGS_DECLARE_FUNCTION is a helper macro to declare and define functions for use in data binding. More... | |
#define | KDBINDINGS_DECLARE_FUNCTION_OBJECT(NAME, FUNCTION) |
This macro declares a callable struct that wraps a function with all its overloads. More... | |
#define | KDBINDINGS_DECLARE_NAMESPACED_FUNCTION(NAMESPACE, NAME) |
This macro allows you to declare any function in a non-nested namespace as available in the context of data binding. More... | |
#define | KDBINDINGS_DECLARE_STD_FUNCTION(NAME) KDBINDINGS_DECLARE_NAMESPACED_FUNCTION(std, NAME) |
This macro is based on KDBINDINGS_DECLARE_NAMESPACED_FUNCTION(NAMESPACE, FUNC) to make it easier to declare any standard library function as available for data binding. More... | |
#define KDBINDINGS_DECLARE_FUNCTION | ( | NAME, | |
FUNC | |||
) |
KDBINDINGS_DECLARE_FUNCTION is a helper macro to declare and define functions for use in data binding.
This macro can take any callable object or function reference and create a new function that may be used in data binding expressions. The result function that can be called with a Property or the result of a data binding expression to create another data binding expression.
Note that if a function is overloaded, it is impossible to reference all of its overloads at once. Therefore we recommend declaring a struct with a templated operator() to use as the function object. See the KDBindings::node_abs struct for an example of how to do this.
NAME | The name of the function to generate. |
FUNC | The function to wrap. |
Definition at line 54 of file node_functions.h.
#define KDBINDINGS_DECLARE_FUNCTION_OBJECT | ( | NAME, | |
FUNCTION | |||
) |
This macro declares a callable struct that wraps a function with all its overloads.
The declared struct can be used as the FUNCTION argument to KDBINDINGS_DECLARE_FUNCTION(NAME, FUNCTION) to pass a function with all its overloads to the macro.
See the KDBindings::node_abs struct for an example of what this macro would generate.
NAME | The name of the resulting struct. |
FUNCTION | The function to wrap. |
Definition at line 100 of file node_functions.h.
#define KDBINDINGS_DECLARE_NAMESPACED_FUNCTION | ( | NAMESPACE, | |
NAME | |||
) |
This macro allows you to declare any function in a non-nested namespace as available in the context of data binding.
NAMESPACE | the name of the namespace the function is in. |
NAME | the name of the function to wrap. |
In comparison to KDBINDINGS_DECLARE_FUNCTION(NAME, FUNC), this macro will generate a helper struct using KDBINDINGS_DECLARE_FUNCTION_OBJECT, so all overloads of the function are made available at once.
KDBINDINGS_DECLARE_STD_FUNCTION is basically just a call to this macro with the NAMESPACE parameter set to std
.
Definition at line 123 of file node_functions.h.
#define KDBINDINGS_DECLARE_STD_FUNCTION | ( | NAME | ) | KDBINDINGS_DECLARE_NAMESPACED_FUNCTION(std, NAME) |
This macro is based on KDBINDINGS_DECLARE_NAMESPACED_FUNCTION(NAMESPACE, FUNC) to make it easier to declare any standard library function as available for data binding.
It uses KDBINDINGS_DECLARE_NAMESPACED_FUNCTION and can therefore make all overloads of the std::
function available at once.
NAME | The name of the function in the std:: namespace. |
Definition at line 136 of file node_functions.h.