staticlib_io  1.2.11
 All Classes Namespaces Files Functions Variables
Public Member Functions | List of all members
staticlib::io::buffered_sink< Sink, buf_size > Class Template Reference

Sink wrapper that buffers the output. More...

#include <staticlib/io/buffered_sink.hpp>

Public Member Functions

 buffered_sink (Sink &&sink)
 Constructor, created sink wrapper will own specified sink.
 ~buffered_sink () STATICLIB_NOEXCEPT
 Destructor, flushes the buffer before destroy.
 buffered_sink (const buffered_sink &)
 Deleted copy constructor.
buffered_sink & operator= (const buffered_sink &)
 Deleted copy assignment operator.
 buffered_sink (buffered_sink &&other) STATICLIB_NOEXCEPT
 Move constructor.
buffered_sink & operator= (buffered_sink &&other) STATICLIB_NOEXCEPT
 Move assignment operator.
std::streamsize write (span< const char > span)
 Buffered write implementation.
std::streamsize flush ()
 Flushes the buffer to the destination sink.
Sink & get_sink ()
 Underlying sink accessor.
std::array< char, buf_size > & get_buffer ()
 Buffer accessor.

Detailed Description

template<typename Sink, std::size_t buf_size = 4096>
class staticlib::io::buffered_sink< Sink, buf_size >

Sink wrapper that buffers the output.

Constructor & Destructor Documentation

template<typename Sink, std::size_t buf_size = 4096>
staticlib::io::buffered_sink< Sink, buf_size >::buffered_sink ( Sink &&  sink)
inlineexplicit

Constructor, created sink wrapper will own specified sink.

Parameters
sinkdestination sink to wrap
template<typename Sink, std::size_t buf_size = 4096>
staticlib::io::buffered_sink< Sink, buf_size >::~buffered_sink ( )
inline

Destructor, flushes the buffer before destroy.

template<typename Sink, std::size_t buf_size = 4096>
staticlib::io::buffered_sink< Sink, buf_size >::buffered_sink ( const buffered_sink< Sink, buf_size > &  )

Deleted copy constructor.

Parameters
otherinstance
template<typename Sink, std::size_t buf_size = 4096>
staticlib::io::buffered_sink< Sink, buf_size >::buffered_sink ( buffered_sink< Sink, buf_size > &&  other)
inline

Move constructor.

Parameters
otherother instance

Member Function Documentation

template<typename Sink, std::size_t buf_size = 4096>
std::streamsize staticlib::io::buffered_sink< Sink, buf_size >::flush ( )
inline

Flushes the buffer to the destination sink.

Returns
number of bytes flushed
template<typename Sink, std::size_t buf_size = 4096>
std::array<char, buf_size>& staticlib::io::buffered_sink< Sink, buf_size >::get_buffer ( )
inline

Buffer accessor.

Returns
buffer reference
template<typename Sink, std::size_t buf_size = 4096>
Sink& staticlib::io::buffered_sink< Sink, buf_size >::get_sink ( )
inline

Underlying sink accessor.

Returns
underlying sink reference
template<typename Sink, std::size_t buf_size = 4096>
buffered_sink& staticlib::io::buffered_sink< Sink, buf_size >::operator= ( const buffered_sink< Sink, buf_size > &  )

Deleted copy assignment operator.

Parameters
otherinstance
Returns
this instance
template<typename Sink, std::size_t buf_size = 4096>
buffered_sink& staticlib::io::buffered_sink< Sink, buf_size >::operator= ( buffered_sink< Sink, buf_size > &&  other)
inline

Move assignment operator.

Parameters
otherother instance
Returns
this instance
template<typename Sink, std::size_t buf_size = 4096>
std::streamsize staticlib::io::buffered_sink< Sink, buf_size >::write ( span< const char >  span)
inline

Buffered write implementation.

Parameters
spanbuffer span
Returns
number of bytes processed

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