PMDK C++ bindings
1.11
This is the C++ bindings documentation for PMDK's libpmemobj.
|
This class serves similar purpose to pmem::obj::string, but keeps the data within the same allocation as inline_string itself. More...
#include <libpmemobj++/experimental/inline_string.hpp>
Public Member Functions | |
basic_inline_string (basic_string_view< CharT, Traits > v) | |
Constructs inline string from a string_view. More... | |
basic_inline_string (size_type capacity) | |
Constructs empty inline_string with specified capacity. More... | |
basic_inline_string (const basic_inline_string &rhs) | |
Copy constructor. More... | |
basic_inline_string & | operator= (const basic_inline_string &rhs) |
Copy assignment operator. | |
basic_inline_string & | operator= (basic_string_view< CharT, Traits > rhs) |
Assignment operator from string_view. | |
operator basic_string_view< CharT, Traits > () const | |
Conversion operator to string_view. | |
size_type | size () const noexcept |
size_type | capacity () const noexcept |
pointer | data () noexcept |
const_pointer | data () const noexcept |
int | compare (const basic_inline_string &rhs) const noexcept |
Compares this inline_string with other. More... | |
CharT & | operator[] (size_type p) noexcept |
Returns reference to a character at position. More... | |
basic_inline_string & | assign (basic_string_view< CharT, Traits > rhs) |
Transactionally assign content of basic_string_view. More... | |
This class serves similar purpose to pmem::obj::string, but keeps the data within the same allocation as inline_string itself.
The data is always kept right after the inline_string structure. It means that creating an object of inline_string must be done as follows:
Example:
pmem::obj::experimental::basic_inline_string< CharT, Traits >::basic_inline_string | ( | basic_string_view< CharT, Traits > | v | ) |
Constructs inline string from a string_view.
pool_error | if inline_string doesn't reside on pmem. |
pmem::obj::experimental::basic_inline_string< CharT, Traits >::basic_inline_string | ( | size_type | capacity | ) |
Constructs empty inline_string with specified capacity.
pool_error | if inline_string doesn't reside on pmem. |
pmem::obj::experimental::basic_inline_string< CharT, Traits >::basic_inline_string | ( | const basic_inline_string< CharT, Traits > & | rhs | ) |
Copy constructor.
pool_error | if inline_string doesn't reside on pmem. |
basic_inline_string< CharT, Traits > & pmem::obj::experimental::basic_inline_string< CharT, Traits >::assign | ( | basic_string_view< CharT, Traits > | rhs | ) |
Transactionally assign content of basic_string_view.
std::out_of_range | if rhs is larger than capacity. |
|
noexcept |
The space actually occupied by inline_string is equal to sizeof(inline_string) + capacity() + sizeof('\0') and cannot be expanded.
|
noexcept |
Compares this inline_string with other.
Works in the same way as std::basic_string::compare.
|
noexcept |
|
noexcept |
|
noexcept |
Returns reference to a character at position.
[in] | p |
|
noexcept |