xentara-utils v2.0.4
The Xentara Utility Library
|
A fancy pointer type suitable for use in shared memories. More...
#include <xentara/utils/ipc/ShmPointer.hpp>
Public Types | |
using | element_type = Type |
The element type. | |
using | difference_type = std::ptrdiff_t |
The type used to calculate offsets. | |
template<class OtherType > | |
using | rebind = ShmPointer< OtherType > |
A type alias for a pointer to a different type;. | |
Public Member Functions | |
constexpr | ShmPointer () noexcept=default |
Default constructor. | |
constexpr | ShmPointer (Type *address) noexcept |
Conversion from an address stored in a regular pointer. | |
constexpr | ShmPointer (std::nullptr_t) noexcept |
Constructor for a null pointer. | |
template<typename RelatedType > requires std::convertible_to<RelatedType *, Type *> | |
constexpr | ShmPointer (const ShmPointer< RelatedType > &pointer) noexcept |
Constructor for a pointer to a related type. | |
constexpr auto | operator= (Type *rhs) noexcept -> ShmPointer & |
Assignment operator. | |
constexpr auto | operator= (std::nullptr_t) noexcept -> ShmPointer & |
Assignment operator for a nullptr. | |
template<typename RelatedType > requires std::convertible_to<RelatedType *, Type *> | |
auto | operator= (const ShmPointer< RelatedType > &rhs) -> ShmPointer & |
Assignment operator for a related pointer. | |
constexpr auto | operator== (const ShmPointer &) const -> bool |
Comparison operator. | |
constexpr auto | operator<=> (const ShmPointer &rhs) const -> std::strong_ordering |
Three-Way-Comparison operator. | |
constexpr auto | operator++ () noexcept -> ShmPointer & |
Pre-increment operator. | |
constexpr auto | operator++ (int) noexcept -> ShmPointer |
Post-increment operator. | |
constexpr auto | operator-- () noexcept -> ShmPointer & |
Pre-decrement operator. | |
constexpr auto | operator-- (int) noexcept -> ShmPointer |
Post-decrement operator. | |
constexpr auto | operator+= (difference_type offset) noexcept -> ShmPointer & |
Addition assignment operator. | |
constexpr auto | operator-= (difference_type offset) noexcept -> ShmPointer & |
Subtraction assignment operator. | |
constexpr auto | operator* () const noexcept -> Type & |
Indirection operator. | |
constexpr auto | operator-> () const noexcept -> Type * |
Member access operator. | |
constexpr | operator Type * () const noexcept |
Conversion to a native pointer. | |
constexpr auto | operator[] (difference_type index) const noexcept -> Type & |
Subscript operator. | |
A fancy pointer type suitable for use in shared memories.
This is a pointer type that can safely be used in shared memories. When written to a shared memory, the pointer will always point to the same object in all mappings of the memory, even if they are at different addresses, as long as the pointed-to object lies in the same shared memory.
You can copy the pointer out of the shared memory in to regular private memory, but then it can no longer be shared between processes.
Type | The type the pointer points to |
using xentara::utils::ipc::ShmPointer< Type >::difference_type = std::ptrdiff_t |
The type used to calculate offsets.
using xentara::utils::ipc::ShmPointer< Type >::element_type = Type |
The element type.
using xentara::utils::ipc::ShmPointer< Type >::rebind = ShmPointer<OtherType> |
A type alias for a pointer to a different type;.
|
constexprdefaultnoexcept |
Default constructor.
This constructor constructs an unititialized pointer
|
constexprnoexcept |
Conversion from an address stored in a regular pointer.
address | The address |
|
constexprnoexcept |
Constructor for a null pointer.
|
constexprnoexcept |
Constructor for a pointer to a related type.
RelatedType |
pointer |
|
constexprnoexcept |
Conversion to a native pointer.
|
constexprnoexcept |
Indirection operator.
|
constexprnoexcept |
Pre-increment operator.
|
constexprnoexcept |
Post-increment operator.
|
constexprnoexcept |
Addition assignment operator.
|
constexprnoexcept |
Pre-decrement operator.
|
constexprnoexcept |
Post-decrement operator.
|
constexprnoexcept |
Subtraction assignment operator.
|
constexprnoexcept |
Member access operator.
|
constexpr |
Three-Way-Comparison operator.
auto xentara::utils::ipc::ShmPointer< Type >::operator= | ( | const ShmPointer< RelatedType > & | rhs | ) | -> ShmPointer & |
Assignment operator for a related pointer.
|
constexprnoexcept |
Assignment operator for a nullptr.
|
constexprnoexcept |
Assignment operator.
|
constexpr |
Comparison operator.
|
constexprnoexcept |
Subscript operator.