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

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

Member Function Documentation

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

Definition at line 273 of file StdAdaptors.h.

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

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

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

References StdArrayAdapt< T, M >::iSize.

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

Definition at line 302 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize.

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

Definition at line 282 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize.

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

Definition at line 295 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize.

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

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


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