#include <slice.hpp>
Public Types | |
typedef ConstSliceBase< storage_type, data_type >::iterator | iterator |
typedef ConstSliceBase< storage_type, data_type >::const_iterator | const_iterator |
typedef ConstSliceBase< storage_type, data_type >::value_type | value_type |
Public Types inherited from Exiv2::Internal::ConstSliceBase< storage_type, data_type > | |
typedef storage_type< data_type >::iterator | iterator |
typedef storage_type< data_type >::const_iterator | const_iterator |
typedef storage_type< data_type >::value_type | value_type |
Public Member Functions | |
MutableSliceBase (data_type &data, size_t begin, size_t end) | |
value_type & | at (size_t index) |
const value_type & | at (size_t index) const |
iterator | begin () throw () |
iterator | end () throw () |
Public Member Functions inherited from Exiv2::Internal::ConstSliceBase< storage_type, data_type > | |
ConstSliceBase (data_type &data, size_t begin, size_t end) | |
const value_type & | at (size_t index) const |
const_iterator | cbegin () const throw () |
const_iterator | cend () const throw () |
template<typename slice_type > | |
slice_type | subSlice (size_t begin, size_t end) const |
Public Member Functions inherited from Exiv2::Internal::SliceBase | |
SliceBase (size_t begin, size_t end) | |
size_t | size () const throw () |
Protected Types | |
typedef ConstSliceBase< storage_type, data_type > | base_type |
Protected Member Functions | |
ConstSliceBase< storage_type, const data_type > | to_const_base () const throw () |
template<typename slice_type > | |
slice_type | subSlice (size_t begin, size_t end) |
Protected Member Functions inherited from Exiv2::Internal::SliceBase | |
void | rangeCheck (size_t index) const |
Additional Inherited Members | |
Protected Attributes inherited from Exiv2::Internal::ConstSliceBase< storage_type, data_type > | |
storage_type< data_type > | storage_ |
Protected Attributes inherited from Exiv2::Internal::SliceBase | |
const size_t | begin_ |
const size_t | end_ |
This class provides all public-facing non-const-qualified methods of slices. It only re-implements the const-qualified versions as non-const.
|
inline |
Forwards everything to the constructor of const_slice_base
|
inline |
Obtain a reference to the element with the specified index in the slice.
std::out_of_range | when index is out of bounds of the slice |
|
inline |
Obtain an iterator to the first element in the slice.
Referenced by Exiv2::Internal::MutableSliceBase< Internal::PtrSliceStorage, T * >::subSlice().
|
inline |
Obtain an iterator to the first element beyond the slice.
Referenced by Exiv2::Internal::MutableSliceBase< Internal::PtrSliceStorage, T * >::subSlice().
|
inlineprotected |
Create a mutable sub-slice with the given bounds (with respect to the current slice).
slice_type | Type of the slice that this function shall return. Provide it with the type of the class that derives from mutable_slice_base. |
|
inlineprotected |
Explicitly convert this instance into a base-class of the appropriate constant version of this slice.
This function is required to properly implement the subSlice() const
function for mutable slices. The problem here is, that a slice<T> and a slice<const T> actually don't share the same base class ConstSliceBase<storage_type, T>
. Instead slice<T>
inherits from ConstSliceBase<storage_type, T>
and slice<const T>
inherits from ConstSliceBase<storage_type, const T>
.
Now, slice<T>
can call the subSlice() const
method from its base class, but that will return a mutable slice<T>
! Instead we use this function to convert the `slice<T>
into the parent of the appropriate slice<const T>
and call its subSlice() const
, which returns the correct type.