Class of basic buffers for binary data.
More...
#include <msgpack_light/details/basic_binary_buffer.h>
|
static std::size_t | prevent_unsafe_size (std::size_t size) |
| Change the input to a size which won't cause implementation-defined behaviors of std::malloc and std::realloc functions.
|
|
unsigned char * | buffer_ |
| Buffer.
|
std::size_t | size_ |
| Size of the buffer.
|
Class of basic buffers for binary data.
- Warning
- This class is for internal implementations in this library, so omits some checks to avoid undefined behaviors or performance degradation intentionally with an assumption that the user of this class will avoid such conditions.
Definition at line 38 of file basic_binary_buffer.h.
◆ basic_binary_buffer() [1/3]
msgpack_light::details::basic_binary_buffer::basic_binary_buffer |
( |
std::size_t | size | ) |
|
|
inlineexplicit |
◆ basic_binary_buffer() [2/3]
msgpack_light::details::basic_binary_buffer::basic_binary_buffer |
( |
const basic_binary_buffer & | other | ) |
|
|
inline |
◆ basic_binary_buffer() [3/3]
msgpack_light::details::basic_binary_buffer::basic_binary_buffer |
( |
basic_binary_buffer && | other | ) |
|
|
inlinenoexcept |
Move constructor.
- Parameters
-
[in,out] | other | Instance to move from. |
Definition at line 69 of file basic_binary_buffer.h.
◆ ~basic_binary_buffer()
msgpack_light::details::basic_binary_buffer::~basic_binary_buffer |
( |
| ) |
|
|
inline |
◆ data() [1/2]
const unsigned char * msgpack_light::details::basic_binary_buffer::data |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ data() [2/2]
unsigned char * msgpack_light::details::basic_binary_buffer::data |
( |
| ) |
|
|
inlinenodiscardnoexcept |
◆ operator=() [1/2]
Move assignment operator.
- Parameters
-
[in,out] | other | Instance to move from. |
- Returns
- This instance after move.
Definition at line 95 of file basic_binary_buffer.h.
◆ operator=() [2/2]
Copy assignment operator.
- Parameters
-
[in] | other | Instance to copy from. |
- Returns
- This instance after copy.
Definition at line 78 of file basic_binary_buffer.h.
◆ prevent_unsafe_size()
std::size_t msgpack_light::details::basic_binary_buffer::prevent_unsafe_size |
( |
std::size_t | size | ) |
|
|
inlinestaticnodiscardprivate |
Change the input to a size which won't cause implementation-defined behaviors of std::malloc and std::realloc functions.
- Parameters
-
- Returns
- Size to use in std::malloc and std::realloc functions.
Definition at line 163 of file basic_binary_buffer.h.
◆ resize()
void msgpack_light::details::basic_binary_buffer::resize |
( |
std::size_t | new_size | ) |
|
|
inline |
Change the size of the buffer.
- Parameters
-
[in] | new_size | New size of the buffer. |
- Warning
- This function always call std::realloc even when the argument is equal to the current size.
Definition at line 113 of file basic_binary_buffer.h.
◆ size()
std::size_t msgpack_light::details::basic_binary_buffer::size |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ swap()
Swap with another instance.
- Parameters
-
[in,out] | other | Instance to swap with. |
Definition at line 128 of file basic_binary_buffer.h.
◆ buffer_
unsigned char* msgpack_light::details::basic_binary_buffer::buffer_ |
|
private |
◆ size_
std::size_t msgpack_light::details::basic_binary_buffer::size_ |
|
private |
The documentation for this class was generated from the following file: