aether::container::ring_buffer< T > Class Template Reference

#include <ring_buffer.hh>

Public Member Functions

 ring_buffer ()
 
 ring_buffer (const size_t capacity)
 
void clear ()
 
bool is_empty () const
 
bool is_full () const
 
bool has_space () const
 
size_t size () const
 
size_t free () const
 
void reserve (const size_t new_capacity)
 
void shift_to_front ()
 
size_t capacity () const
 
ssize_t try_write (const value_type *new_data, const size_t data_length)
 
int flush ()
 
ssize_t write (const value_type *new_data, const size_t data_length)
 
void extend (const value_type *new_data, const size_t data_length)
 
ssize_t read (value_type *out, const size_t out_length)
 
ssize_t try_read (value_type *out, const size_t out_length)
 
span< const value_type > get_head () const
 
span< value_type > get_unallocated ()
 
span< const value_type > get_from_offset (const size_t offset) const
 
span< const value_type > as_contiguous ()
 
void move_head (const size_t count)
 
void move_tail (const size_t count)
 

Friends

template<typename R >
int read_to_end (R &, ring_buffer< char > &)
 
template<typename R >
int extend_from_reader (R &, ring_buffer< char > &, size_t)
 

Constructor & Destructor Documentation

template<typename T>
aether::container::ring_buffer< T >::ring_buffer ( )
inline
template<typename T>
aether::container::ring_buffer< T >::ring_buffer ( const size_t  capacity)
inline

Member Function Documentation

template<typename T>
span<const value_type> aether::container::ring_buffer< T >::as_contiguous ( )
inline
template<typename T>
size_t aether::container::ring_buffer< T >::capacity ( ) const
inline
template<typename T>
void aether::container::ring_buffer< T >::clear ( )
inline
template<typename T>
void aether::container::ring_buffer< T >::extend ( const value_type *  new_data,
const size_t  data_length 
)
inline
template<typename T>
int aether::container::ring_buffer< T >::flush ( )
inline
template<typename T>
size_t aether::container::ring_buffer< T >::free ( ) const
inline
template<typename T>
span<const value_type> aether::container::ring_buffer< T >::get_from_offset ( const size_t  offset) const
inline
template<typename T>
span<const value_type> aether::container::ring_buffer< T >::get_head ( ) const
inline
template<typename T>
span<value_type> aether::container::ring_buffer< T >::get_unallocated ( )
inline
template<typename T>
bool aether::container::ring_buffer< T >::has_space ( ) const
inline
template<typename T>
bool aether::container::ring_buffer< T >::is_empty ( ) const
inline
template<typename T>
bool aether::container::ring_buffer< T >::is_full ( ) const
inline
template<typename T>
void aether::container::ring_buffer< T >::move_head ( const size_t  count)
inline
template<typename T>
void aether::container::ring_buffer< T >::move_tail ( const size_t  count)
inline
template<typename T>
ssize_t aether::container::ring_buffer< T >::read ( value_type *  out,
const size_t  out_length 
)
inline
template<typename T>
void aether::container::ring_buffer< T >::reserve ( const size_t  new_capacity)
inline
template<typename T>
void aether::container::ring_buffer< T >::shift_to_front ( )
inline
template<typename T>
size_t aether::container::ring_buffer< T >::size ( ) const
inline
template<typename T>
ssize_t aether::container::ring_buffer< T >::try_read ( value_type *  out,
const size_t  out_length 
)
inline
template<typename T>
ssize_t aether::container::ring_buffer< T >::try_write ( const value_type *  new_data,
const size_t  data_length 
)
inline
template<typename T>
ssize_t aether::container::ring_buffer< T >::write ( const value_type *  new_data,
const size_t  data_length 
)
inline

Friends And Related Function Documentation

template<typename T>
template<typename R >
int extend_from_reader ( R &  reader,
ring_buffer< char > &  buffer,
size_t  num_bytes 
)
friend
template<typename T>
template<typename R >
int read_to_end ( R &  reader,
ring_buffer< char > &  buffer 
)
friend