qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches

Implementation of a dynamic extensible buffer. More...

#include <array>
#include <cstring>
#include <iostream>
#include <memory>
#include <qb/string.h>
#include <qb/utility/branch_hints.h>
#include <qb/utility/nocopy.h>
#include <qb/utility/prefix.h>
#include <string_view>
#include <vector>
Include dependency graph for pipe.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  qb::allocator::base_pipe< T >
 Base class for the extensible buffer. More...
class  qb::allocator::pipe< T >
 Extensible buffer optimized for performance. More...
class  qb::allocator::pipe< char >
 Specialization of the extensible buffer for characters.

Functions

template<typename T, typename U>
constexpr auto qb::allocator::getItemSize ()
 Calculates the number of elements of type U needed to store an element of type T.
template<typename stream, typename = std::enable_if_t< !std::is_same_v<stream, qb::allocator::pipe<char>>>>
stream & operator<< (stream &os, qb::allocator::pipe< char > const &p)
 Stream operator to display the content of a pipe<char>

Detailed Description

Implementation of a dynamic extensible buffer.

This file defines the base_pipe and pipe classes that implement an extensible buffer capable of storing data efficiently with automatic capacity management. These classes are widely used in the asynchronous I/O system for managing input and output data.

Author
qb - C++ Actor Framework

Function Documentation

◆ getItemSize()

template<typename T, typename U>
auto qb::allocator::getItemSize ( )
constexpr

Calculates the number of elements of type U needed to store an element of type T.

Template Parameters
TType of the element to store
UBase type of the pipe
Returns
Number of elements of type U needed

◆ operator<<()

template<typename stream, typename = std::enable_if_t< !std::is_same_v<stream, qb::allocator::pipe<char>>>>
stream & operator<< ( stream & os,
qb::allocator::pipe< char > const & p )

Stream operator to display the content of a pipe<char>

Template Parameters
streamType of output stream
Parameters
osOutput stream
pPipe to display
Returns
Reference to the output stream