PMDK C++ bindings  1.8.1
This is the C++ bindings documentation for PMDK's libpmemobj.
Classes | Namespaces | Typedefs | Functions
segment_vector.hpp File Reference

A persistent version of segment vector implementation. More...

#include <libpmemobj++/container/array.hpp>
#include <libpmemobj++/container/vector.hpp>
#include <libpmemobj++/detail/common.hpp>
#include <libpmemobj++/detail/life.hpp>
#include <libpmemobj++/detail/temp_value.hpp>
#include <libpmemobj++/detail/template_helpers.hpp>
#include <libpmemobj++/make_persistent.hpp>
#include <libpmemobj++/persistent_ptr.hpp>
#include <libpmemobj++/pext.hpp>
#include <libpmemobj++/transaction.hpp>
#include <vector>

Go to the source code of this file.

Classes

class  pmem::obj::experimental::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. More...
 
class  pmem::obj::experimental::segment_vector< T, Segment, Policy >
 Segment table is a data type with a vector-like interface The difference is that it does not do reallocations and iterators are not invalidated when adding new elements. More...
 

Namespaces

 pmem
 A persistent version of concurrent hash map implementation Ref: https://arxiv.org/abs/1509.02235.
 

Typedefs

template<typename SegmentType , size_t SegmentSize>
using pmem::obj::experimental::fixed_size_array_policy = segment_vector_internal::fixed_size_policy< pmem::obj::array< SegmentType, 255 >, SegmentSize >
 XXX: In case of array of segments with fixed segments size we can allocate as much memory as we want, but for tests to pass we need to limit the array size.
 

Functions

template<typename T , typename Segment , typename Policy >
void pmem::obj::experimental::swap (segment_vector< T, Segment, Policy > &lhs, segment_vector< T, Segment, Policy > &rhs)
 Swaps the contents of lhs and rhs. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator== (const segment_vector< T, Segment, Policy > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator!= (const segment_vector< T, Segment, Policy > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator< (const segment_vector< T, Segment, Policy > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator<= (const segment_vector< T, Segment, Policy > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator> (const segment_vector< T, Segment, Policy > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator>= (const segment_vector< T, Segment, Policy > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator== (const segment_vector< T, Segment, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator!= (const segment_vector< T, Segment, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator< (const segment_vector< T, Segment, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator<= (const segment_vector< T, Segment, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator> (const segment_vector< T, Segment, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator>= (const segment_vector< T, Segment, Policy > &lhs, const std::vector< T > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator== (const std::vector< T > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator!= (const std::vector< T > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator< (const std::vector< T > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator<= (const std::vector< T > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator> (const std::vector< T > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 
template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator>= (const std::vector< T > &lhs, const segment_vector< T, Segment, Policy > &rhs)
 Comparison operator. More...
 

Detailed Description

A persistent version of segment vector implementation.

Function Documentation

◆ operator!=() [1/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator!= ( const segment_vector< T, Segment, Policy > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the different number of elements or at least one element in lhs is not equal to element in rhs at the same position.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of the containers are not equal, false otherwise.

◆ operator!=() [2/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator!= ( const segment_vector< T, Segment, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of the containers are not equal, false otherwise.

◆ operator!=() [3/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator!= ( const std::vector< T > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of the containers are not equal, false otherwise.

◆ operator<() [1/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator< ( const segment_vector< T, Segment, Policy > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically less than contents of rhs, false otherwise.

◆ operator<() [2/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator< ( const segment_vector< T, Segment, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of lhs are lexicographically less than contents of rhs, false otherwise.

◆ operator<() [3/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator< ( const std::vector< T > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically less than contents of rhs, false otherwise.

◆ operator<=() [1/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator<= ( const segment_vector< T, Segment, Policy > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experime ntal::segment_vector<T, Policy>.
Returns
true if contents of lhs are lexicographically lesser than or equal to contents of rhs, false otherwise.

◆ operator<=() [2/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator<= ( const segment_vector< T, Segment, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of lhs are lexicographically lesser than or equal to contents of rhs, false otherwise.

◆ operator<=() [3/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator<= ( const std::vector< T > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically lesser than or equal to contents of rhs, false otherwise.

◆ operator==() [1/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator== ( const segment_vector< T, Segment, Policy > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of the containers are equal, false otherwise.

◆ operator==() [2/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator== ( const segment_vector< T, Segment, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of the containers are equal, false otherwise.

◆ operator==() [3/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator== ( const std::vector< T > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers.

Checks if containers have the same number of elements and each element in lhs is equal to element in rhs at the same position.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of the containers are equal, false otherwise.

◆ operator>() [1/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator> ( const segment_vector< T, Segment, Policy > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically greater than contents of rhs, false otherwise.

◆ operator>() [2/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator> ( const segment_vector< T, Segment, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of lhs are lexicographically greater than contents of rhs, false otherwise.

◆ operator>() [3/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator> ( const std::vector< T > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically greater than contents of rhs, false otherwise.

◆ operator>=() [1/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator>= ( const segment_vector< T, Segment, Policy > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically greater than or equal to contents of rhs, false otherwise.

◆ operator>=() [2/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator>= ( const segment_vector< T, Segment, Policy > &  lhs,
const std::vector< T > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis pmem::obj::experimental::segment_vector<T, SegmentPolicy, StoragePolicy>
[in]rhsis std::vector<T>.
Returns
true if contents of lhs are lexicographically greater than or equal to contents of rhs, false otherwise.

◆ operator>=() [3/3]

template<typename T , typename Segment , typename Policy >
bool pmem::obj::experimental::operator>= ( const std::vector< T > &  lhs,
const segment_vector< T, Segment, Policy > &  rhs 
)

Comparison operator.

Compares the contents of two containers lexicographically.

Parameters
[in]lhsis std::vector<T>.
[in]rhsis pmem::obj::experimental::segment_vector<T, Policy, SPolicy>.
Returns
true if contents of lhs are lexicographically greater than or equal to contents of rhs, false otherwise.

◆ swap()

template<typename T , typename Segment , typename Policy >
void pmem::obj::experimental::swap ( segment_vector< T, Segment, Policy > &  lhs,
segment_vector< T, Segment, Policy > &  rhs 
)

Swaps the contents of lhs and rhs.

Parameters
[in]lhsfirst segment_vector.
[in]rhssecond segment_vector.