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

Sink wrapper that counts the number of bytes written through it. More...

#include <staticlib/io/counting_sink.hpp>

Public Member Functions

 counting_sink (Sink &&sink)
 Constructor, created sink wrapper will own specified sink.
 counting_sink (const counting_sink &)
 Deleted copy constructor.
counting_sink & operator= (const counting_sink &)
 Deleted copy assignment operator.
 counting_sink (counting_sink &&other) STATICLIB_NOEXCEPT
 Move constructor.
counting_sink & operator= (counting_sink &&other) STATICLIB_NOEXCEPT
 Move assignment operator.
std::streamsize write (span< const char > span)
 Counting write implementation.
std::streamsize flush ()
 Flushes destination sink.
size_t get_count ()
 Returns number of bytes written through this instance.
Sink & get_sink ()
 Underlying sink accessor.

Detailed Description

template<typename Sink>
class staticlib::io::counting_sink< Sink >

Sink wrapper that counts the number of bytes written through it.

Constructor & Destructor Documentation

template<typename Sink >
staticlib::io::counting_sink< Sink >::counting_sink ( Sink &&  sink)
inlineexplicit

Constructor, created sink wrapper will own specified sink.

Parameters
sinkdestination sink
template<typename Sink >
staticlib::io::counting_sink< Sink >::counting_sink ( const counting_sink< Sink > &  )

Deleted copy constructor.

Parameters
otherinstance
template<typename Sink >
staticlib::io::counting_sink< Sink >::counting_sink ( counting_sink< Sink > &&  other)
inline

Move constructor.

Parameters
otherother instance

Member Function Documentation

template<typename Sink >
std::streamsize staticlib::io::counting_sink< Sink >::flush ( )
inline

Flushes destination sink.

Returns
number of bytes flushed
template<typename Sink >
size_t staticlib::io::counting_sink< Sink >::get_count ( )
inline

Returns number of bytes written through this instance.

Returns
number of bytes written through this instance
template<typename Sink >
Sink& staticlib::io::counting_sink< Sink >::get_sink ( )
inline

Underlying sink accessor.

Returns
underlying sink reference
template<typename Sink >
counting_sink& staticlib::io::counting_sink< Sink >::operator= ( const counting_sink< Sink > &  )

Deleted copy assignment operator.

Parameters
otherinstance
Returns
this instance
template<typename Sink >
counting_sink& staticlib::io::counting_sink< Sink >::operator= ( counting_sink< Sink > &&  other)
inline

Move assignment operator.

Parameters
otherother instance
Returns
this instance
template<typename Sink >
std::streamsize staticlib::io::counting_sink< Sink >::write ( span< const char >  span)
inline

Counting write implementation.

Parameters
spanbuffer span
Returns
number of bytes processed

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