kdbindings/node_functions.h¶
Namespaces¶
Name |
---|
KDBindings The main namespace of the KDBindings library. |
Classes¶
Name | |
---|---|
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. |
Defines¶
Name | |
---|---|
KDBINDINGS_DECLARE_FUNCTION(NAME, FUNC) KDBINDINGS_DECLARE_FUNCTION is a helper macro to declare and define functions for use in data binding. |
|
KDBINDINGS_DECLARE_FUNCTION_OBJECT(NAME, FUNCTION) This macro declares a callable struct that wraps a function with all its overloads. |
|
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. |
|
KDBINDINGS_DECLARE_STD_FUNCTION(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. |
Macros Documentation¶
define KDBINDINGS_DECLARE_FUNCTION¶
1 2 3 4 5 6 7 8 9 |
|
KDBINDINGS_DECLARE_FUNCTION is a helper macro to declare and define functions for use in data binding.
Parameters:
- NAME The name of the function to generate.
- FUNC The function to wrap.
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.
define KDBINDINGS_DECLARE_FUNCTION_OBJECT¶
1 2 3 4 5 6 7 8 9 10 11 |
|
This macro declares a callable struct that wraps a function with all its overloads.
Parameters:
- NAME The name of the resulting struct.
- FUNCTION The function to wrap.
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.
define KDBINDINGS_DECLARE_NAMESPACED_FUNCTION¶
1 2 3 4 5 6 |
|
This macro allows you to declare any function in a non-nested namespace as available in the context of data binding.
Parameters:
- 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
.
define KDBINDINGS_DECLARE_STD_FUNCTION¶
1 2 3 4 |
|
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.
Parameters:
- NAME The name of the function in the
std::
namespace.
It uses KDBINDINGS_DECLARE_NAMESPACED_FUNCTION and can therefore make all overloads of the std::
function available at once.
Source code¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
Updated on 2023-12-07 at 00:02:23 +0000