Version: 8.3.0
MED::TCSlice< TValueType > Class Template Reference

This class intends to provide a uniform way to handle multidimensional data (const version) More...

#include <MED_SliceArray.hxx>

Inheritance diagram for MED::TCSlice< TValueType >:

Public Types

typedef TValueType value_type
 

Public Member Functions

 TCSlice (const value_type *theValuePtr, size_t theSourceSize, const std::slice &theSlice)
 Construct the class from bare pointer. More...
 
 TCSlice (const TVector< value_type > &theContainer, const std::slice &theSlice)
 Construct the class from corresponding container. More...
 
 TCSlice ()
 Default constructor (dangerous) More...
 
const value_typeoperator[] (size_t theId) const
 Get element by its number (const version) More...
 
const value_typeat (size_t theId) const
 
size_t size () const
 Get range of the order numbers. More...
 

Protected Member Functions

void check_id (size_t theId) const
 
size_t calculate_id (size_t theId) const
 Calculate internal index to get proper element from the source multidimensional data. More...
 
size_t get_id (size_t theId) const
 
size_t get_id_at (size_t theId) const
 

Private Attributes

const TValueType * myCValuePtr
 Reference to source multidimensional data. More...
 
size_t mySourceSize
 Size of the source multidimensional data. More...
 
std::slice mySlice
 Defines algorithm of index calculation. More...
 

Detailed Description

template<class TValueType>
class MED::TCSlice< TValueType >

This class intends to provide a uniform way to handle multidimensional data (const version)

It just contains a pointer to real sequence and implement proper calculation of its indexes. This class deals with constant pointer to the sources data and provides const method to read them (data).

Member Typedef Documentation

template<class TValueType >
typedef TValueType MED::TCSlice< TValueType >::value_type

Constructor & Destructor Documentation

template<class TValueType >
MED::TCSlice< TValueType >::TCSlice ( const value_type theValuePtr,
size_t  theSourceSize,
const std::slice &  theSlice 
)

Construct the class from bare pointer.

template<class TValueType >
MED::TCSlice< TValueType >::TCSlice ( const TVector< value_type > &  theContainer,
const std::slice &  theSlice 
)

Construct the class from corresponding container.

template<class TValueType >
MED::TCSlice< TValueType >::TCSlice ( )

Default constructor (dangerous)

Member Function Documentation

template<class TValueType >
const value_type& MED::TCSlice< TValueType >::at ( size_t  theId) const
template<class TValueType >
size_t MED::TCSlice< TValueType >::calculate_id ( size_t  theId) const
protected

Calculate internal index to get proper element from the source multidimensional data.

References MED::TCSlice< TValueType >::mySlice.

Referenced by MED::TCSlice< TValueType >::get_id(), and MED::TCSlice< TValueType >::get_id_at().

template<class TValueType >
void MED::TCSlice< TValueType >::check_id ( size_t  theId) const
protected
template<class TValueType >
size_t MED::TCSlice< TValueType >::get_id ( size_t  theId) const
protected
template<class TValueType >
size_t MED::TCSlice< TValueType >::get_id_at ( size_t  theId) const
protected
template<class TValueType >
const value_type& MED::TCSlice< TValueType >::operator[] ( size_t  theId) const

Get element by its number (const version)

References MED::TCSlice< TValueType >::get_id(), and MED::TCSlice< TValueType >::myCValuePtr.

template<class TValueType >
size_t MED::TCSlice< TValueType >::size ( ) const

Field Documentation

template<class TValueType >
const TValueType* MED::TCSlice< TValueType >::myCValuePtr
private

Reference to source multidimensional data.

Referenced by MED::TCSlice< TValueType >::at(), and MED::TCSlice< TValueType >::operator[]().

template<class TValueType >
std::slice MED::TCSlice< TValueType >::mySlice
private
template<class TValueType >
size_t MED::TCSlice< TValueType >::mySourceSize
private

Size of the source multidimensional data.

Referenced by MED::TCSlice< TValueType >::check_id().