FId< T, KEYTYPE > Class Template Reference

#include <fid.h>

详细描述

template<typename T, typename KEYTYPE>
class maxon::FId< T, KEYTYPE >

FId class for ids with datatype type. this makes Set/Get functions type safe. use FID and DEFINE_ID macros to use in the code. e.g. FID(1000,Float64) or MAXON_ATTRIBUTE(Float64, MYID_RADIUS, 1000) you can use:

template < typename KEY, typename DATA> MAXON_FUNCTION typename std::enable_if<!IsFidClass<KEY>::value, Result<void>>::type Set(KEY&& key, DATA&& data) template < typename T> MAXON_FUNCTION Result<void> Set(FId<T> key, T&& data) template < typename T> MAXON_FUNCTION Result<void> Set(FId<T> key, const T& data)

to define template functions that are allow specialization of Fid<T>

Template Parameters
T 数据 type for this id.

Public Types

using  FidType = T

公共成员函数

  FId (const KEYTYPE &iid, ModuleInfo *=nullptr)
const KEYTYPE &  Get () const
  operator const KEYTYPE & () const

静态公共成员函数

static constexpr LiteralId   PrivateGetLiteralId (const KEYTYPE &)

Private Attributes

const KEYTYPE  _id

Member Typedef Documentation

◆  FidType

using FidType = T

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

◆  FId()

FId ( const KEYTYPE &  iid ,
ModuleInfo *  = nullptr  
)
explicit

成员函数文档编制

◆  Get()

const KEYTYPE& Get ( ) const

◆  operator const KEYTYPE &()

operator const KEYTYPE & ( ) const

◆  PrivateGetLiteralId()

static constexpr LiteralId PrivateGetLiteralId ( const KEYTYPE &  )
static constexpr

Member Data Documentation

◆  _id

const KEYTYPE _id private
MAXON_FUNCTION
#define MAXON_FUNCTION
定义: interfacebase.h:873