#include <DataType.h>
Public Types | |
using | Enum = uint32_t |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (DataType, AZ::SystemAllocator) | |
AZ_RTTI (DataType, "{B8CBD17E-B8F7-4090-99A7-E9E9970D3EF3}") | |
DataType (Enum typeEnum, const AZ::Uuid &typeUuid, const AZStd::any &defaultValue, AZStd::string_view typeDisplayName, AZStd::string_view cppTypeName, const AZStd::function< bool(const AZStd::any &)> &valueValidator={}) | |
template<typename T > | |
DataType (Enum typeEnum, const T &defaultValue, AZStd::string_view typeDisplayName) | |
template<typename T > | |
DataType (Enum typeEnum, const T &defaultValue) | |
bool | operator== (const DataType &other) const |
bool | operator!= (const DataType &other) const |
bool | IsValid () const |
Enum | GetTypeEnum () const |
Return the enum value that identifies this DataType. | |
const AZ::Uuid & | GetTypeUuid () const |
Return the type Uuid that corresponds to this DataType. | |
AZStd::string | GetTypeUuidString () const |
Returns GetTypeUuid() as a string (for convenience) | |
const AZStd::any & | GetDefaultValue () const |
Returns a default value for data of this type. | |
const AZStd::string & | GetDisplayName () const |
Returns a user friently type name, for UI display. | |
const AZStd::string & | GetCppName () const |
Returns the C++ type name. | |
bool | IsSupportedType (const AZ::Uuid &typeUuid) const |
bool | IsSupportedValue (const AZStd::any &value) const |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Static Public Attributes | |
static const Enum | ENUM_INVALID = uint32_t(-1) |
Provides a way for client systems to describe each data type that they support, including a unique enum value, the AZ type Uuid, and a user-friendly display name. Client systems may subclass DataType if desired, for example to provide additional name formats.
using GraphModel::DataType::Enum = uint32_t |
Data types can be described by a simple enum value. Client systems can use whatever value they want as long as each type has a unique value.
GraphModel::DataType::DataType | ( | Enum | typeEnum, |
const AZ::Uuid & | typeUuid, | ||
const AZStd::any & | defaultValue, | ||
AZStd::string_view | typeDisplayName, | ||
AZStd::string_view | cppTypeName, | ||
const AZStd::function< bool(const AZStd::any &)> & | valueValidator = {} |
||
) |
Constructs a new DataType object.
typeEnum | - The main unique ID used by the GraphModel framework for this DataType object.Every DataType in the GraphContext must have a unique enum value. |
typeUuid | - An alternate unique ID that is used by the node graph UI system. (This is not necessarily the same thing as an RTTI TypeId.The only requirement is that it maps 1:1 with the typeEnum). |
defaultValue | - The default value assigned to any slot that uses this data type upon creation. |
typeDisplayName | - Used for tooltips or other UI elements as well as debug messages.This should be unique, and similar to typeEnum. |
cppTypeName | - The name of the c++ class that the DataType maps to.This is only used for debug messages. |
valueValidator | - An optional function used to check for specific values compatible with this data type. |