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

268  : pArray(pArray), iSize(iSize), map(std::forward<M>(map))
269  { }

Member Function Documentation

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

Definition at line 271 of file StdAdaptors.h.

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

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

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

References StdArrayAdapt< T, M >::iSize.

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

Definition at line 300 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize.

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

Definition at line 280 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize.

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

Definition at line 293 of file StdAdaptors.h.

References StdArrayAdapt< T, M >::iSize.

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

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


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