CatapultServer  v0.5.0.1 (Elephant)
Stream.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "catapult/types.h"
23 
24 namespace catapult { namespace io {
25 
27  class InputStream {
28  public:
29  virtual ~InputStream() = default;
30 
31  public:
33  virtual bool eof() const = 0;
34 
37  virtual void read(const MutableRawBuffer& buffer) = 0;
38  };
39 
41  class OutputStream {
42  public:
43  virtual ~OutputStream() = default;
44 
45  public:
48  virtual void write(const RawBuffer& buffer) = 0;
49 
52  virtual void flush() = 0;
53  };
54 }}
catapult::io::OutputStream::flush
virtual void flush()=0
catapult::utils::MutableRawBuffer
BasicRawBuffer< uint8_t > MutableRawBuffer
A mutable binary buffer.
Definition: RawBuffer.h:65
catapult::io::OutputStream::write
virtual void write(const RawBuffer &buffer)=0
catapult::io::InputStream
Reader interface.
Definition: Stream.h:27
catapult::io::InputStream::~InputStream
virtual ~InputStream()=default
catapult::io::InputStream::eof
virtual bool eof() const =0
Returns true if no data is left in the stream.
catapult::io::InputStream::read
virtual void read(const MutableRawBuffer &buffer)=0
types.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::io::OutputStream::~OutputStream
virtual ~OutputStream()=default
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