23 #ifndef MED_SliceArray_HeaderFile
24 #define MED_SliceArray_HeaderFile
34 # define MED_TCSLICE_CHECK_RANGE
45 template<
class TValueType>
62 throw std::out_of_range(
"TCSlice::check_id");
75 #ifdef MED_TCSLICE_CHECK_RANGE
94 const std::slice& theSlice):
102 const std::slice& theSlice):
121 at(
size_t theId)
const
136 template<
class TValueType>
147 size_t theSourceSize,
148 const std::slice& theSlice):
155 const std::slice& theSlice):
180 #undef MED_TCSLICE_CHECK_RANGE
This class intends to provide a uniform way to handle multidimensional data (const version)
Definition: MED_SliceArray.hxx:47
std::slice mySlice
Defines algorithm of index calculation.
Definition: MED_SliceArray.hxx:50
TCSlice(const value_type *theValuePtr, size_t theSourceSize, const std::slice &theSlice)
Construct the class from bare pointer.
Definition: MED_SliceArray.hxx:92
size_t get_id_at(size_t theId) const
Definition: MED_SliceArray.hxx:82
const TValueType * myCValuePtr
Reference to source multidimensional data.
Definition: MED_SliceArray.hxx:48
const value_type & at(size_t theId) const
Definition: MED_SliceArray.hxx:121
TCSlice()
Default constructor (dangerous)
Definition: MED_SliceArray.hxx:109
TCSlice(const TVector< value_type > &theContainer, const std::slice &theSlice)
Construct the class from corresponding container.
Definition: MED_SliceArray.hxx:101
size_t mySourceSize
Size of the source multidimensional data.
Definition: MED_SliceArray.hxx:49
size_t get_id(size_t theId) const
Definition: MED_SliceArray.hxx:73
size_t calculate_id(size_t theId) const
Calculate internal index to get proper element from the source multidimensional data.
Definition: MED_SliceArray.hxx:67
const value_type & operator[](size_t theId) const
Get element by its number (const version)
Definition: MED_SliceArray.hxx:115
TValueType value_type
Definition: MED_SliceArray.hxx:89
void check_id(size_t theId) const
Definition: MED_SliceArray.hxx:54
size_t size() const
Get range of the order numbers.
Definition: MED_SliceArray.hxx:128
This class extends TCSlice functionality for non-constant case.
Definition: MED_SliceArray.hxx:138
TValueType value_type
Definition: MED_SliceArray.hxx:142
value_type & operator[](size_t theId)
Get element by its number.
Definition: MED_SliceArray.hxx:167
TSlice()
Default constructor (dangerous)
Definition: MED_SliceArray.hxx:161
TSlice(value_type *theValuePtr, size_t theSourceSize, const std::slice &theSlice)
Construct the class from bare pointer.
Definition: MED_SliceArray.hxx:146
TValueType * myValuePtr
Definition: MED_SliceArray.hxx:139
value_type & at(size_t theId)
Definition: MED_SliceArray.hxx:173
TCSlice< TValueType > TSupperClass
Definition: MED_SliceArray.hxx:143
TSlice(TVector< value_type > &theContainer, const std::slice &theSlice)
Construct the class from corresponding container.
Definition: MED_SliceArray.hxx:154
Main purpose to introduce the class was to customize operator [].
Definition: MED_Vector.hxx:36
Definition: MED_Algorithm.cxx:28