Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgEBWArray< T > Class Template Reference

#include <SgEBWArray.h>

List of all members.


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 19 of file SgEBWArray.h.

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]


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 33 of file SgEBWArray.h.

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

Definition at line 37 of file SgEBWArray.h.

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

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

Definition at line 44 of file SgEBWArray.h.

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


Member Function Documentation

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

Definition at line 57 of file SgEBWArray.h.

References SgEBWArray< T >::m_array, and SG_ASSERT_EBW.

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

Definition at line 51 of file SgEBWArray.h.

References SgEBWArray< T >::m_array, and SG_ASSERT_EBW.


Member Data Documentation

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

Definition at line 64 of file SgEBWArray.h.

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


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


17 Jun 2010 Doxygen 1.4.7