IdBuilder Class Reference

#include <corenodes_helpers.h>

详细描述

IdBuilder can be used to build identifiers for instantiations of generic core nodes. For example the generic multiplication core node "net.maxon.corenode.mul" has instantiations for several data types such as "net.maxon.corenode.mul<int64>" for the type Int64. The id of the instantiation can be obtained with an IdBuilder by writing { IdBuilder ("net.maxon.corenode.mul"). Append<Int>() } as in this example code:

CoreNodeInstancePtr mul = g.AddChild(Id(), IdBuilder("net.maxon.corenode.mul").Append<Int>()) iferr_return;

The constructor and Append functions of IdBuilder don't return errors, a potential out-of-memory error is postponed to the final call of ToId() or ToCString() .

公共成员函数

  IdBuilder (const Char *base)
  IdBuilder (const LiteralId &base)
IdBuilder &&  Append (const DataType &type)
template<typename... T>
IdBuilder &&  Append ()
template<Bool B, typename... T>
IdBuilder &&  Append ()
Result < Id ToId () const
Result < CString ToCString () const
String   ToString (const FormatStatement *formatStatement=nullptr) const

静态公共成员函数

template<typename... INSTANTIATIONTYPE, typename BASETYPE >
static corenodes::IdBuilder   创建 (BASETYPE baseId)

私有成员函数

  IdBuilder ()=default
IdBuilder &&  AppendImpl ()
template<typename... T>
IdBuilder &&  AppendImpl (const DataType &type, T... types)
void  AppendString (const Char *str)
void  AppendParam (const Char *str)
void  AppendChar ( Char ch)

Private Attributes

CString   _name

Friends

class  IdOrBuilder

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

◆  IdBuilder() [1/3]

IdBuilder ( const Char base )
explicit

Constructs a new IdBuilder where base is the part of the id before the instantiation suffix.

参数
[in] base The base identifier for this IdBuilder .

◆  IdBuilder() [2/3]

IdBuilder ( const LiteralId base )
explicit

Constructs a new IdBuilder where base is the part of the id before the instantiation suffix.

参数
[in] base The base identifier for this IdBuilder .

◆  IdBuilder() [3/3]

IdBuilder ( )
private default

成员函数文档编制

◆  Create()

static corenodes::IdBuilder 创建 ( BASETYPE  baseId )
static

Constructs a new IdBuilder based on #baseId with type instantiation suffixes.

另请参阅
IdBuilder constructors and templated Append as static 创建 is a combination of both.
Template Parameters
INSTANTIATIONTYPE The instantiation types to append.
BASETYPE The type of #baseId (for calling constructor).
参数
[in] baseId The base identifier for this IdBuilder .
返回
OK on success.

◆  Append() [1/3]

IdBuilder && Append ( const DataType type )

Appends the identifier of type to the instantiation suffix of this IdBuilder . Angular brackets and commas are appended as needed.

参数
[in] type The type to append.
返回
This IdBuilder .

◆  Append() [2/3]

IdBuilder && Append ( )

Appends the identifiers of the given types to the instantiation suffix of this IdBuilder . Angular brackets and commas are appended as needed.

Template Parameters
T The types to append.
返回
This IdBuilder .

◆  Append() [3/3]

IdBuilder && Append ( )

Appends the identifiers of the given types to the instantiation suffix of this IdBuilder . Angular brackets and commas are appended as needed.

Template Parameters
B A value to append.
T The types to append.
返回
This IdBuilder .

◆  ToId()

Result < Id > ToId ( ) const

Returns the constructed identifier of this IdBuilder as an Id . If an error happened during construction, this is reported by the call to this function.

返回
The constructed identifier.

◆  ToCString()

Result < CString > ToCString ( ) const

Returns the constructed identifier of this IdBuilder 作为 CString . If an error happened during construction, this is reported by the call to this function.

返回
The constructed identifier.

◆  ToString()

String ToString ( const FormatStatement formatStatement = nullptr ) const

Returns a String representation of this @CLASS.

参数
[in] formatStatement Nullptr or additional formatting instruction.
返回
String representation of this @CLASS.

◆  AppendImpl() [1/2]

IdBuilder && AppendImpl ( )
private

◆  AppendImpl() [2/2]

IdBuilder && AppendImpl ( const DataType type ,
T...  types  
)
private

◆  AppendString()

void AppendString ( const Char str )
private

◆  AppendParam()

void AppendParam ( const Char str )
private

◆  AppendChar()

void AppendChar ( Char   ch )
private

Friends And Related Function Documentation

◆  IdOrBuilder

friend class IdOrBuilder
friend

Member Data Documentation

◆  _name

CString _name
private