STK++ 1.0

STK::IContainerBase< Container > Class Template Reference

Interface base class for all containers implementing the curious recursive template paradigm. More...

#include <STK_IContainerBase.h>

Inheritance diagram for STK::IContainerBase< Container >:

List of all members.

Public Types

enum  Dimension { _1D_ = 1, _2D_ = 2, _3D_ = 3, _4D_ = 4 }
 

Intrinsic dimension of the container : 1D, 2D, 3D or 4D.

More...

Public Member Functions

virtual ~IContainerBase ()
 Virtual Destructor.
Dimension const & dim () const
 Get dimension of the container.

Protected Member Functions

 IContainerBase (Dimension dim)
 Default Constructor.

Protected Attributes

std::vector< Range const * > ranges_
 Array of the ranges of the containers.

Private Attributes

Dimension dim_
 Intrinsic dimension of the container :: 1D, 2D, 3D or 4D.

Detailed Description

template<class Container>
class STK::IContainerBase< Container >

Interface base class for all containers implementing the curious recursive template paradigm.

Implement the curious recursive template paradigm : the template parameter Container is the type of the leaf class that implements IContainerBase. A constant reference/pointer on the derived type can be obtained using the methods asLeaf and asPtrLeaf.

The default constructor of derived containers is of the form

    MyContainer1D c( Range const& r1);
    MyContainer2D c( Range const& r1, Range const& r2);
    MyContainer3D c( Range const& r1, Range const& r2, Range const& r3);
    ...

up to the fourth dimension.

A container with the same type and the same dimensions can be constructed using the clone() pure virtual method defined in IRecursiveTemplate class.

Definition at line 71 of file STK_IContainerBase.h.


Member Enumeration Documentation

template<class Container>
enum STK::IContainerBase::Dimension

Intrinsic dimension of the container : 1D, 2D, 3D or 4D.

More dimensions are not allowed.

Enumerator:
_1D_ 
_2D_ 
_3D_ 
_4D_ 

Definition at line 76 of file STK_IContainerBase.h.

    {
      _1D_ = 1,
      _2D_ = 2,
      _3D_ = 3,
      _4D_ = 4
    };

Constructor & Destructor Documentation

template<class Container>
STK::IContainerBase< Container >::IContainerBase ( Dimension  dim) [inline, protected]

Default Constructor.

The Leaf class have to give the dimension and to furnish a constructor with a vector of range as input parameter.

Parameters:
dimthe dimension of the container.

Definition at line 94 of file STK_IContainerBase.h.

                  : IRecursiveTemplate<Container>()
                  , ranges_(dim)
                  , dim_(dim)
    { ;}
template<class Container>
virtual STK::IContainerBase< Container >::~IContainerBase ( ) [inline, virtual]

Virtual Destructor.

Definition at line 102 of file STK_IContainerBase.h.

{ ;}

Member Function Documentation

template<class Container>
Dimension const& STK::IContainerBase< Container >::dim ( ) const [inline]

Get dimension of the container.

Returns:
the dimension of the container

Definition at line 107 of file STK_IContainerBase.h.

{ return dim_;}

Member Data Documentation

template<class Container>
std::vector<Range const* > STK::IContainerBase< Container >::ranges_ [protected]

Array of the ranges of the containers.

Definition at line 86 of file STK_IContainerBase.h.

template<class Container>
Dimension STK::IContainerBase< Container >::dim_ [private]

Intrinsic dimension of the container :: 1D, 2D, 3D or 4D.

More dimensions are not allowed.

Definition at line 112 of file STK_IContainerBase.h.

Referenced by STK::IContainerBase< ArrayHo< TYPE > >::dim().


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