OpenClonk
StdNamingAdapt< T > Struct Template Reference

#include <StdAdaptors.h>

Public Member Functions

 StdNamingAdapt (T &rValue, const char *szName)
 
void CompileFunc (StdCompiler *pComp) const
 
template<class D >
bool operator== (const D &nValue) const
 
template<class D >
StdNamingAdaptoperator= (const D &nValue)
 

Public Attributes

T & rValue
 
const char * szName
 

Detailed Description

template<class T>
struct StdNamingAdapt< T >

Definition at line 70 of file StdAdaptors.h.

Constructor & Destructor Documentation

◆ StdNamingAdapt()

template<class T >
StdNamingAdapt< T >::StdNamingAdapt ( T &  rValue,
const char *  szName 
)
inline

Definition at line 73 of file StdAdaptors.h.

73 : rValue(rValue), szName(szName) { }
const char * szName
Definition: StdAdaptors.h:72

Member Function Documentation

◆ CompileFunc()

template<class T >
void StdNamingAdapt< T >::CompileFunc ( StdCompiler pComp) const
inline

Definition at line 74 of file StdAdaptors.h.

75  {
76  pComp->Name(szName);
77  try
78  {
79  pComp->Value(rValue);
80  }
81  catch (StdCompiler::Exception *)
82  {
83  pComp->NameEnd(true);
84  throw;
85  }
86  pComp->NameEnd();
87  }
void Value(const T &rStruct)
Definition: StdCompiler.h:161
virtual void NameEnd(bool fBreak=false)
Definition: StdCompiler.h:78
virtual bool Name(const char *szName)
Definition: StdCompiler.h:77

References StdCompiler::Name(), StdCompiler::NameEnd(), StdNamingAdapt< T >::rValue, StdNamingAdapt< T >::szName, and StdCompiler::Value().

Here is the call graph for this function:

◆ operator=()

template<class T >
template<class D >
StdNamingAdapt& StdNamingAdapt< T >::operator= ( const D &  nValue)
inline

Definition at line 89 of file StdAdaptors.h.

89 { rValue = nValue; return *this; }

References StdNamingAdapt< T >::rValue.

◆ operator==()

template<class T >
template<class D >
bool StdNamingAdapt< T >::operator== ( const D &  nValue) const
inline

Definition at line 88 of file StdAdaptors.h.

88 { return rValue == nValue; }

References StdNamingAdapt< T >::rValue.

Member Data Documentation

◆ rValue

template<class T >
T& StdNamingAdapt< T >::rValue

◆ szName

template<class T >
const char* StdNamingAdapt< T >::szName

Definition at line 72 of file StdAdaptors.h.

Referenced by StdNamingAdapt< T >::CompileFunc().


The documentation for this struct was generated from the following file: