OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
StdDefaultAdapt< T, D > Struct Template Reference

#include <StdAdaptors.h>

Public Member Functions

 StdDefaultAdapt (T &rValue, const D &rDefault)
 
void CompileFunc (StdCompiler *pComp) const
 

Public Attributes

T & rValue
 
const D & rDefault
 

Detailed Description

template<class T, class D>
struct StdDefaultAdapt< T, D >

Definition at line 41 of file StdAdaptors.h.

Constructor & Destructor Documentation

template<class T, class D>
StdDefaultAdapt< T, D >::StdDefaultAdapt ( T &  rValue,
const D &  rDefault 
)
inline

Definition at line 44 of file StdAdaptors.h.

const D & rDefault
Definition: StdAdaptors.h:43

Member Function Documentation

template<class T, class D>
void StdDefaultAdapt< T, D >::CompileFunc ( StdCompiler pComp) const
inline

Definition at line 45 of file StdAdaptors.h.

References StdDefaultAdapt< T, D >::rDefault, and StdCompiler::Value().

46  {
47  try
48  {
49 #ifdef STDCOMPILER_EXCEPTION_WORKAROUND
50  if (!pComp->ValueSafe(rValue))
51  rValue = rDefault;
52 #else
53  pComp->Value(rValue);
54 #endif
55  }
57  {
58  rValue = rDefault;
59  delete pEx;
60  }
61  }
const D & rDefault
Definition: StdAdaptors.h:43
void Value(const T &rStruct)
Definition: StdCompiler.h:161

Here is the call graph for this function:

Member Data Documentation

template<class T, class D>
const D& StdDefaultAdapt< T, D >::rDefault

Definition at line 43 of file StdAdaptors.h.

Referenced by StdDefaultAdapt< T, D >::CompileFunc().

template<class T, class D>
T& StdDefaultAdapt< T, D >::rValue

Definition at line 43 of file StdAdaptors.h.


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