CatapultServer  v0.5.0.1 (Elephant)
SizeCalculatingOutputStream.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "Stream.h"
23 
24 namespace catapult { namespace io {
25 
28  public:
30  size_t size() const {
31  return m_size;
32  }
33 
34  public:
35  void write(const RawBuffer& buffer) override {
36  m_size += buffer.Size;
37  }
38 
39  void flush() override
40  {}
41 
42  private:
43  size_t m_size = 0;
44  };
45 }}
catapult::io::SizeCalculatingOutputStream::m_size
size_t m_size
Definition: SizeCalculatingOutputStream.h:43
catapult::io::SizeCalculatingOutputStream::flush
void flush() override
Definition: SizeCalculatingOutputStream.h:39
catapult::io::SizeCalculatingOutputStream::write
void write(const RawBuffer &buffer) override
Definition: SizeCalculatingOutputStream.h:35
catapult::io::SizeCalculatingOutputStream::size
size_t size() const
Gets the size.
Definition: SizeCalculatingOutputStream.h:30
catapult::io::SizeCalculatingOutputStream
Stream implementation for calculating the stream size.
Definition: SizeCalculatingOutputStream.h:27
catapult
Definition: AddressExtractionExtension.cpp:28
Stream.h
catapult::io::OutputStream
Writer interface.
Definition: Stream.h:41
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62