Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
lar::sparse_vector< T >::const_datarange_t Class Reference

A constant reference to a data range. More...

#include <sparse_vector.h>

Inheritance diagram for lar::sparse_vector< T >::const_datarange_t:
lar::sparse_vector< T >::datarange_t

Public Types

using iterator = typename datarange_t::iterator
 
using const_iterator = typename datarange_t::const_iterator
 
using less_int_range = typename datarange_t::less_int_range
 

Public Member Functions

decltype(auto) begin ()
 
decltype(auto) end ()
 
const vector_tdata () const
 Return the vector of data values (only constant access). More...
 
 ~const_datarange_t ()=delete
 

Protected Member Functions

decltype(auto) friend details::make_const_datarange_t (datarange_t &)
 
datarange_t const & base () const
 
datarange_tbase ()
 

Static Protected Member Functions

static void static_check ()
 

Additional Inherited Members

- Private Types inherited from lar::sparse_vector< T >::datarange_t
typedef range_t< size_typebase_t
 base class More...
 
typedef vector_t::iterator iterator
 
typedef vector_t::const_iterator const_iterator
 
- Private Types inherited from lar::range_t< size_type >
typedef size_type size_type
 type for the indices in the range More...
 
typedef std::ptrdiff_t difference_type
 type for index difference More...
 
typedef bool(* less_int_range) (size_type, const range_t &b)
 Helper type to be used for binary searches. More...
 
- Private Member Functions inherited from lar::sparse_vector< T >::datarange_t
 datarange_t ()
 Default constructor: an empty range. More...
 
 datarange_t (const base_t &range)
 Constructor: range initialized with 0. More...
 
template<typename ITER >
 datarange_t (size_type offset, ITER first, ITER last)
 Constructor: offset and data. More...
 
 datarange_t (size_type offset, vector_t &&data)
 Constructor: offset and data as a vector (which will be used directly) More...
 
template<typename ITER >
datarange_textend (size_type index, ITER first, ITER last)
 Appends the specified elements to this range. More...
 
void move_head (size_type to_index, value_type def_value=value_zero)
 Moves the begin of this range. More...
 
void move_tail (size_type to_index, value_type def_value=value_zero)
 Moves the end of this range. More...
 
template<typename Stream >
void dump (Stream &&out) const
 Dumps the content of this data range into a stream. More...
 
template<typename ITER >
lar::sparse_vector< T >::datarange_textend (size_type index, ITER first, ITER last)
 
iterator get_iterator (size_type index)
 Returns an iterator to the specified absolute value (no check!) More...
 
const_iterator get_iterator (size_type index) const
 
const_iterator get_const_iterator (size_type index) const
 
iterator begin ()
 begin and end iterators More...
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void resize (size_t new_size)
 Resizes the range (optionally filling the new elements with def_value) More...
 
void resize (size_t new_size, value_type def_value)
 
value_typeoperator[] (size_type index)
 Returns the value at the specified absolute index. More...
 
const value_typeoperator[] (size_type index) const
 
const vector_tdata () const
 Return the vector of data values. More...
 
void fit_size_from_data ()
 
- Private Member Functions inherited from lar::range_t< size_type >
 range_t ()
 Default constructor: empty range. More...
 
 range_t (size_type from, size_type to)
 Constructor from first and last index. More...
 
void set (size_type from, size_type to)
 Sets the borders of the range. More...
 
size_type begin_index () const
 Returns the first absolute index included in the range. More...
 
size_type end_index () const
 Returns the first absolute index not included in the range. More...
 
size_type relative_index (size_type index) const
 Returns the position within the range of the absolute index specified. More...
 
size_type size () const
 Returns the size of the range. More...
 
void resize (size_type new_size)
 Moves the end of the range to fit the specified size. More...
 
void move_head (difference_type shift)
 Moves the begin of the range by the specified amount. More...
 
void move_tail (difference_type shift)
 Moves the end of the range by the specified amount. More...
 
bool empty () const
 Returns whether the range is empty. More...
 
bool includes (size_type index) const
 Returns whether the specified absolute index is included in this range. More...
 
bool includes (const range_t &r) const
 Returns whether the specified range is completely included in this one. More...
 
bool overlap (const range_t &r) const
 Returns if this and the specified range overlap. More...
 
bool separate (const range_t &r) const
 Returns if there are elements in between this and the specified range. More...
 
bool borders (size_type index) const
 Returns whether an index is within or immediately after this range. More...
 
bool operator== (const range_t &as) const
 Returns whether the specified range has our same offset and size. More...
 
bool is_valid () const
 Returns whether the range is valid (that is, non-negative size) More...
 
bool operator< (const range_t &than) const
 Sort: this range is smaller if its offset is smaller. More...
 
- Static Private Member Functions inherited from lar::range_t< size_type >
static bool less (const range_t &a, const range_t &b)
 Returns if a is "less" than b. More...
 
static bool less (const range_t &a, size_type b)
 
static bool less (size_type a, const range_t &b)
 
- Private Attributes inherited from lar::sparse_vector< T >::datarange_t
vector_t values
 data in the range More...
 
- Private Attributes inherited from lar::range_t< size_type >
size_type offset
 offset (absolute index) of the first element More...
 
size_type last
 offset (absolute index) after the last element More...
 

Detailed Description

template<typename T>
class lar::sparse_vector< T >::const_datarange_t

A constant reference to a data range.

Values in the range can be modified, but their position and number can not.

Definition at line 1325 of file sparse_vector.h.

Member Typedef Documentation

Definition at line 1328 of file sparse_vector.h.

template<typename T>
using lar::sparse_vector< T >::const_datarange_t::iterator = typename datarange_t::iterator

Definition at line 1327 of file sparse_vector.h.

template<typename T>
using lar::sparse_vector< T >::const_datarange_t::less_int_range = typename datarange_t::less_int_range

Definition at line 1346 of file sparse_vector.h.

Constructor & Destructor Documentation

template<typename T>
lar::sparse_vector< T >::const_datarange_t::~const_datarange_t ( )
delete

Member Function Documentation

template<typename T>
datarange_t const& lar::sparse_vector< T >::const_datarange_t::base ( ) const
inlineprotected

Definition at line 1367 of file sparse_vector.h.

1368  { return static_cast<datarange_t const&>(*this); }
datarange_t()
Default constructor: an empty range.
template<typename T>
datarange_t& lar::sparse_vector< T >::const_datarange_t::base ( )
inlineprotected

Definition at line 1369 of file sparse_vector.h.

1369 { return static_cast<datarange_t&>(*this); }
datarange_t()
Default constructor: an empty range.
template<typename T>
decltype(auto) lar::sparse_vector< T >::const_datarange_t::begin ( )
inline

Definition at line 1350 of file sparse_vector.h.

1350 { return datarange_t::begin(); }
iterator begin()
begin and end iterators
template<typename T>
const vector_t& lar::sparse_vector< T >::const_datarange_t::data ( ) const
inline

Return the vector of data values (only constant access).

Definition at line 1360 of file sparse_vector.h.

1360 { return base().values; }
vector_t values
data in the range
datarange_t const & base() const
template<typename T>
decltype(auto) friend lar::sparse_vector< T >::const_datarange_t::details::make_const_datarange_t ( datarange_t )
protected
template<typename T>
decltype(auto) lar::sparse_vector< T >::const_datarange_t::end ( )
inline

Definition at line 1351 of file sparse_vector.h.

1351 { return datarange_t::end(); }
template<typename T>
static void lar::sparse_vector< T >::const_datarange_t::static_check ( )
inlinestaticprotected

Definition at line 1371 of file sparse_vector.h.

1372  { static_assert(sizeof(const_datarange_t) == sizeof(datarange_t)); }
datarange_t()
Default constructor: an empty range.

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