FId< T, KEYTYPE > Class Template Reference

#include <fid.h>

Detailed Description

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
TData type for this id.

Public Types

using FidType = T
 

Public Member Functions

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

Static Public Member Functions

static constexpr LiteralId PrivateGetLiteralId (const KEYTYPE &)
 

Private Attributes

const KEYTYPE _id
 

Member Typedef Documentation

◆ FidType

using FidType = T

Constructor & Destructor Documentation

◆ FId()

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

Member Function Documentation

◆ Get()

const KEYTYPE& Get ( ) const

◆ operator const KEYTYPE &()

operator const KEYTYPE & ( ) const

◆ PrivateGetLiteralId()

static constexpr LiteralId PrivateGetLiteralId ( const KEYTYPE &  )
staticconstexpr

Member Data Documentation

◆ _id

const KEYTYPE _id
private
MAXON_FUNCTION
#define MAXON_FUNCTION
Definition: interfacebase.h:895