NDEVR
API Documentation
TypeInfo

Stores information about a type, relevant for certain templated functions. More...

Public Member Functions

constexpr TypeInfo ()
 Constructs a default TypeInfo with all sizes set to zero and all type flags set to false.
template<class t_type>
bool isSame (const t_type &object)
 Checks whether the given object has the same TypeInfo as this instance.
bool operator!= (const TypeInfo &type) const
 Checks whether two TypeInfo instances are not equal.
bool operator== (const TypeInfo &type) const
 Checks whether two TypeInfo instances are equal by comparing all fields.

Public Attributes

uint02 byte_size
 The size in bytes of a single element within the type.
bool is_boolean
 Whether the type represents a boolean.
bool is_buffer
 Whether the type represents a buffer or container.
bool is_color
 Whether the type represents a color.
bool is_float
 Whether the type represents a floating-point numeric value.
bool is_number
 Whether the type represents a numeric value.
bool is_string
 Whether the type represents a string.
bool is_unsigned
 Whether the type represents an unsigned numeric value.
uint04 total_size
 The total size of the type in bytes.
uint02 vector_size
 The number of dimensions or components in the type (e.g. 3 for a 3D vector).

Detailed Description

Stores information about a type, relevant for certain templated functions.


To get information about a type at runtime use ObjectInfo

Definition at line 42 of file TypeInfo.h.

Member Function Documentation

◆ isSame()

template<class t_type>
bool TypeInfo::isSame ( const t_type & object)
inline

Checks whether the given object has the same TypeInfo as this instance.

Parameters
[in]objectThe object whose type information is compared.
Returns
True if the TypeInfo of the object matches this TypeInfo.

Definition at line 78 of file TypeInfo.h.

References TypeInfo().

◆ operator!=()

bool TypeInfo::operator!= ( const TypeInfo & type) const
inline

Checks whether two TypeInfo instances are not equal.

Parameters
[in]typeThe TypeInfo to compare against.
Returns
True if any field differs between the two instances.

Definition at line 105 of file TypeInfo.h.

References TypeInfo(), byte_size, is_boolean, is_buffer, is_color, is_float, is_number, is_string, is_unsigned, total_size, type, and vector_size.

◆ operator==()

bool TypeInfo::operator== ( const TypeInfo & type) const
inline

Checks whether two TypeInfo instances are equal by comparing all fields.

Parameters
[in]typeThe TypeInfo to compare against.
Returns
True if all fields are equal.

Definition at line 87 of file TypeInfo.h.

References TypeInfo(), byte_size, is_boolean, is_buffer, is_color, is_float, is_number, is_string, is_unsigned, total_size, type, and vector_size.


The documentation for this class was generated from the following file: