![]() |
MySQL 9.2.0
Source Code Documentation
|
Sequence of memory buffers. More...
#include <buffer_sequence_view.h>
Public Types | |
using | Char_t = Char_tp |
using | Size_t = std::size_t |
using | Buffer_view_t = Buffer_view< Char_t > |
using | Buffer_allocator_t = mysql::allocators::Allocator< Buffer_view_t > |
using | Container_t = Container_tp< Buffer_view_t, Buffer_allocator_t > |
using | Const_iterator_t = typename Container_t::const_iterator |
using | Iterator_t = typename std::conditional< const_tp, Const_iterator_t, typename Container_t::iterator >::type |
Public Member Functions | |
Buffer_sequence_view (Iterator_t begin_arg, Iterator_t end_arg, Size_t size_arg=uninitialized_size) | |
Construct a Buffer_sequence_view with buffers in the range given by the iterators. More... | |
Buffer_sequence_view (Buffer_sequence_view &)=delete | |
Buffer_sequence_view (Buffer_sequence_view &&other) noexcept=default | |
Buffer_sequence_view & | operator= (Buffer_sequence_view &)=delete |
Buffer_sequence_view & | operator= (Buffer_sequence_view &&) noexcept=default |
virtual | ~Buffer_sequence_view ()=default |
Iterator_t | begin () |
Iterator to the first buffer. More... | |
Iterator_t | end () |
Iterator to the last buffer. More... | |
Const_iterator_t | begin () const |
Iterator to the first buffer. More... | |
Const_iterator_t | end () const |
Iterator to the last buffer. More... | |
Const_iterator_t | cbegin () const |
Const iterator pointing to the first buffer. More... | |
Const_iterator_t | cend () const |
Const iterator pointing to the last buffer. More... | |
template<class Destination_char_t > | |
void | copy (Destination_char_t *destination) const |
Copy all data to the given, contiguous output buffer. More... | |
template<class Str_char_t = char, class Str_traits_t = std::char_traits<Str_char_t>, class Str_allocator_t = std::allocator<Str_char_t>> | |
std::basic_string< Str_char_t, Str_traits_t, Str_allocator_t > | str (const Str_allocator_t &allocator=Str_allocator_t()) |
Return a copy of all the data in this object, as a std::string object. More... | |
Size_t | size () const |
Return the total size of all buffers. More... | |
std::string | debug_string (bool show_contents=false, int indent=0) const |
In debug mode, return a string that describes the internal structure of this object, to use for debugging. More... | |
Private Attributes | |
Iterator_t | m_begin |
Iterator to beginning of buffer. More... | |
Iterator_t | m_end |
Iterator to end of buffer. More... | |
Size_t | m_size |
Total size of all buffers, cached. More... | |
Static Private Attributes | |
static constexpr Size_t | uninitialized_size |
Indicates that m_size has not yet been computed. More... | |
Sequence of memory buffers.
This is a minimal class with just a sequence of buffers. It does not have a read/write position (
Char_tp | The type of elements stored in the buffer: typically unsigned char. |
Container_tp | The type of container to hold the buffers. This defaults to std::vector, but std::list is also possible. |
const_tp | If true, use const iterators instead of non-const iterators to represent the beginning and end of the container. |
using mysql::containers::buffers::Buffer_sequence_view< Char_tp, Container_tp, const_tp >::Buffer_allocator_t = mysql::allocators::Allocator<Buffer_view_t> |
using mysql::containers::buffers::Buffer_sequence_view< Char_tp, Container_tp, const_tp >::Buffer_view_t = Buffer_view<Char_t> |
using mysql::containers::buffers::Buffer_sequence_view< Char_tp, Container_tp, const_tp >::Char_t = Char_tp |
using mysql::containers::buffers::Buffer_sequence_view< Char_tp, Container_tp, const_tp >::Const_iterator_t = typename Container_t::const_iterator |
using mysql::containers::buffers::Buffer_sequence_view< Char_tp, Container_tp, const_tp >::Container_t = Container_tp<Buffer_view_t, Buffer_allocator_t> |
using mysql::containers::buffers::Buffer_sequence_view< Char_tp, Container_tp, const_tp >::Iterator_t = typename std::conditional<const_tp, Const_iterator_t, typename Container_t::iterator>::type |
using mysql::containers::buffers::Buffer_sequence_view< Char_tp, Container_tp, const_tp >::Size_t = std::size_t |
|
inline |
Construct a Buffer_sequence_view with buffers in the range given by the iterators.
This copies only the iterators; the underlying container and the buffers contained in the container are not copied.
begin_arg | Iterator to the first buffer. |
end_arg | Iterator to one-past-the-last buffer. |
size_arg | The total size of all buffers from begin_arg to end_arg. This is an optimization only: if the parameter is omitted, it will be computed the next time it is needed. |
|
delete |
|
defaultnoexcept |
|
virtualdefault |
|
inline |
Iterator to the first buffer.
|
inline |
Iterator to the first buffer.
|
inline |
Const iterator pointing to the first buffer.
|
inline |
Const iterator pointing to the last buffer.
|
inline |
Copy all data to the given, contiguous output buffer.
The caller is responsible for providing a buffer of at least size()
bytes.
destination | The target buffer. |
|
inline |
In debug mode, return a string that describes the internal structure of this object, to use for debugging.
show_contents | If true, includes the buffer contents. Otherwise, just pointers and sizes. |
indent | If 0, put all info on one line. Otherwise, put each field on its own line and indent the given number of two-space levels. |
|
inline |
Iterator to the last buffer.
|
inline |
Iterator to the last buffer.
|
defaultnoexcept |
|
delete |
|
inline |
Return the total size of all buffers.
|
inline |
Return a copy of all the data in this object, as a std::string
object.
|
private |
Iterator to beginning of buffer.
|
private |
Iterator to end of buffer.
|
mutableprivate |
Total size of all buffers, cached.
|
staticconstexprprivate |
Indicates that m_size
has not yet been computed.