TypeArguments Struct Reference

#include <datatypelib.h>

详细描述

TypeArguments are usually set for a DataType if it is an instantiation of a ParametricType. For example the type {Tuple<Int, Bool, String>} is an instantiation of the parametric type Tuple with the type arguments {(Int, Bool, String )}, and the type Vector is an instantiation of ParametricTypes::Vec with the type arguments {(Float, 3)}.

There are two kinds of type arguments:

Public Types

using  ValueType = Member
using  ConstIterator = BaseIterator < const TypeArguments , false >
using  IsAllocType = std::true_type

公共成员函数

Block < const Member ToBlock () const
const Member operator[] ( Int index) const
ConstIterator   Begin () const
ConstIterator   End () const
Int   FindIndex (const Id &name) const
Int   FindIndex (const InternedId &name) const
Bool   operator== (const TypeArguments &other) const
Bool   operator!= (const TypeArguments &other) const
HashInt   GetHashCode () const
void  RemoveReference () const
  ~TypeArguments ()=delete

Public Attributes

BaseArray < INNERMOST_MEMBER toInnermost
BaseArray < Tuple < Int32 , INNERMOST_MEMBER > >  fromInnermost
BaseArray < Int64 iargs
Int   count
Member   args [ MAXON_FLEXIBLE_ARRAY_LENGTH ]

Member Typedef Documentation

◆  ValueType

using ValueType = Member

◆  ConstIterator

using ConstIterator = BaseIterator <const TypeArguments , false>

◆  IsAllocType

using IsAllocType = std::true_type

构造函数 & 析构函数文档编制

◆  ~TypeArguments()

~ TypeArguments ( )
delete

成员函数文档编制

◆  ToBlock()

Block <const Member > ToBlock ( ) const

Returns the type arguments which are types as a block.

◆  operator[]()

const Member & operator[] ( Int   index ) const

Returns the type argument at the given #index.

◆  Begin()

ConstIterator Begin ( ) const

Gets an iterator pointing to the first type argument.

返回
Iterator for the first type argument.

◆  End()

ConstIterator End ( ) const

Returns and iterator pointing to the end of the type arguments (one behind last).

返回
Iterator for the end of the type arguments.

◆  FindIndex() [1/2]

Int FindIndex ( const Id name ) const

Searches for a named type argument which uses the given #name and returns its index. If no such argument is found, -1 is returned. The function doesn't check for duplicates.

参数
[in] name Name to search. If this is empty, -1 is returned.
返回
Index of the matching type argument, or -1.

◆  FindIndex() [2/2]

Int FindIndex ( const InternedId name ) const

Searches for a named type argument which uses the given #name and returns its index. If no such argument is found, -1 is returned. The function doesn't check for duplicates.

参数
[in] name Name to search. If this is empty, -1 is returned.
返回
Index of the matching type argument, or -1.

◆  operator==()

Bool operator== ( const TypeArguments other ) const

◆  operator!=()

Bool operator!= ( const TypeArguments other ) const

◆  GetHashCode()

HashInt GetHashCode ( ) const

◆  RemoveReference()

void RemoveReference ( ) const

Member Data Documentation

◆  toInnermost

BaseArray < INNERMOST_MEMBER > toInnermost

◆  fromInnermost

BaseArray < Tuple < Int32 , INNERMOST_MEMBER > > fromInnermost

◆  iargs

BaseArray < Int64 > iargs

The integral type arguments.

◆  count

Int count

The number of type arguments which are types.

◆  args

Member args[ MAXON_FLEXIBLE_ARRAY_LENGTH ]

The type arguments which are (optionally named) types.