HDK
|
#include <VOP_TypeInfo.h>
Public Member Functions | |
void | setTypeInfoFromType (VOP_Type type) |
const UT_StringHolder & | getTypeName () const |
Returns the official type name. More... | |
VOP_TypeDefinitionHandle | getTypeDefinitionHandle () const |
Returns the actual type definition for the type represented by object. More... | |
void | conditionType (const VOP_Language &language) |
bool | canDirectlyAssign (const VOP_TypeInfo &src_type, const VOP_Language *language=nullptr) const |
bool | isValid () const |
Returns true if the type is valid. More... | |
bool | isArray () const |
Returns true if the type is an array. More... | |
VOP_TypeInfo | getArrayElementTypeInfo () const |
Returns the type of the array element, if this type is an array. More... | |
bool | isStructLike () const |
Returns true for sturct and class custom type. More... | |
void | getDescriptionString (UT_String &description) const |
UT_StringHolder | getDescriptionString () const |
void | getTokenString (UT_String &token) const |
UT_StringHolder | getTokenString () const |
void | setFromTokenString (const char *token_or_description) |
VOP_TypeInfo (VOP_Type type=VOP_TYPE_UNDEF, const char *type_name=NULL) | |
~VOP_TypeInfo () | |
void | setType (VOP_Type type, VOP_Type raw_type=VOP_TYPE_UNDEF, const char *type_name=NULL) |
void | setType (VOP_Type type, const char *type_name) |
VOP_Type | getType () const |
Returns the type enumeration value. More... | |
VOP_Type | getRawType () const |
Returns the type enumeration value. More... | |
VOP_Type | getBaseType () const |
Returns the type enumeration value. More... | |
bool | operator== (const VOP_TypeInfo &other) const |
Comparison operators. More... | |
bool | operator!= (const VOP_TypeInfo &other) const |
Comparison operators. More... | |
Static Public Member Functions | |
static const VOP_TypeInfo & | getUndefinedTypeInfo () |
Returns a type info that represents an undefined type. More... | |
enum | { UNKNOWN_ARRAY_LENGTH = -1 } |
Sets and gets the array length. More... | |
void | setArrayLength (int length) |
Sets and gets the array length. More... | |
int | getArrayLength () const |
Sets and gets the array length. More... | |
bool | isFixedArrayLength () const |
Sets and gets the array length. More... | |
Class abstracting VOP variable and connector types. Unlike the basic VOP_Type enum, this class can represent and refer to any type, including structs and custom types.
Definition at line 39 of file VOP_TypeInfo.h.
anonymous enum |
Sets and gets the array length.
Enumerator | |
---|---|
UNKNOWN_ARRAY_LENGTH |
Definition at line 87 of file VOP_TypeInfo.h.
|
explicit |
A constructor and a destructor.
VOP_TypeInfo::~VOP_TypeInfo | ( | ) |
A constructor and a destructor.
bool VOP_TypeInfo::canDirectlyAssign | ( | const VOP_TypeInfo & | src_type, |
const VOP_Language * | language = nullptr |
||
) | const |
Returns true if a variable of this type can be directly assigned a value of the src_type type, without any explicit conversion.
void VOP_TypeInfo::conditionType | ( | const VOP_Language & | language | ) |
Language will condition the type to an equivalent base type, which is useful for comparing types to test assignment compatibility (eg, color and vector). Makes the type and raw type equal to the type conditioned by the language.
VOP_TypeInfo VOP_TypeInfo::getArrayElementTypeInfo | ( | ) | const |
Returns the type of the array element, if this type is an array.
|
inline |
Sets and gets the array length.
Definition at line 90 of file VOP_TypeInfo.h.
|
inline |
Returns the type enumeration value.
Definition at line 75 of file VOP_TypeInfo.h.
Returns a type description used for labeling node inputs, outputs, and other places with a legible name. Eg, "int", "uniform float", "vector array", and "mystruct" (for 'struct mystruct' type).
|
inline |
Definition at line 132 of file VOP_TypeInfo.h.
|
inline |
Returns the type enumeration value.
Definition at line 73 of file VOP_TypeInfo.h.
Returns a string that encodes the type information into a single-worded string. Eg, "int", "ufloat", "vectora", "struct_mystruct" (for 'struct mystruct' type).
|
inline |
Definition at line 143 of file VOP_TypeInfo.h.
|
inline |
Returns the type enumeration value.
Definition at line 71 of file VOP_TypeInfo.h.
VOP_TypeDefinitionHandle VOP_TypeInfo::getTypeDefinitionHandle | ( | ) | const |
Returns the actual type definition for the type represented by object.
|
inline |
Returns the official type name.
Definition at line 80 of file VOP_TypeInfo.h.
|
static |
Returns a type info that represents an undefined type.
bool VOP_TypeInfo::isArray | ( | ) | const |
Returns true if the type is an array.
|
inline |
Sets and gets the array length.
Definition at line 92 of file VOP_TypeInfo.h.
bool VOP_TypeInfo::isStructLike | ( | ) | const |
Returns true for sturct and class custom type.
bool VOP_TypeInfo::isValid | ( | ) | const |
Returns true if the type is valid.
bool VOP_TypeInfo::operator!= | ( | const VOP_TypeInfo & | other | ) | const |
Comparison operators.
bool VOP_TypeInfo::operator== | ( | const VOP_TypeInfo & | other | ) | const |
Comparison operators.
Sets and gets the array length.
Definition at line 88 of file VOP_TypeInfo.h.
void VOP_TypeInfo::setFromTokenString | ( | const char * | token_or_description | ) |
Sets the type info from the string representation of that type. The string representation should be compatible with the strings returned from getDescriptionString() or getTokenString() above. Note, the struct types can be only deduced from strings compatible with getTokenString(), or if str is "struct" (unnamed struct).
void VOP_TypeInfo::setType | ( | VOP_Type | type, |
VOP_Type | raw_type = VOP_TYPE_UNDEF , |
||
const char * | type_name = NULL |
||
) |
Sets a new type and additional data for the type info.
Sets a new type and additional data for the type info.
Utility function that converts VOP_Type into a VOP_TypeInfo. It is used during transition from VOP_Type to VOP_TypeInfo to mark the places that should abandon VOP_Type in favour of VOP_TypeInfo, but whose conversion is quite involved and likely requires lengthy sweeps, and thus is postponed untill later phases.
Definition at line 58 of file VOP_TypeInfo.h.