Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgBWArray< T > Class Template Reference

#include <SgBWArray.h>

List of all members.


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 17 of file SgBWArray.h.

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]


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 53 of file SgBWArray.h.

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

Definition at line 58 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 65 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_WHITE  = =1  )  [private]

template<class T>
SgBWArray< T >::BOOST_STATIC_ASSERT ( SG_BLACK  = =0  )  [private]

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

Definition at line 79 of file SgBWArray.h.

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

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

Definition at line 72 of file SgBWArray.h.

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

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

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

Definition at line 92 of file SgBWArray.h.

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

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

Definition at line 85 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]

Definition at line 49 of file SgBWArray.h.

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


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


17 Jun 2010 Doxygen 1.4.7