cpp-mate  0.7
Helpful library for C++.
CppMate::BinarySink::Counter Class Reference

Represents sink implementation which splits source data into chunks with specified size. More...

#include <BinarySink.hpp>

Inheritance diagram for CppMate::BinarySink::Counter:
Collaboration diagram for CppMate::BinarySink::Counter:

Public Member Functions

 Counter (BinarySink &sink)
 Constructor. More...
 
 Counter (std::shared_ptr< BinarySink > sink)
 Constructor. More...
 
uint64_t getBytesWritten () const
 Returns total bytes written into the sink. More...
 
void resetCounter ()
 Resets counter. More...
 
void write (const void *data, uint64_t size) override
 Writes data into the sink. More...
 
- Public Member Functions inherited from CppMate::BinarySink
virtual ~BinarySink ()=default
 

Detailed Description

Represents sink implementation which splits source data into chunks with specified size.

Constructor & Destructor Documentation

◆ Counter() [1/2]

Constructor.

Parameters
sinkthe underlying sink.

◆ Counter() [2/2]

CppMate::BinarySink::Counter::Counter ( std::shared_ptr< BinarySink sink)
inline

Constructor.

Parameters
sinkthe underlying sink.
Exceptions
std::invalid_argument

Member Function Documentation

◆ getBytesWritten()

uint64_t CppMate::BinarySink::Counter::getBytesWritten ( ) const
inline

Returns total bytes written into the sink.

Returns
total bytes written into the sink.

◆ resetCounter()

void CppMate::BinarySink::Counter::resetCounter ( )
inline

Resets counter.

◆ write()

void CppMate::BinarySink::Counter::write ( const void *  data,
uint64_t  size 
)
inlineoverridevirtual

Writes data into the sink.

Parameters
datathe pointer to data.
sizethe size of data.
Exceptions
std::invalid_argument,std::ostream::failure

Implements CppMate::BinarySink.


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