31 #ifndef _SCC_UTIL_RWCOUNTER_H
32 #define _SCC_UTIL_RWCOUNTER_H
61 std::shared_ptr<Reader> m_shared;
62 std::atomic_uint_least64_t m_count;
63 std::atomic_uint_least64_t m_calls;
78 virtual void read_reset(
const std::shared_ptr<Reader>&);
79 virtual std::shared_ptr<Reader> read_shared()
const {
return m_shared; }
81 virtual size_t read(
void*,
size_t);
83 uint64_t read_count()
const {
return m_count; }
84 void read_count(uint64_t v) { m_count = v; }
85 void read_count_reset() { m_count = 0; }
86 uint64_t read_calls()
const {
return m_calls; }
87 void read_calls(uint64_t v) { m_calls = v; }
88 void read_calls_reset() { m_calls = 0; }
99 std::shared_ptr<Writer> m_shared;
100 std::atomic_uint_least64_t m_count;
101 std::atomic_uint_least64_t m_calls;
116 virtual void write_reset(
const std::shared_ptr<Writer>&);
117 virtual std::shared_ptr<Writer> write_shared()
const {
return m_shared; }
119 virtual size_t write(
const void*,
size_t);
121 uint64_t write_count()
const {
return m_count; }
122 void write_count(uint64_t v) { m_count = v; }
123 void write_count_reset() { m_count = 0; }
124 uint64_t write_calls()
const {
return m_calls; }
125 void write_calls(uint64_t v) { m_calls = v; }
126 void write_calls_reset() { m_calls = 0; }
142 RwCounter(
const std::shared_ptr<Reader>&,
const std::shared_ptr<Writer>&);
Adds byte count to a read stream.
ReadCounter()
Reads will return 0 until reset.
void read_reset(Reader &)
Reset the chained reader.
virtual size_t read(void *, size_t)
Read interface.
Adds byte count to a read/write stream.
RwCounter()
Reads and writes will return 0 until reset.
Adds byte count to a write stream.
void write_reset(Writer &)
Reset the chained writer.
virtual size_t write(const void *, size_t)
Write interface.
WriteCounter()
Writes will return 0 until reset.
Input/output stream base reader/writer interface classes.
Pipeline reader to carry out processing in a pipeline (chain of readers).
Pipeline writer to carry out processing in a pipeline (chain of writers).
Interface class for objects which can be read.
Interface class for objects which can be written.