CAF  0.17.3
Public Types | Public Member Functions | List of all members
caf::io::network::receive_buffer Class Reference

A container that does not call constructors and destructors for its values. More...

#include <receive_buffer.hpp>

Public Types

using value_type = char
 
using size_type = size_t
 
using difference_type = std::ptrdiff_t
 
using reference = value_type &
 
using const_reference = const value_type &
 
using pointer = value_type *
 
using const_pointer = std::pointer_traits< pointer >::rebind< const value_type >
 
using iterator = pointer
 
using const_iterator = const_pointer
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using buffer_ptr = std::unique_ptr< value_type[], std::default_delete< value_type[]> >
 

Public Member Functions

 receive_buffer () noexcept
 Create an empty container.
 
 receive_buffer (size_t count)
 Create an empty container of size count. More...
 
 receive_buffer (receive_buffer &&other) noexcept
 Move constructor.
 
 receive_buffer (const receive_buffer &other)
 Copy constructor.
 
receive_bufferoperator= (receive_buffer &&other) noexcept
 Move assignment operator.
 
receive_bufferoperator= (const receive_buffer &other)
 Copy assignment operator.
 
pointer data () noexcept
 Returns a pointer to the underlying buffer.
 
const_pointer data () const noexcept
 Returns a const pointer to the data.
 
size_type size () const noexcept
 Returns the number of stored elements.
 
size_type capacity () const noexcept
 Returns the number of elements that the container has allocated space for.
 
size_type max_size () const noexcept
 Returns the maximum possible number of elements the container could theoretically hold.
 
void resize (size_type new_size)
 Resize the container to new_size. More...
 
void reserve (size_type new_size)
 Set the size of the storage to new_size. More...
 
void shrink_to_fit ()
 Shrink the container to its current size.
 
bool empty () const noexcept
 Check if the container is empty.
 
void clear ()
 Clears the content of the container and releases the allocated storage.
 
void swap (receive_buffer &other) noexcept
 Swap contents with other receive buffer.
 
iterator begin () noexcept
 Returns an iterator to the beginning.
 
iterator end () noexcept
 Returns an iterator to the end.
 
const_iterator begin () const noexcept
 Returns an iterator to the beginning.
 
const_iterator end () const noexcept
 Returns an iterator to the end.
 
const_iterator cbegin () const noexcept
 Returns an iterator to the beginning.
 
const_iterator cend () const noexcept
 Returns an iterator to the end.
 
reverse_iterator rbegin () noexcept
 Returns jan iterator to the reverse beginning.
 
reverse_iterator rend () noexcept
 Returns an iterator to the reverse end of the data.
 
const_reverse_iterator rbegin () const noexcept
 Returns an iterator to the reverse beginning.
 
const_reverse_iterator rend () const noexcept
 Returns an iterator to the reverse end of the data.
 
const_reverse_iterator crbegin () const noexcept
 Returns an iterator to the reverse beginning.
 
const_reverse_iterator crend () const noexcept
 Returns an iterator to the reverse end of the data.
 
iterator insert (iterator pos, value_type value)
 Insert value before pos.
 
template<class InputIterator >
iterator insert (iterator pos, InputIterator first, InputIterator last)
 Insert value before pos.
 
void push_back (value_type value)
 Append value.
 

Detailed Description

A container that does not call constructors and destructors for its values.

Constructor & Destructor Documentation

◆ receive_buffer()

caf::io::network::receive_buffer::receive_buffer ( size_t  count)

Create an empty container of size count.

Data in the storage is not initialized.

Member Function Documentation

◆ reserve()

void caf::io::network::receive_buffer::reserve ( size_type  new_size)

Set the size of the storage to new_size.

If new_size is smaller than the current capacity nothing happens. If new_size is larger than the current capacity all iterators are invalidated.

◆ resize()

void caf::io::network::receive_buffer::resize ( size_type  new_size)

Resize the container to new_size.

While this may increase its storage, no storage will be released.


The documentation for this class was generated from the following file: