All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
util::details::RangeForWrapperBox< RangeRef > Class Template Reference

Class offering begin/end iterators of the same type out of a range of iterators of different types. More...

#include <RangeForWrapper.h>

Classes

struct  DataBox
 

Public Types

using RangeRef_t = typename Traits_t::RangeRef_t
 
using Range_t = typename Traits_t::Range_t
 
using Iterator_t = typename Traits_t::Iterator_t
 Type of wrapper iterators (same for begin and end iterators). More...
 
using size_type = typename Traits_t::size_type
 Type of number of stored elements. More...
 
using difference_type = typename Traits_t::difference_type
 Type of difference between element positions. More...
 
using value_type = typename Traits_t::value_type
 Type of value contained in the wrapped sequence. More...
 

Public Member Functions

 RangeForWrapperBox (Range_t &range)
 Constructor: references the specified range (lvalue reference). More...
 
 RangeForWrapperBox (Range_t &&range)
 Constructor: references the specified range (rvalue reference). More...
 
Iterator_t begin () const
 Returns a begin-of-range iterator. More...
 
Iterator_t end () const
 Returns a end-of-range iterator. More...
 
Reduced container interface.
auto size () const
 
bool empty () const
 
auto operator[] (difference_type index) const -> decltype(auto)
 

Private Types

using Traits_t = RangeForWrapperTraits< RangeRef >
 

Private Member Functions

auto wrappedBegin () const -> decltype(auto)
 
auto wrappedEnd () const -> decltype(auto)
 

Private Attributes

DataBox fRange
 A reference to the original range. More...
 

Detailed Description

template<typename RangeRef>
class util::details::RangeForWrapperBox< RangeRef >

Class offering begin/end iterators of the same type out of a range of iterators of different types.

Template Parameters
RangeReftype of reference to be stored (constantness embedded)

The class steals (moves) the value if RangeRef is a rvalue reference type, while it just references the original one otherwise.

Definition at line 277 of file RangeForWrapper.h.

Member Typedef Documentation

template<typename RangeRef >
using util::details::RangeForWrapperBox< RangeRef >::difference_type = typename Traits_t::difference_type

Type of difference between element positions.

Definition at line 297 of file RangeForWrapper.h.

template<typename RangeRef >
using util::details::RangeForWrapperBox< RangeRef >::Iterator_t = typename Traits_t::Iterator_t

Type of wrapper iterators (same for begin and end iterators).

Definition at line 291 of file RangeForWrapper.h.

template<typename RangeRef >
using util::details::RangeForWrapperBox< RangeRef >::Range_t = typename Traits_t::Range_t

Definition at line 288 of file RangeForWrapper.h.

template<typename RangeRef >
using util::details::RangeForWrapperBox< RangeRef >::RangeRef_t = typename Traits_t::RangeRef_t

Definition at line 287 of file RangeForWrapper.h.

template<typename RangeRef >
using util::details::RangeForWrapperBox< RangeRef >::size_type = typename Traits_t::size_type

Type of number of stored elements.

Definition at line 294 of file RangeForWrapper.h.

template<typename RangeRef >
using util::details::RangeForWrapperBox< RangeRef >::Traits_t = RangeForWrapperTraits<RangeRef>
private

Definition at line 282 of file RangeForWrapper.h.

template<typename RangeRef >
using util::details::RangeForWrapperBox< RangeRef >::value_type = typename Traits_t::value_type

Type of value contained in the wrapped sequence.

Definition at line 300 of file RangeForWrapper.h.

Constructor & Destructor Documentation

template<typename RangeRef >
util::details::RangeForWrapperBox< RangeRef >::RangeForWrapperBox ( Range_t range)
inline

Constructor: references the specified range (lvalue reference).

Definition at line 304 of file RangeForWrapper.h.

305  : fRange(range)
306  {}
DataBox fRange
A reference to the original range.
template<typename RangeRef >
util::details::RangeForWrapperBox< RangeRef >::RangeForWrapperBox ( Range_t &&  range)
inline

Constructor: references the specified range (rvalue reference).

Definition at line 309 of file RangeForWrapper.h.

310  : fRange(std::move(range))
311  {}
DataBox fRange
A reference to the original range.

Member Function Documentation

template<typename RangeRef >
Iterator_t util::details::RangeForWrapperBox< RangeRef >::begin ( ) const
inline

Returns a begin-of-range iterator.

Definition at line 314 of file RangeForWrapper.h.

315  { return Iterator_t(wrappedBegin()); }
typename Traits_t::Iterator_t Iterator_t
Type of wrapper iterators (same for begin and end iterators).
auto wrappedBegin() const -> decltype(auto)
template<typename RangeRef >
bool util::details::RangeForWrapperBox< RangeRef >::empty ( ) const
inline

Definition at line 326 of file RangeForWrapper.h.

326 { return !(wrappedBegin() != wrappedEnd()); }
auto wrappedBegin() const -> decltype(auto)
auto wrappedEnd() const -> decltype(auto)
template<typename RangeRef >
Iterator_t util::details::RangeForWrapperBox< RangeRef >::end ( ) const
inline

Returns a end-of-range iterator.

Definition at line 318 of file RangeForWrapper.h.

319  { return Iterator_t(wrappedEnd()); }
typename Traits_t::Iterator_t Iterator_t
Type of wrapper iterators (same for begin and end iterators).
auto wrappedEnd() const -> decltype(auto)
template<typename RangeRef >
auto util::details::RangeForWrapperBox< RangeRef >::operator[] ( difference_type  index) const -> decltype(auto)
inline

Definition at line 328 of file RangeForWrapper.h.

329  { return wrappedBegin()[index]; }
auto wrappedBegin() const -> decltype(auto)
template<typename RangeRef >
auto util::details::RangeForWrapperBox< RangeRef >::size ( ) const
inline

Definition at line 324 of file RangeForWrapper.h.

324 { return std::distance(begin(), end()); }
Iterator_t begin() const
Returns a begin-of-range iterator.
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
Iterator_t end() const
Returns a end-of-range iterator.
template<typename RangeRef >
auto util::details::RangeForWrapperBox< RangeRef >::wrappedBegin ( ) const -> decltype(auto)
inlineprivate

Definition at line 358 of file RangeForWrapper.h.

359  { return Traits_t::extractBegin(static_cast<RangeRef_t>(fRange)); }
DataBox fRange
A reference to the original range.
static auto extractBegin(RangeRef_t range)
Extractor of the begin iterator from a range.
template<typename RangeRef >
auto util::details::RangeForWrapperBox< RangeRef >::wrappedEnd ( ) const -> decltype(auto)
inlineprivate

Definition at line 360 of file RangeForWrapper.h.

361  { return Traits_t::extractEnd(static_cast<RangeRef_t>(fRange)); }
DataBox fRange
A reference to the original range.
static auto extractEnd(RangeRef_t range)
Extracts the end iterator from a range object.

Member Data Documentation

template<typename RangeRef >
DataBox util::details::RangeForWrapperBox< RangeRef >::fRange
private

A reference to the original range.

Definition at line 356 of file RangeForWrapper.h.


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