77template<
bool S_SHARING_ALLOWED>
80 public Basic_blob<std::allocator<uint8_t>, S_SHARING_ALLOWED>
247 template<
typename Emit_blob_func>
263 template<
typename Blob_container>
280 template<
typename Blob_ptr_container>
342template<
bool S_SHARING_ALLOWED>
344 log::Log_context(logger_ptr,
Base::S_LOG_COMPONENT)
350template<
bool S_SHARING_ALLOWED>
352 log::Log_context(logger_ptr,
Base::S_LOG_COMPONENT),
353 Base(size, get_logger())
358template<
bool S_SHARING_ALLOWED>
360 log::Log_context(static_cast<log::Log_context&&>(std::move(moved_src))),
361 Base(std::move(moved_src), get_logger())
366template<
bool S_SHARING_ALLOWED>
368 log::Log_context(static_cast<const log::Log_context&>(src)),
369 Base(src, get_logger())
374template<
bool S_SHARING_ALLOWED>
383template<
bool S_SHARING_ALLOWED>
389 Log_context::operator=(
static_cast<const Log_context&
>(src));
390 Base::assign(src, get_logger());
394template<
bool S_SHARING_ALLOWED>
400 Log_context::operator=(
static_cast<Log_context&&
>(std::move(moved_src)));
401 Base::assign(std::move(moved_src), get_logger());
405template<
bool S_SHARING_ALLOWED>
413 swap(*
static_cast<Log_context*
>(
this),
static_cast<Log_context&
>(other));
418template<
bool S_SHARING_ALLOWED>
421 return blob1.
swap(blob2);
424template<
bool S_SHARING_ALLOWED>
428 static_cast<Base&
>(blob) = Base::share(get_logger());
432template<
bool S_SHARING_ALLOWED>
437 static_cast<Base&
>(blob) = Base::share_after_split_left(lt_size, get_logger());
441template<
bool S_SHARING_ALLOWED>
446 static_cast<Base&
>(blob) = Base::share_after_split_right(rt_size, get_logger());
450template<
bool S_SHARING_ALLOWED>
451template<
typename Emit_blob_func>
453 Emit_blob_func&& emit_blob_func)
455 Base::share_after_split_equally_impl(size, headless_pool, std::move(emit_blob_func), get_logger(),
459 assert(logger_ptr == get_logger());
460 return share_after_split_left(lt_size);
464template<
bool S_SHARING_ALLOWED>
465template<
typename Blob_container>
467 Blob_container* out_blobs_ptr)
471 assert(out_blobs_ptr);
474 out_blobs_ptr->push_back(std::move(blob_moved));
478template<
bool S_SHARING_ALLOWED>
479template<
typename Blob_ptr_container>
482 Blob_ptr_container* out_blobs_ptr)
487 using Ptr =
typename Blob_ptr_container::value_type;
489 assert(out_blobs_ptr);
497template<
bool S_SHARING_ALLOWED>
500 Base::reserve(new_capacity, get_logger());
503template<
bool S_SHARING_ALLOWED>
506 Base::resize(new_size, new_start_or_unchanged, get_logger());
509template<
bool S_SHARING_ALLOWED>
512 Base::make_zero(get_logger());
515template<
bool S_SHARING_ALLOWED>
519 return Base::assign_copy(src, get_logger());
522template<
bool S_SHARING_ALLOWED>
526 return Base::emplace_copy(dest, src, get_logger());
529template<
bool S_SHARING_ALLOWED>
533 return Base::sub_copy(src, dest, get_logger());
Convenience class that simply stores a Logger and/or Component passed into a constructor; and returns...
Interface that the user should implement, passing the implementing Logger into logging classes (Flow'...
A hand-optimized and API-tweaked replacement for vector<uint8_t>, i.e., buffer of bytes inside an all...
value_type const * Const_iterator
Type for iterator pointing into an immutable structure of this type.
Const_iterator const_iterator
For container compliance (hence the irregular capitalization): Const_iterator type.
std::ptrdiff_t difference_type
Type for difference of size_types.
static constexpr bool S_SHARING
Value of template parameter S_SHARING_ALLOWED (for generic programming).
size_type capacity() const
Returns the number of elements in the internally allocated buffer, which is 1 or more; or 0 if no buf...
value_type & reference
For container compliance (hence the irregular capitalization): reference to element.
static constexpr size_type S_UNCHANGED
Special value indicating an unchanged size_type value; such as in resize().
const value_type & const_reference
For container compliance (hence the irregular capitalization): reference to const element.
size_type size() const
Returns number of elements stored, namely end() - begin().
value_type * Iterator
Type for iterator pointing into a mutable structure of this type.
Const_iterator const_pointer
For container compliance (hence the irregular capitalization): pointer to const element.
Iterator pointer
For container compliance (hence the irregular capitalization): pointer to element.
std::allocator< uint8_t > Allocator_raw
Short-hand for the allocator type specified at compile-time. Its element type is our value_type.
Iterator iterator
For container compliance (hence the irregular capitalization): Iterator type.
uint8_t value_type
Short-hand for values, which in this case are unsigned bytes.
std::size_t size_type
Type for index into blob or length of blob or sub-blob.
Basic_blob that works in regular heap (and is itself placed in heap or stack) and memorizes a log::Lo...
Blob_with_log_context share() const
On top of the similar Basic_blob method, logs using the stored log context and copies it to the retur...
void make_zero()
On top of the similar Basic_blob method, logs using the stored log context.
typename Base::const_iterator const_iterator
Short-hand for base member (needed because base access to a template must be qualified otherwise).
void reserve(size_type capacity)
On top of the similar Basic_blob method, logs using the stored log context.
size_type assign_copy(const boost::asio::const_buffer &src)
On top of the similar Basic_blob method, logs using the stored log context.
typename Base::Allocator_raw Allocator_raw
Short-hand for base member (needed because base access to a template must be qualified otherwise).
void share_after_split_equally(size_type size, bool headless_pool, Emit_blob_func &&emit_blob_func)
On top of the similar Basic_blob method, logs using the stored log context and copies it to the emitt...
void swap(Blob_with_log_context &other)
On top of the similar Basic_blob method, logs using the stored log context.
Blob_with_log_context & operator=(Blob_with_log_context &&moved_src)
On top of the similar Basic_blob method, logs using the stored log context.
Blob_with_log_context(log::Logger *logger_ptr=0)
On top of the similar 2-arg Basic_blob ctor, memorizes the given log::Logger for all future logging i...
typename Base::difference_type difference_type
Short-hand for base member (needed because base access to a template must be qualified otherwise).
typename Base::iterator iterator
Short-hand for base member (needed because base access to a template must be qualified otherwise).
typename Base::const_pointer const_pointer
Short-hand for base member (needed because base access to a template must be qualified otherwise).
static constexpr auto S_SHARING
Short-hand for base member (needed because base access to a template must be qualified otherwise).
void share_after_split_equally_emit_seq(size_type size, bool headless_pool, Blob_container *out_blobs)
On top of the similar Basic_blob method, logs using the stored log context and copies it to the emitt...
typename Base::pointer pointer
Short-hand for base member (needed because base access to a template must be qualified otherwise).
Iterator emplace_copy(Const_iterator dest, const boost::asio::const_buffer &src)
On top of the similar Basic_blob method, logs using the stored log context.
typename Base::Iterator Iterator
Short-hand for base member (needed because base access to a template must be qualified otherwise).
typename Base::const_reference const_reference
Short-hand for base member (needed because base access to a template must be qualified otherwise).
Blob_with_log_context share_after_split_left(size_type size)
On top of the similar Basic_blob method, logs using the stored log context and copies it to the retur...
static constexpr auto S_UNCHANGED
Short-hand for base member (needed because base access to a template must be qualified otherwise).
void resize(size_type size, size_type start_or_unchanged=S_UNCHANGED)
On top of the similar Basic_blob method, logs using the stored log context.
typename Base::value_type value_type
Short-hand for base member (needed because base access to a template must be qualified otherwise).
void share_after_split_equally_emit_ptr_seq(size_type size, bool headless_pool, Blob_ptr_container *out_blobs)
On top of the similar Basic_blob method, logs using the stored log context and copes it to the emitte...
typename Base::Const_iterator Const_iterator
Short-hand for base member (needed because base access to a template must be qualified otherwise).
typename Base::size_type size_type
Short-hand for base member (needed because base access to a template must be qualified otherwise).
Const_iterator sub_copy(Const_iterator src, const boost::asio::mutable_buffer &dest) const
On top of the similar Basic_blob method, logs using the stored log context.
typename Base::reference reference
Short-hand for base member (needed because base access to a template must be qualified otherwise).
Blob_with_log_context share_after_split_right(size_type size)
On top of the similar Basic_blob method, logs using the stored log context and copies it to the retur...
~Blob_with_log_context()
On top of the similar Basic_blob dtor, adds some possible TRACE-logging.
Flow module containing miscellaneous general-use facilities that don't fit into any other Flow module...
void swap(Basic_blob< Allocator, S_SHARING_ALLOWED > &blob1, Basic_blob< Allocator, S_SHARING_ALLOWED > &blob2, log::Logger *logger_ptr)
Equivalent to blob1.swap(blob2).
void swap(Blob_with_log_context< S_SHARING_ALLOWED > &blob1, Blob_with_log_context< S_SHARING_ALLOWED > &blob2)
On top of the similar Basic_blob related function, logs using the stored log context of blob1.