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

#include <StdAdaptors.h>

Public Member Functions

 StdArrayAdapt (T *pArray, int iSize, M &&map=M())
 
void CompileFunc (StdCompiler *pComp) const
 
bool operator== (const T &rDefault) const
 
StdArrayAdaptoperator= (const T &rDefault)
 
bool operator== (const T *pDefaults) const
 
StdArrayAdaptoperator= (const T *pDefaults)
 

Public Attributes

T * pArray
 
int iSize
 
M && map
 

Detailed Description

template<class T, class M = _IdFuncClass<T>>
struct StdArrayAdapt< T, M >

Definition at line 268 of file StdAdaptors.h.

Constructor & Destructor Documentation

template<class T, class M = _IdFuncClass<T>>
StdArrayAdapt< T, M >::StdArrayAdapt ( T *  pArray,
int  iSize,
M &&  map = M() 
)
inline

Definition at line 270 of file StdAdaptors.h.

271  : pArray(pArray), iSize(iSize), map(std::forward<M>(map))
272  { }

Member Function Documentation

template<class T, class M = _IdFuncClass<T>>
void StdArrayAdapt< T, M >::CompileFunc ( StdCompiler pComp) const
inline

Definition at line 274 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize, StdArrayAdapt< T, M >::map, StdCompiler::SEP_SEP, StdCompiler::Separator(), and StdCompiler::Value().

275  {
276  for (int i = 0; i < iSize; i++)
277  {
278  if (i) pComp->Separator(StdCompiler::SEP_SEP);
279  pComp->Value(map(pArray[i]));
280  }
281  }
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:129
void Value(const T &rStruct)
Definition: StdCompiler.h:171

Here is the call graph for this function:

template<class T, class M = _IdFuncClass<T>>
StdArrayAdapt& StdArrayAdapt< T, M >::operator= ( const T &  rDefault)
inline

Definition at line 290 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize.

291  {
292  for (int i = 0; i < iSize; i++)
293  pArray[i] = rDefault;
294  return *this;
295  }
template<class T, class M = _IdFuncClass<T>>
StdArrayAdapt& StdArrayAdapt< T, M >::operator= ( const T *  pDefaults)
inline

Definition at line 303 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize.

304  {
305  for (int i = 0; i < iSize; i++)
306  pArray[i] = pDefaults[i];
307  return *this;
308  }
template<class T, class M = _IdFuncClass<T>>
bool StdArrayAdapt< T, M >::operator== ( const T &  rDefault) const
inline

Definition at line 283 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize.

284  {
285  for (int i = 0; i < iSize; i++)
286  if (pArray[i] != rDefault)
287  return false;
288  return true;
289  }
template<class T, class M = _IdFuncClass<T>>
bool StdArrayAdapt< T, M >::operator== ( const T *  pDefaults) const
inline

Definition at line 296 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize.

297  {
298  for (int i = 0; i < iSize; i++)
299  if (pArray[i] != pDefaults[i])
300  return false;
301  return true;
302  }

Member Data Documentation

template<class T, class M = _IdFuncClass<T>>
int StdArrayAdapt< T, M >::iSize
template<class T, class M = _IdFuncClass<T>>
M&& StdArrayAdapt< T, M >::map

Definition at line 273 of file StdAdaptors.h.

Referenced by StdArrayAdapt< T, M >::CompileFunc().

template<class T, class M = _IdFuncClass<T>>
T* StdArrayAdapt< T, M >::pArray

Definition at line 273 of file StdAdaptors.h.


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