STK++ 0.9.13
|
Interface base class for 2D containers. More...
#include <STK_ITContainer.h>
Public Types | |
enum | { structure_ = hidden::Traits<Derived>::structure_ , orient_ = hidden::Traits<Derived>::orient_ , sizeRows_ = hidden::Traits<Derived>::sizeRows_ , sizeCols_ = hidden::Traits<Derived>::sizeCols_ , storage_ = hidden::Traits<Derived>::storage_ } |
typedef IRecursiveTemplate< Derived > | Base |
typedef hidden::Traits< Derived >::Type | Type |
typedef hidden::Traits< Derived >::TypeConst | TypeConst |
typedef TRange< sizeRows_ > | RowRange |
Type of the Range for the rows. | |
typedef TRange< sizeCols_ > | ColRange |
Type of the Range for the columns. | |
Public Member Functions | |
ColRange const & | cols () const |
int | beginCols () const |
int | endCols () const |
int | sizeCols () const |
RowRange const & | rows () const |
int | beginRows () const |
int | endRows () const |
int | sizeRows () const |
int | firstIdxCols () const |
int | firstIdxRows () const |
int | lastIdxCols () const |
int | lastIdxRows () const |
RowRange const & | rangeRowsInCol (int) const |
ColRange const & | rangeColsInRow (int) const |
bool | empty () const |
int | size () const |
TypeConst | elt (int i, int j) const |
TypeConst | elt (int i) const |
TypeConst | elt () const |
Type & | elt (int i, int j) |
Type & | elt (int i) |
Type & | elt () |
TypeConst | at (int i, int j) const |
TypeConst | at (int i) const |
Type & | at (int i, int j) |
Type & | at (int i) |
TypeConst | operator() (int i, int j) const |
Type & | operator() (int i, int j) |
TypeConst | operator[] (int i) const |
Type & | operator[] (int i) |
TypeConst | operator() () const |
Type & | operator() () |
![]() | |
Derived & | asDerived () |
static cast : return a reference of this with a cast to the derived class. | |
Derived const & | asDerived () const |
static cast : return a const reference of this with a cast to the derived class. | |
Derived * | asPtrDerived () |
static cast : return a ptr on a Derived of this with a cast to the derived class. | |
Derived const * | asPtrDerived () const |
static cast : return a ptr on a constant Derived of this with a cast to the derived class. | |
Derived * | clone () const |
create a leaf using the copy constructor of the Derived class. | |
Derived * | clone (bool isRef) const |
create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not. | |
Protected Member Functions | |
ITContainerBase () | |
Default constructor. | |
~ITContainerBase () | |
destructor. | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
Interface base class for 2D containers.
Use the curious recursive template paradigm : the template parameter Derived
is the name of the class that implements the interface ITContainer. For example
The ITContainerBase class is the base class for all two-dimensional containers. A two-dimensional container is defined by an horizontal range of index for the columns and a vertical range of index for the rows.
The pseudo virtual function defined in this interface and to implement in the derived classes have the following definitions for the dimensions:
and for the accessors the following definitions:
for all kind of arrays.
For the diagonal arrays, vectors and points (row-vectors) the following accessors have to be implemented
Finaly the following accesors have to be implemented for number-like arrays
Definition at line 104 of file STK_ITContainer.h.
typedef IRecursiveTemplate<Derived> STK::ITContainerBase< Derived >::Base |
Definition at line 107 of file STK_ITContainer.h.
typedef TRange<sizeCols_> STK::ITContainerBase< Derived >::ColRange |
Type of the Range for the columns.
Definition at line 121 of file STK_ITContainer.h.
typedef TRange<sizeRows_> STK::ITContainerBase< Derived >::RowRange |
Type of the Range for the rows.
Definition at line 119 of file STK_ITContainer.h.
typedef hidden::Traits<Derived>::Type STK::ITContainerBase< Derived >::Type |
Definition at line 108 of file STK_ITContainer.h.
typedef hidden::Traits<Derived>::TypeConst STK::ITContainerBase< Derived >::TypeConst |
Definition at line 109 of file STK_ITContainer.h.
Enumerator | |
---|---|
structure_ | |
orient_ | |
sizeRows_ | |
sizeCols_ | |
storage_ |
Definition at line 110 of file STK_ITContainer.h.
|
inlineprotected |
|
inlineprotected |
|
inline |
i | index of the element |
Definition at line 264 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::at(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKOUT_OF_RANGE_1ARG.
|
inline |
i | index of the element |
Definition at line 241 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::at(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKOUT_OF_RANGE_1ARG.
|
inline |
i,j | row and column indexes |
Definition at line 252 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::beginCols(), STK::ITContainerBase< Derived >::beginRows(), STK::ITContainerBase< Derived >::endCols(), STK::ITContainerBase< Derived >::endRows(), and STKOUT_OF_RANGE_2ARG.
|
inline |
i,j | row and column indexes |
Definition at line 230 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::beginCols(), STK::ITContainerBase< Derived >::beginRows(), STK::ITContainerBase< Derived >::endCols(), STK::ITContainerBase< Derived >::endRows(), and STKOUT_OF_RANGE_2ARG.
Referenced by STK::ITContainerBase< Derived >::at(), STK::ITContainer< Derived, Arrays::diagonal_ >::at(), STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::at(), and STK::ITContainerBase< Derived >::at().
|
inline |
Definition at line 133 of file STK_ITContainer.h.
References STK::RangeBase< Derived >::begin(), and STK::ITContainerBase< Derived >::cols().
Referenced by STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::firstIdxCols(), STK::ITContainerBase< Derived >::operator()(), and STK::ITContainerBase< Derived >::operator()().
|
inline |
Definition at line 142 of file STK_ITContainer.h.
References STK::RangeBase< Derived >::begin(), and STK::ITContainerBase< Derived >::rows().
Referenced by STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::firstIdxRows(), STK::ITContainerBase< Derived >::operator()(), and STK::ITContainerBase< Derived >::operator()().
|
inline |
Definition at line 131 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
Referenced by STK::ITContainerBase< Derived >::beginCols(), STK::ITContainerBase< Derived >::endCols(), STK::ITContainerBase< Derived >::rangeColsInRow(), and STK::ITContainerBase< Derived >::sizeCols().
|
inline |
Definition at line 225 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
|
inline |
Definition at line 200 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
Referenced by STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::operator()(), STK::ITContainerBase< Derived >::operator()(), STK::ITContainerBase< Derived >::operator()(), STK::ITContainerBase< Derived >::operator[](), and STK::ITContainerBase< Derived >::operator[]().
|
inline |
Definition at line 215 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::elt(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKOUT_OF_RANGE_1ARG.
|
inline |
i | index of the element to get |
Definition at line 190 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::elt(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKOUT_OF_RANGE_1ARG.
|
inline |
i,j | row and column indexes |
Definition at line 205 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::beginCols(), STK::ITContainerBase< Derived >::beginRows(), STK::ITContainerBase< Derived >::endCols(), STK::ITContainerBase< Derived >::endRows(), and STKOUT_OF_RANGE_2ARG.
|
inline |
i,j | row and column indexes |
Definition at line 177 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::beginCols(), STK::ITContainerBase< Derived >::beginRows(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::endCols(), STK::ITContainerBase< Derived >::endRows(), and STKOUT_OF_RANGE_2ARG.
|
inline |
true
if the container is empty, false
otherwise Definition at line 168 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::sizeCols(), and STK::ITContainerBase< Derived >::sizeRows().
|
inline |
Definition at line 135 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::cols(), and STK::TRange< Size_ >::end().
Referenced by STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::lastIdxCols(), STK::ITContainerBase< Derived >::operator()(), and STK::ITContainerBase< Derived >::operator()().
|
inline |
Definition at line 144 of file STK_ITContainer.h.
References STK::TRange< Size_ >::end(), and STK::ITContainerBase< Derived >::rows().
Referenced by STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::at(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::lastIdxRows(), STK::ITContainerBase< Derived >::operator()(), and STK::ITContainerBase< Derived >::operator()().
|
inline |
Definition at line 150 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::beginCols().
|
inline |
Definition at line 152 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::beginRows().
|
inline |
Definition at line 154 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::endCols().
|
inline |
Definition at line 156 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::endRows().
|
inline |
Definition at line 329 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::elt(), and STK_STATIC_ASSERT_ZERO_DIMENSION_ONLY.
|
inline |
Definition at line 323 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::elt(), and STK_STATIC_ASSERT_ZERO_DIMENSION_ONLY.
|
inline |
i,j | row and column indexes |
Definition at line 288 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::beginCols(), STK::ITContainerBase< Derived >::beginRows(), STK::ITContainerBase< Derived >::endCols(), STK::ITContainerBase< Derived >::endRows(), and STKOUT_OF_RANGE_2ARG.
|
inline |
i,j | row and column indexes |
Definition at line 275 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::beginCols(), STK::ITContainerBase< Derived >::beginRows(), STK::ITContainerBase< Derived >::elt(), STK::ITContainerBase< Derived >::endCols(), STK::ITContainerBase< Derived >::endRows(), and STKOUT_OF_RANGE_2ARG.
|
inline |
i | index of the element to get |
Definition at line 313 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::elt(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKOUT_OF_RANGE_1ARG.
|
inline |
i | index of the element to get |
Definition at line 301 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ITContainerBase< Derived >::elt(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKOUT_OF_RANGE_1ARG.
|
inline |
Definition at line 165 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::cols().
|
inline |
Definition at line 161 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::rows().
|
inline |
Definition at line 140 of file STK_ITContainer.h.
References STK::IRecursiveTemplate< Derived >::asDerived().
Referenced by STK::ITContainerBase< Derived >::beginRows(), STK::ITContainerBase< Derived >::endRows(), STK::ITContainerBase< Derived >::rangeRowsInCol(), and STK::ITContainerBase< Derived >::sizeRows().
|
inline |
Definition at line 171 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::sizeCols(), and STK::ITContainerBase< Derived >::sizeRows().
|
inline |
Definition at line 137 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::cols(), and STK::TRange< Size_ >::size().
Referenced by STK::ITContainerBase< Derived >::empty(), and STK::ITContainerBase< Derived >::size().
|
inline |
Definition at line 146 of file STK_ITContainer.h.
References STK::ITContainerBase< Derived >::rows(), and STK::TRange< Size_ >::size().
Referenced by STK::ITContainerBase< Derived >::empty(), and STK::ITContainerBase< Derived >::size().