PMDK C++ bindings  1.10.1
This is the C++ bindings documentation for PMDK's libpmemobj.
Public Member Functions | List of all members
pmem::obj::segment_vector_internal::segment_iterator< Container, is_const > Class Template Reference

Iterator for segment_vector Since a constant iterator differs only in the type of references and pointers returned by methods, is_const template parameter is responsible for the differences between constant and non-constant iterators. More...

#include <libpmemobj++/container/segment_vector.hpp>

Public Member Functions

 segment_iterator () noexcept
 Default constructor. More...
 
 segment_iterator (table_ptr tab, size_type idx) noexcept
 Segment_iterator constructor. More...
 
 segment_iterator (const segment_iterator &other)
 Segment_iterator copy constructor. More...
 
template<typename U = void, typename = typename std::enable_if<is_const, U>::type>
 segment_iterator (const segment_iterator< Container, false > &other)
 Copy constructor for const iterator from non-const iterator.
 
segment_iteratoroperator++ ()
 Prefix increment. More...
 
segment_iterator operator++ (int)
 Postfix increment. More...
 
segment_iterator operator+ (difference_type idx) const
 Random access incrementing. More...
 
segment_iteratoroperator+= (difference_type idx)
 Random access incrementing with assignment. More...
 
segment_iteratoroperator-- ()
 Prefix decrement. More...
 
segment_iterator operator-- (int)
 Postfix decrement. More...
 
segment_iterator operator- (difference_type idx) const
 Random access decrementing. More...
 
segment_iteratoroperator-= (difference_type idx)
 Random access decrementing with assignment. More...
 
template<bool C>
difference_type operator+ (const segment_iterator< Container, C > &rhs) const
 Addition operation. More...
 
template<bool C>
difference_type operator- (const segment_iterator< Container, C > &rhs) const
 Subtraction operation. More...
 
template<bool C>
bool operator== (const segment_iterator< Container, C > &rhs) const
 Compare methods Template parameter is needed to enable this methods work with non-constant and constant iterators. More...
 
template<bool C>
bool operator!= (const segment_iterator< Container, C > &rhs) const
 Not equal operator. More...
 
template<bool C>
bool operator< (const segment_iterator< Container, C > &rhs) const
 Less operator. More...
 
template<bool C>
bool operator> (const segment_iterator< Container, C > &rhs) const
 Greater operator. More...
 
template<bool C>
bool operator<= (const segment_iterator< Container, C > &rhs) const
 Less or equal operator. More...
 
template<bool C>
bool operator>= (const segment_iterator< Container, C > &rhs) const
 Greater or equal operator. More...
 
reference operator* () const
 Indirection (dereference).
 
pointer operator-> () const
 Member access.
 

Detailed Description

template<typename Container, bool is_const>
class pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >

Iterator for segment_vector Since a constant iterator differs only in the type of references and pointers returned by methods, is_const template parameter is responsible for the differences between constant and non-constant iterators.

Constructor & Destructor Documentation

◆ segment_iterator() [1/3]

template<typename Container , bool is_const>
pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::segment_iterator
noexcept

Default constructor.

Constructs an empty segment_iterator.

◆ segment_iterator() [2/3]

template<typename Container , bool is_const>
pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::segment_iterator ( table_ptr  tab,
size_type  idx 
)
explicitnoexcept

Segment_iterator constructor.

Constructs iterator with given container and index to position in it.

◆ segment_iterator() [3/3]

template<typename Container , bool is_const>
pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::segment_iterator ( const segment_iterator< Container, is_const > &  other)

Segment_iterator copy constructor.

Constructs iterator based on other.

Member Function Documentation

◆ operator!=()

template<typename Container , bool is_const>
template<bool C>
bool pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator!= ( const segment_iterator< Container, C > &  rhs) const

Not equal operator.

Parameters
[in]rhssegment_iterator<Container, C> to compare with.
Returns
true if rhs is not equal to current iterator, false otherwise.

◆ operator+() [1/2]

template<typename Container , bool is_const>
template<bool C>
segment_iterator< Container, is_const >::difference_type pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator+ ( const segment_iterator< Container, C > &  rhs) const

Addition operation.

Returns
sum of this and other segment_iterator.

◆ operator+() [2/2]

template<typename Container , bool is_const>
segment_iterator< Container, is_const > pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator+ ( difference_type  idx) const

Random access incrementing.

Returns
incremented segment_iterator.

◆ operator++() [1/2]

template<typename Container , bool is_const>
segment_iterator< Container, is_const > & pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator++

Prefix increment.

Returns
incremented segment_iterator.

◆ operator++() [2/2]

template<typename Container , bool is_const>
segment_iterator< Container, is_const > pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator++ ( int  )

Postfix increment.

Returns
incremented segment_iterator.

◆ operator+=()

template<typename Container , bool is_const>
segment_iterator< Container, is_const > & pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator+= ( difference_type  idx)

Random access incrementing with assignment.

Returns
incremented segment_iterator.

◆ operator-() [1/2]

template<typename Container , bool is_const>
template<bool C>
segment_iterator< Container, is_const >::difference_type pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator- ( const segment_iterator< Container, C > &  rhs) const

Subtraction operation.

Returns
difference between this and other segment_iterator.

◆ operator-() [2/2]

template<typename Container , bool is_const>
segment_iterator< Container, is_const > pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator- ( difference_type  idx) const

Random access decrementing.

Returns
decremented segment_iterator.

◆ operator--() [1/2]

template<typename Container , bool is_const>
segment_iterator< Container, is_const > & pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator--

Prefix decrement.

Returns
decremented segment_iterator.

◆ operator--() [2/2]

template<typename Container , bool is_const>
segment_iterator< Container, is_const > pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator-- ( int  )

Postfix decrement.

Returns
decremented segment_iterator.

◆ operator-=()

template<typename Container , bool is_const>
segment_iterator< Container, is_const > & pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator-= ( difference_type  idx)

Random access decrementing with assignment.

Returns
decremented segment_iterator.

◆ operator<()

template<typename Container , bool is_const>
template<bool C>
bool pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator< ( const segment_iterator< Container, C > &  rhs) const

Less operator.

Parameters
[in]rhssegment_iterator<Container, C> to compare with.
Returns
true if current index less than rhs index, false otherwise.
Exceptions
std::invalid_argumentif rhs created on other Container instance.

◆ operator<=()

template<typename Container , bool is_const>
template<bool C>
bool pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator<= ( const segment_iterator< Container, C > &  rhs) const

Less or equal operator.

Parameters
[in]rhssegment_iterator<Container, C> to compare with.
Returns
true if current index less or equal to rhs index, false otherwise.
Exceptions
std::invalid_argumentif rhs created on other Container instance.

◆ operator==()

template<typename Container , bool is_const>
template<bool C>
bool pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator== ( const segment_iterator< Container, C > &  rhs) const

Compare methods Template parameter is needed to enable this methods work with non-constant and constant iterators.

Equality operator.

Parameters
[in]rhssegment_iterator<Container, C> to compare with.
Returns
true if rhs is equal to current iterator, false otherwise.

◆ operator>()

template<typename Container , bool is_const>
template<bool C>
bool pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator> ( const segment_iterator< Container, C > &  rhs) const

Greater operator.

Parameters
[in]rhssegment_iterator<Container, C> to compare with.
Returns
true if current index greater than rhs index, false otherwise.
Exceptions
std::invalid_argumentif rhs created on other Container instance.

◆ operator>=()

template<typename Container , bool is_const>
template<bool C>
bool pmem::obj::segment_vector_internal::segment_iterator< Container, is_const >::operator>= ( const segment_iterator< Container, C > &  rhs) const

Greater or equal operator.

Parameters
[in]rhssegment_iterator<Container, C> to compare with.
Returns
true if current index greater or equal to rhs index, false otherwise.
Exceptions
std::invalid_argumentif rhs created on other Container instance.

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