Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Attributes

SgEBWArray< T > Class Template Reference

An array of three values of type T, indexed by SG_EMPTY, SG_BLACK and SG_WHITE. More...

#include <SgEBWArray.h>

List of all members.

Public Member Functions

 SgEBWArray ()
 Constructor.
 SgEBWArray (const T &val)
 SgEBWArray (const T &empty, const T &black, const T &white)
const T & operator[] (SgEmptyBlackWhite c) const
T & operator[] (SgEmptyBlackWhite c)

Private Attributes

m_array [3]

Detailed Description

template<class T>
class SgEBWArray< T >

An array of three values of type T, indexed by SG_EMPTY, SG_BLACK and SG_WHITE.

Stores index SG_EMPTY (=4) at array[0].

Definition at line 17 of file SgEBWArray.h.


Constructor & Destructor Documentation

template<class T >
SgEBWArray< T >::SgEBWArray (  ) 

Constructor.

Constructs elements with the default constructor of type T.

Note:
Previously, EBWArray automatically initialized primitive types like ints or pointers with 0, and there was a second class EBWConstrArray used for non-primitive types. This has changed, because it is not the standard semantics for container classes in C++, and because it does not allow use cases with incremental initialization after construction. If you want to initialize for example an SgBWArray<int> with 0, use the constructor that takes a default value.

Definition at line 22 of file SgEBWArray.h.

template<class T >
SgEBWArray< T >::SgEBWArray ( const T &  val  ) 

Definition at line 26 of file SgEBWArray.h.

template<class T >
SgEBWArray< T >::SgEBWArray ( const T &  empty,
const T &  black,
const T &  white 
)

Definition at line 33 of file SgEBWArray.h.

References SgEBWArray< T >::m_array, SG_BLACK, SG_EMPTY, and SG_WHITE.


Member Function Documentation

template<class T >
const T& SgEBWArray< T >::operator[] ( SgEmptyBlackWhite  c  )  const

Definition at line 40 of file SgEBWArray.h.

References SgEBWArray< T >::m_array, SG_BLACK, SG_EMPTY, and SG_WHITE.

template<class T >
T& SgEBWArray< T >::operator[] ( SgEmptyBlackWhite  c  ) 

Definition at line 46 of file SgEBWArray.h.


Member Data Documentation

template<class T >
T SgEBWArray< T >::m_array[3] [private]

Definition at line 53 of file SgEBWArray.h.

Referenced by SgEBWArray< T >::operator[](), and SgEBWArray< T >::SgEBWArray().


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


Sun Mar 13 2011 Doxygen 1.7.1