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 42 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 45 of file StdAdaptors.h.

const D & rDefault
Definition: StdAdaptors.h:44

Member Function Documentation

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

Definition at line 46 of file StdAdaptors.h.

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

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

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 44 of file StdAdaptors.h.

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

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

Definition at line 44 of file StdAdaptors.h.


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