|
Bifrost SDK
Bifrost SDK documentation
|
Macros used to define functions and traits about classes exposed to Amino. More...
#include <Amino/Core/internal/DefaultClassDefine.h>Go to the source code of this file.
Macros | |
| #define | AMINO_DEFINE_DEFAULT_CLASS(...) AMINO_INTERNAL_DEFINE_DEFAULT_CLASS(__VA_ARGS__) |
| Macro for generating the getDefault entry point definition related to a given opaque type. More... | |
Macros used to define functions and traits about classes exposed to Amino.
This should be included in the .cpp file, and its counterpart ClassDeclare.h should be included in the .h file.
Definition in file ClassDefine.h.
| #define AMINO_DEFINE_DEFAULT_CLASS | ( | ... | ) | AMINO_INTERNAL_DEFINE_DEFAULT_CLASS(__VA_ARGS__) |
Macro for generating the getDefault entry point definition related to a given opaque type.
The default value created by this function will be used within Amino graphs when a port of a user class type does not have a value set. It will take this default value. It's important because null Amino::Ptr are not allowed to flow in Amino graphs.
By default, the default value for the opaque class will simply be default constructed. In cases where the class type cannot be default constructed, the library writer can provide the default Amino::Ptr as the optional second argument to the AMINO_DEFINE_DEFAULT_CLASS macro. This may be necessary if the class has no default constructor or if the class is pure virtual. Otherwise, passing a custom Amino::Ptr as the second argument is almost never a good idea, and is most likely a code smell (as it's purposefully not using the available default constructor to create a default value), and should be avoided, unless there's a very compeling reason to do so.
Example:
This is necessary to allow Amino graphs to create default values for opaque, class types.
Definition at line 85 of file ClassDefine.h.