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

SgBWArray< T > Class Template Reference

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

#include <SgBWArray.h>

List of all members.

Public Member Functions

 SgBWArray ()
 Constructor.
 SgBWArray (const T &val)
 SgBWArray (const T &black, const T &white)
bool operator== (const SgBWArray &bwArray) const
bool operator!= (const SgBWArray &bwArray) const
T & operator[] (SgBlackWhite color)
const T & operator[] (SgBlackWhite color) const

Private Member Functions

 BOOST_STATIC_ASSERT (SG_BLACK==0)
 BOOST_STATIC_ASSERT (SG_WHITE==1)

Private Attributes

m_array [2]

Detailed Description

template<class T>
class SgBWArray< T >

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

Definition at line 16 of file SgBWArray.h.


Constructor & Destructor Documentation

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

Constructor.

Constructs elements with the default constructor of type T.

Note:
Previously, BWArray automatically initialized primitive types like ints or pointers with 0, and there was a second class BWConstrArray 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 51 of file SgBWArray.h.

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

Definition at line 56 of file SgBWArray.h.

References SgBWArray< T >::m_array, SG_BLACK, and SG_WHITE.

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

Definition at line 63 of file SgBWArray.h.

References SgBWArray< T >::m_array, SG_BLACK, and SG_WHITE.


Member Function Documentation

template<class T>
SgBWArray< T >::BOOST_STATIC_ASSERT ( SG_BLACK  = =0  )  [private]
template<class T>
SgBWArray< T >::BOOST_STATIC_ASSERT ( SG_WHITE  = =1  )  [private]
template<class T >
bool SgBWArray< T >::operator!= ( const SgBWArray< T > &  bwArray  )  const

Definition at line 77 of file SgBWArray.h.

References SgBWArray< T >::operator==().

template<class T >
bool SgBWArray< T >::operator== ( const SgBWArray< T > &  bwArray  )  const

Definition at line 70 of file SgBWArray.h.

References SgBWArray< T >::m_array, SG_BLACK, and SG_WHITE.

Referenced by SgBWArray< T >::operator!=().

template<class T >
T & SgBWArray< T >::operator[] ( SgBlackWhite  color  ) 

Definition at line 83 of file SgBWArray.h.

References SgBWArray< T >::m_array, and SG_ASSERT_BW.

template<class T >
const T & SgBWArray< T >::operator[] ( SgBlackWhite  color  )  const

Definition at line 90 of file SgBWArray.h.

References SgBWArray< T >::m_array, and SG_ASSERT_BW.


Member Data Documentation

template<class T>
T SgBWArray< T >::m_array[2] [private]

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


Sun Mar 13 2011 Doxygen 1.7.1