Back to index

salome-med  6.5.0
Public Types | Public Member Functions | Protected Member Functions | Private Attributes
MED::TSlice< TValueType > Class Template Reference

This class extend TCSlice functionality for non-constant case. More...

#include <MED_SliceArray.hxx>

Inheritance diagram for MED::TSlice< TValueType >:
Inheritance graph
[legend]
Collaboration diagram for MED::TSlice< TValueType >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef TValueType value_type
typedef TCSlice< TValueType > TSupperClass

Public Member Functions

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

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 multy-dimension data.
size_t get_id (size_t theId) const
size_t get_id_at (size_t theId) const

Private Attributes

TValueType * myValuePtr

Detailed Description

template<class TValueType>
class MED::TSlice< TValueType >

This class extend TCSlice functionality for non-constant case.

Definition at line 145 of file MED_SliceArray.hxx.


Member Typedef Documentation

template<class TValueType >
typedef TCSlice<TValueType> MED::TSlice< TValueType >::TSupperClass

Definition at line 151 of file MED_SliceArray.hxx.

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

Reimplemented from MED::TCSlice< TValueType >.

Definition at line 150 of file MED_SliceArray.hxx.


Constructor & Destructor Documentation

template<class TValueType >
MED::TSlice< TValueType >::TSlice ( value_type theValuePtr,
size_t  theSourceSize,
const std::slice &  theSlice 
) [inline]

Construct the class from bare pointer.

Definition at line 154 of file MED_SliceArray.hxx.

                                    : 
      TSupperClass(theValuePtr, theSourceSize, theSlice),
      myValuePtr(theValuePtr)
    {}
template<class TValueType >
MED::TSlice< TValueType >::TSlice ( TVector< value_type > &  theContainer,
const std::slice &  theSlice 
) [inline]

Construct the class from corresponding container.

Definition at line 162 of file MED_SliceArray.hxx.

                                    : 
      TSupperClass(theContainer, theSlice),
      myValuePtr(&theContainer[0])
    {}
template<class TValueType >
MED::TSlice< TValueType >::TSlice ( ) [inline]

Default constructor (dangerous)

Definition at line 169 of file MED_SliceArray.hxx.

            :
      myValuePtr(NULL)
    {}

Member Function Documentation

template<class TValueType >
const value_type& MED::TCSlice< TValueType >::at ( size_t  theId) const [inline, inherited]

Definition at line 128 of file MED_SliceArray.hxx.

    {
      return *(myCValuePtr + get_id_at(theId));
    }

Here is the call graph for this function:

template<class TValueType >
value_type& MED::TSlice< TValueType >::at ( size_t  theId) [inline]

Definition at line 181 of file MED_SliceArray.hxx.

    {
      return *(myValuePtr + this->get_id_at(theId));
    }

Here is the call graph for this function:

template<class TValueType >
size_t MED::TCSlice< TValueType >::calculate_id ( size_t  theId) const [inline, protected, inherited]

Calculate internal index to get proper element from the source multy-dimension data.

Definition at line 74 of file MED_SliceArray.hxx.

    {
      return mySlice.start() + theId*mySlice.stride();
    }

Here is the caller graph for this function:

template<class TValueType >
void MED::TCSlice< TValueType >::check_id ( size_t  theId) const [inline, protected, inherited]

Definition at line 61 of file MED_SliceArray.hxx.

    {
      long int anId = -1;
      if(theId < mySlice.size()){
        anId = mySlice.start() + theId*mySlice.stride();
        if(anId < (long int)mySourceSize)
          return;
      }
      throw std::out_of_range("TCSlice::check_id");
    }

Here is the caller graph for this function:

template<class TValueType >
size_t MED::TCSlice< TValueType >::get_id ( size_t  theId) const [inline, protected, inherited]

Definition at line 80 of file MED_SliceArray.hxx.

    {
#ifdef MED_TCSLICE_CHECK_RANGE
      check_id(theId);
#endif
      return calculate_id(theId);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TValueType >
size_t MED::TCSlice< TValueType >::get_id_at ( size_t  theId) const [inline, protected, inherited]

Definition at line 89 of file MED_SliceArray.hxx.

    {
      check_id(theId);
      return calculate_id(theId);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

template<class TValueType >
const value_type& MED::TCSlice< TValueType >::operator[] ( size_t  theId) const [inline, inherited]

Get element by its number (const version)

Definition at line 122 of file MED_SliceArray.hxx.

    {
      return *(myCValuePtr + get_id(theId));
    }

Here is the call graph for this function:

template<class TValueType >
value_type& MED::TSlice< TValueType >::operator[] ( size_t  theId) [inline]

Get element by its number.

Definition at line 175 of file MED_SliceArray.hxx.

    {
      return *(myValuePtr + this->get_id(theId));
    }

Here is the call graph for this function:

template<class TValueType >
size_t MED::TCSlice< TValueType >::size ( ) const [inline, inherited]

Get range of the order numbers.

Definition at line 135 of file MED_SliceArray.hxx.

    {
      return mySlice.size();
    }

Here is the caller graph for this function:


Member Data Documentation

template<class TValueType >
TValueType* MED::TSlice< TValueType >::myValuePtr [private]

Definition at line 147 of file MED_SliceArray.hxx.


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