LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
LIEF::ref_iterator< T, U, ITERATOR_T > Class Template Reference

Iterator which returns reference on container's values. More...

#include <iterators.hpp>

Public Types

using iterator_category = std::bidirectional_iterator_tag
using iterator_concept
using value_type = std::remove_cv_t<std::remove_pointer_t<decay_t<U>>>
using difference_type = ptrdiff_t
using pointer = std::remove_pointer_t<U>*
using reference = std::remove_pointer_t<U>&
using container_type = T
using DT_VAL = U
using DT = decay_t<T>
using ref_t = typename ref_iterator::reference
using pointer_t = typename ref_iterator::pointer

Public Member Functions

 ref_iterator ()=default
 ref_iterator (const ref_iterator &other)
 ref_iterator (ref_iterator &&other) noexcept
ref_iterator & operator= (const ref_iterator &other)
ref_iterator & operator= (ref_iterator &&other) noexcept
template<class T2, typename U2, class IT2, typename = std::enable_if_t< !std::is_same_v<ref_iterator, ref_iterator<T2, U2, IT2>> && std::is_same_v<decay_t<T>, decay_t<T2>> >>
 ref_iterator (const ref_iterator< T2, U2, IT2 > &other)
 ~ref_iterator ()=default
 ref_iterator (details::container_arg_t< T > container)
void swap (ref_iterator &other) noexcept
ref_iterator & operator++ ()
ref_iterator operator++ (int)
ref_iterator & operator-- ()
ref_iterator operator-- (int)
ref_iterator & operator+= (const typename ref_iterator::difference_type &movement)
ref_iterator & operator-= (const typename ref_iterator::difference_type &movement)
std::enable_if_t<!std::is_const_v< ref_t >, remove_const_t< ref_t > > operator[] (size_t n)
add_const_t< ref_t > operator[] (size_t n) const
ref_iterator operator+ (typename ref_iterator::difference_type n) const
ref_iterator operator- (typename ref_iterator::difference_type n) const
ref_iterator::difference_type operator- (const ref_iterator &rhs) const
bool operator< (const ref_iterator &rhs) const
bool operator> (const ref_iterator &rhs) const
bool operator>= (const ref_iterator &rhs) const
bool operator<= (const ref_iterator &rhs) const
ref_iterator begin () const
ref_iterator cbegin () const
ref_iterator end () const
ref_iterator cend () const
bool is_end () const
bool operator== (const ref_iterator &other) const
bool operator!= (const ref_iterator &other) const
size_t size () const
bool empty () const
std::enable_if_t<!std::is_const_v< ref_t >, remove_const_t< ref_t > > operator* ()
add_const_t< ref_t > operator* () const
std::enable_if_t<!std::is_const_v< pointer_t >, pointer_t > operator-> ()
add_const_t< pointer_t > operator-> () const

Detailed Description

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
class LIEF::ref_iterator< T, U, ITERATOR_T >

Iterator which returns reference on container's values.

This class is both an iterator and the range over the whole container: begin() and end() return iterators on the first and past-the-end elements, whatever the current position of the iterator.

If T is not a reference, the iterator owns the container: copying the iterator copies the container.

IMPORTANT: An iterator that owns its container is not a view since it is not cheap to copy. It models std::bidirectional_iterator if the container holds pointers (U is a pointer) and std::input_iterator otherwise.

Member Typedef Documentation

◆ container_type

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::container_type = T

◆ difference_type

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::difference_type = ptrdiff_t

◆ DT

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::DT = decay_t<T>

◆ DT_VAL

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::DT_VAL = U

◆ iterator_category

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::iterator_category = std::bidirectional_iterator_tag

◆ iterator_concept

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::iterator_concept
Initial value:
std::conditional_t< std::is_reference_v< T >||std::is_pointer_v< U >, Category, std::input_iterator_tag > iterator_concept_t
Definition iterators.hpp:102

◆ pointer

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::pointer = std::remove_pointer_t<U>*

◆ pointer_t

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::pointer_t = typename ref_iterator::pointer

◆ ref_t

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::ref_t = typename ref_iterator::reference

◆ reference

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::reference = std::remove_pointer_t<U>&

◆ value_type

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
using LIEF::ref_iterator< T, U, ITERATOR_T >::value_type = std::remove_cv_t<std::remove_pointer_t<decay_t<U>>>

Constructor & Destructor Documentation

◆ ref_iterator() [1/5]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
LIEF::ref_iterator< T, U, ITERATOR_T >::ref_iterator ( )
default

◆ ref_iterator() [2/5]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
LIEF::ref_iterator< T, U, ITERATOR_T >::ref_iterator ( const ref_iterator< T, U, ITERATOR_T > & other)
inline

◆ ref_iterator() [3/5]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
LIEF::ref_iterator< T, U, ITERATOR_T >::ref_iterator ( ref_iterator< T, U, ITERATOR_T > && other)
inlinenoexcept

◆ ref_iterator() [4/5]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
template<class T2, typename U2, class IT2, typename = std::enable_if_t< !std::is_same_v<ref_iterator, ref_iterator<T2, U2, IT2>> && std::is_same_v<decay_t<T>, decay_t<T2>> >>
LIEF::ref_iterator< T, U, ITERATOR_T >::ref_iterator ( const ref_iterator< T2, U2, IT2 > & other)
inline

◆ ~ref_iterator()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
LIEF::ref_iterator< T, U, ITERATOR_T >::~ref_iterator ( )
default

◆ ref_iterator() [5/5]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
LIEF::ref_iterator< T, U, ITERATOR_T >::ref_iterator ( details::container_arg_t< T > container)
inline

Member Function Documentation

◆ begin()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator LIEF::ref_iterator< T, U, ITERATOR_T >::begin ( ) const
inline

◆ cbegin()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator LIEF::ref_iterator< T, U, ITERATOR_T >::cbegin ( ) const
inline

◆ cend()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator LIEF::ref_iterator< T, U, ITERATOR_T >::cend ( ) const
inline

◆ empty()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
bool LIEF::ref_iterator< T, U, ITERATOR_T >::empty ( ) const
inline

◆ end()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator LIEF::ref_iterator< T, U, ITERATOR_T >::end ( ) const
inline

◆ is_end()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
bool LIEF::ref_iterator< T, U, ITERATOR_T >::is_end ( ) const
inline

◆ operator!=()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
bool LIEF::ref_iterator< T, U, ITERATOR_T >::operator!= ( const ref_iterator< T, U, ITERATOR_T > & other) const
inline

◆ operator*() [1/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
std::enable_if_t<!std::is_const_v< ref_t >, remove_const_t< ref_t > > LIEF::ref_iterator< T, U, ITERATOR_T >::operator* ( )
inline

◆ operator*() [2/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
add_const_t< ref_t > LIEF::ref_iterator< T, U, ITERATOR_T >::operator* ( ) const
inline

◆ operator+()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator LIEF::ref_iterator< T, U, ITERATOR_T >::operator+ ( typename ref_iterator< T, U, ITERATOR_T >::difference_type n) const
inline

◆ operator++() [1/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator & LIEF::ref_iterator< T, U, ITERATOR_T >::operator++ ( )
inline

◆ operator++() [2/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator LIEF::ref_iterator< T, U, ITERATOR_T >::operator++ ( int )
inline

◆ operator+=()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator & LIEF::ref_iterator< T, U, ITERATOR_T >::operator+= ( const typename ref_iterator< T, U, ITERATOR_T >::difference_type & movement)
inline

◆ operator-() [1/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator::difference_type LIEF::ref_iterator< T, U, ITERATOR_T >::operator- ( const ref_iterator< T, U, ITERATOR_T > & rhs) const
inline

◆ operator-() [2/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator LIEF::ref_iterator< T, U, ITERATOR_T >::operator- ( typename ref_iterator< T, U, ITERATOR_T >::difference_type n) const
inline

◆ operator--() [1/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator & LIEF::ref_iterator< T, U, ITERATOR_T >::operator-- ( )
inline

◆ operator--() [2/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator LIEF::ref_iterator< T, U, ITERATOR_T >::operator-- ( int )
inline

◆ operator-=()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator & LIEF::ref_iterator< T, U, ITERATOR_T >::operator-= ( const typename ref_iterator< T, U, ITERATOR_T >::difference_type & movement)
inline

◆ operator->() [1/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
std::enable_if_t<!std::is_const_v< pointer_t >, pointer_t > LIEF::ref_iterator< T, U, ITERATOR_T >::operator-> ( )
inline

◆ operator->() [2/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
add_const_t< pointer_t > LIEF::ref_iterator< T, U, ITERATOR_T >::operator-> ( ) const
inline

◆ operator<()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
bool LIEF::ref_iterator< T, U, ITERATOR_T >::operator< ( const ref_iterator< T, U, ITERATOR_T > & rhs) const
inline

◆ operator<=()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
bool LIEF::ref_iterator< T, U, ITERATOR_T >::operator<= ( const ref_iterator< T, U, ITERATOR_T > & rhs) const
inline

◆ operator=() [1/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator & LIEF::ref_iterator< T, U, ITERATOR_T >::operator= ( const ref_iterator< T, U, ITERATOR_T > & other)
inline

◆ operator=() [2/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
ref_iterator & LIEF::ref_iterator< T, U, ITERATOR_T >::operator= ( ref_iterator< T, U, ITERATOR_T > && other)
inlinenoexcept

◆ operator==()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
bool LIEF::ref_iterator< T, U, ITERATOR_T >::operator== ( const ref_iterator< T, U, ITERATOR_T > & other) const
inline

◆ operator>()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
bool LIEF::ref_iterator< T, U, ITERATOR_T >::operator> ( const ref_iterator< T, U, ITERATOR_T > & rhs) const
inline

◆ operator>=()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
bool LIEF::ref_iterator< T, U, ITERATOR_T >::operator>= ( const ref_iterator< T, U, ITERATOR_T > & rhs) const
inline

◆ operator[]() [1/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
std::enable_if_t<!std::is_const_v< ref_t >, remove_const_t< ref_t > > LIEF::ref_iterator< T, U, ITERATOR_T >::operator[] ( size_t n)
inline

◆ operator[]() [2/2]

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
add_const_t< ref_t > LIEF::ref_iterator< T, U, ITERATOR_T >::operator[] ( size_t n) const
inline

◆ size()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
size_t LIEF::ref_iterator< T, U, ITERATOR_T >::size ( ) const
inline

◆ swap()

template<class T, typename U = typename decay_t<T>::value_type, class ITERATOR_T = typename decay_t<T>::iterator>
void LIEF::ref_iterator< T, U, ITERATOR_T >::swap ( ref_iterator< T, U, ITERATOR_T > & other)
inlinenoexcept

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