PMDK C++ bindings  1.9.1
This is the C++ bindings documentation for PMDK's libpmemobj.
Public Member Functions | Friends | List of all members
pmem::detail::range_snapshotting_iterator< T > Struct Template Reference

Non-const iterator which adds elements to a transaction in a bulk. More...

#include <libpmemobj++/container/detail/contiguous_iterator.hpp>

Inheritance diagram for pmem::detail::range_snapshotting_iterator< T >:
pmem::detail::contiguous_iterator< range_snapshotting_iterator< T >, T &, T * >

Public Member Functions

 range_snapshotting_iterator (pointer ptr=nullptr, pointer data=nullptr, std::size_t size=0, std::size_t snapshot_size=1)
 Constructor taking pointer to data, pointer to the beginning of the array and snapshot_size.
 
 operator const T * () const
 Conversion operator to const T*.
 
reference operator[] (std::ptrdiff_t n)
 Element access operator. More...
 
- Public Member Functions inherited from pmem::detail::contiguous_iterator< range_snapshotting_iterator< T >, T &, T * >
constexpr contiguous_iterator (T * begin)
 Constructor taking a pointer.
 
T & operator* () const
 Dereference operator.
 
T * operator-> () const
 Arrow operator.
 
range_snapshotting_iterator< T > & operator++ ()
 Prefix increment operator.
 
range_snapshotting_iterator< T > operator++ (int)
 Postfix increment operator.
 
range_snapshotting_iterator< T > & operator-- ()
 Prefix decrement operator.
 
range_snapshotting_iterator< T > operator-- (int)
 Postfix decrement operator.
 
range_snapshotting_iterator< T > & operator+= (std::ptrdiff_t n)
 Addition assignment operator.
 
range_snapshotting_iterator< T > & operator-= (std::ptrdiff_t n)
 Subtraction assignment operator.
 
range_snapshotting_iterator< T > operator+ (std::ptrdiff_t n) const
 Addition operator.
 
range_snapshotting_iterator< T > operator- (std::ptrdiff_t n) const
 Subtraction operator overload for integral type.
 
T & operator[] (std::ptrdiff_t n)
 Element access operator.
 

Friends

void swap (range_snapshotting_iterator &lhs, range_snapshotting_iterator &rhs)
 Non-member swap function.
 

Additional Inherited Members

- Protected Member Functions inherited from pmem::detail::contiguous_iterator< range_snapshotting_iterator< T >, T &, T * >
void change_by (std::ptrdiff_t n)
 Function for changing underlying pointer. More...
 

Detailed Description

template<typename T>
struct pmem::detail::range_snapshotting_iterator< T >

Non-const iterator which adds elements to a transaction in a bulk.

This is done by dividing underlying array into ranges of specified (snapshot_size) size. If iterator is incremented/decremented/etc. so that it is moved to another range, this new range is added to a transaction.

For example, let's assume snapshot_size = 2, N = 6. This gives us: 0 1 | 2 3 | 4 5

If iterator is moved from 1 to 3, that means it is now in another range, and that range must be added to a transaction (elements 2 and 3).

Member Function Documentation

◆ operator[]()

template<typename T >
reference pmem::detail::range_snapshotting_iterator< T >::operator[] ( std::ptrdiff_t  n)
inline

Element access operator.

Adds element to a transaction.


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