-
首页
-
C4D R23.110 C++ SDK
#include <datatypebase.h>
Member Typedef Documentation
◆
Conversion
A Conversion delegate defines a conversion from a source type to a destination type (such as from Int to Float). You can register Conversion delegates from a source type at the
DataType
object of the destination type.
-
另请参阅
-
AddConversion
Member Enumeration Documentation
◆
BASE_OF_MODE
Match
mode for IsBaseOfOrSame.
Enumerator
|
NONE
|
|
ORDERED_TYPE_ONLY
|
When tuple or container types are compared, members have to match only in order and type, their names are ignored.
|
UNORDERED_BY_NAME
|
When tuple or container types are compared, members are matched by name, so their order is ignored.
|
GENERIC_DOWNCAST
|
Consider the instantiation of a generic type the same as the generic type.
|
构造函数 & 析构函数文档编制
◆
DataType()
[1/3]
◆
DataType()
[2/3]
◆
DataType()
[3/3]
成员函数文档编制
◆
NullValue()
◆
operator Bool()
◆
operator==()
◆
operator!=()
◆
GetHashCode()
◆
operator->()
◆
GetId()
const
Id
& GetId
|
(
|
|
)
|
const
|
Returns the identifier of this data type.
数据
type identifiers of primary types look like
int32
, pointer types are identified by a * suffix as in
{float64*}, tuple types by a parenthesized list of its member types as in
{(int32,float64*)}.
-
返回
-
Unique identifier of this type.
◆
ToString()
Returns a
String
representation of this @CLASS.
-
参数
-
[in]
|
formatStatement
|
Nullptr or additional formatting instruction.
|
-
返回
-
String
representation of this @CLASS.
◆
GetSize()
Returns the size of values of this data type.
-
返回
-
Size of values.
◆
GetAlignment()
Int
GetAlignment
|
(
|
|
)
|
const
|
Returns the alignment of values of this data type. This might by an extended alignment.
-
返回
-
Alignment of values.
◆
GetValueKind()
Returns the kind of values of this data type. This is a coarse classification to distinguish between e.g. value types, pointers, references, arrays and tuples.
-
返回
-
Kind of values.
◆
CheckValueKind()
Tests the value kind of this data type for the given flags (by using the bitwise and).
-
参数
-
[in]
|
test
|
The flags to test.
|
-
返回
-
True if the value kind of this data type has one of the given flags, false otherwise.
◆
GetUnqualifiedType()
const
DataType
& GetUnqualifiedType
|
(
|
|
)
|
const
|
Returns the unqualified type of this data type. Currently the only possible qualification is a const qualification. So when this data type represents const T, the returned data type represents T. If the type is already an unqualified type, this functions returns the type itself.
-
返回
-
This type with any qualifications removed (or this type itself if it is already unqualified).
◆
ResolveRecursiveType()
const
DataType
& ResolveRecursiveType
|
(
|
|
)
|
const
|
◆
GetUnderlyingType()
const
DataType
& GetUnderlyingType
|
(
|
|
)
|
const
|
Returns the underlying type of this data type. The underlying data type is a layout-compatible more fundamental type, such as the unqualified version T for const T, or the tuple type Tuple<T, T, T> for Vec3<T>.
-
返回
-
The underlying type of this type, or nullptr.
◆
GetElementType()
const
DataType
& GetElementType
|
(
|
|
)
|
const
|
Returns the element type of this data type. The element type is used for some parametric types such as pointers or references, so for example the element type of
{T*} or
{StrongRef<T>} is
T
.
-
返回
-
The element type of this type, or nullptr.
◆
GetDecayedType()
const
DataType
& GetDecayedType
|
(
|
|
)
|
const
|
Returns the decayed type of this data type (in the sense of std::decay). I.e., at first this removes any l- or r-value-reference-qualification, and then it returns the unqualified type of the result.
-
返回
-
The decayed type of this type, maybe this type itself.
◆
HasTypeArguments()
Bool
HasTypeArguments
|
(
|
|
)
|
const
|
Returns true if this data type has valid type arguments, so that it is legal to call
GetTypeArguments()
.
-
返回
-
True if this type has valid type arguments, false otherwise.
◆
GetTypeArguments()
Returns the type arguments of this data type. Type arguments are set for some instantiations of parametric types. For example, the 3-dimensional Vector is an instantiation of the parametric type Vec with the arguments (Float, 3).
-
返回
-
The type arguments of this type.
◆
GetParametricType()
Returns the parametric type which instantiated this type. For example if this type is Vector, the function returns the parametric type Vec.
-
返回
-
The parametric type which instantiated this type, or nullptr.
◆
Get()
Returns the
DataType
identified by
typeId
. This supports primary data types as well as compound data types which are based on other types. E.g., the id "(int64,net.maxon.parametrictype.vec<3,float64>,{net.maxon.interface.functionsignature,net.maxon.interface.genericfunction})[]" identifies an array of tuples with Int64, Vector64 and object members where the object has to implement FunctionSignatureInterface and GenericFunctionInterface.
This function just forwards to
DataTypeLib::GetDataType
.
-
参数
-
[in]
|
typeId
|
Type identifier.
|
-
返回
-
DataType
for the given id.
◆
GetTupleType()
Returns the underlying tuple type of this type (if it exists). It exists for value types like
向量
whose underlying tuple type is composed of the members (
x
,
y
,
z
for
向量
).
-
返回
-
Underlying tuple type of this type, or
nullptr
if this doesn't exist.
◆
AddConversion()
[1/2]
Registers a Conversion delegate #func from the source type
src
at this
DataType
. The Conversion delegate has to convert values of type
src
to values of this
DataType
.
-
参数
-
[in]
|
src
|
The source type of the conversion function.
|
[in]
|
kind
|
The kind of the conversion.
|
[in]
|
func
|
The conversion delegate.
|
-
返回
-
OK on success.
◆
AddConversion()
[2/2]
Registers a conversion function
conversion
from type
SRC
to type
DEST
at the
DataType
of
SRC
.
-
参数
-
[in]
|
conversion
|
The conversion function.
|
-
返回
-
OK on success.
◆
Convert()
Converts the value
src
to the value #dest (the type of which has to match this
DataType
). This uses the conversion delegates which have been registered with AddConversion, or
ParametricTypeInterface::Convert
if this
DataType
is an instance of a parametric type.
-
参数
-
[in]
|
dest
|
The destination value.
|
[in]
|
src
|
The source value.
|
[in]
|
ignore
|
Only those conversions are taken into account whose conversion flags aren't also set in #ignore.
|
-
返回
-
OK on success. If there is no conversion from the source type at all, an UnsupportedArgumentError is returned. For narrowing conversions other errors may occur, such as when the representable range is exceeded.
◆
IsCastableFrom()
Checks if a value of the
other
type can be cast safely to a value of this type. This holds if either both types are the same, or this type is Generic, or both types are reference or pointer types and the type to which this type points is a base type of the type to which the
other
type points (see IsBaseOfOrSame).
-
参数
-
[in]
|
other
|
Another data type.
|
-
返回
-
True if a value of this data type can be safely cast from a value of the
other
type.
◆
MAXON_ENUM_FLAGS_CLASS()
◆
IsBaseOfOrSame()
Checks if this type is a base type of the
other
type (or the same). This takes into account
-
the hierarchy of virtual interfaces
-
const qualification
-
and the element types of
Result
,
ArrayInterface
,
Block
, pointers and references.
For example, const Int is a base type of Int, but not vice versa. const Result<ObjectRef>* is a base type of Result<IoHandler>*.
-
参数
-
[in]
|
other
|
Another data type.
|
[in]
|
mode
|
Flags for the check.
|
-
返回
-
True if this type is a base type of the
other
type.
◆
IsSimilar()
Checks if this type is similar to the other type. Two types are similar if they are the same except for differences in const qualifiers. For example,
Result
<Block<const Int>>* is similar to const
Result
<
Block<Int>
>*.
-
参数
-
[in]
|
other
|
Another data type.
|
-
返回
-
True if both types are similar.
◆
Reset()
Resets this @CLASS to the state it has right after default construction. This includes freeing all resources held by this @CLASS.
◆
PrivateGetPointer()
◆
AddReference()
void AddReference
|
(
|
|
)
|
const
|
|
private
|
◆
RemoveReference()
void RemoveReference
|
(
|
|
)
|
const
|
|
private
|
◆
IsBaseOfOrSameImpl()
[1/2]
◆
IsBaseOfOrSameImpl()
[2/2]
Friends And Related Function Documentation
◆
数据
◆
DataTypeImpl
◆
DataTypePtr
◆
StrongRefHandler
Member Data Documentation
◆
_ptr
the data type