rippled
Loading...
Searching...
No Matches
server/Writer.h
1#ifndef XRPL_SERVER_WRITER_H_INCLUDED
2#define XRPL_SERVER_WRITER_H_INCLUDED
3
4#include <boost/asio/buffer.hpp>
5
6#include <functional>
7#include <vector>
8
9namespace ripple {
10
11class Writer
12{
13public:
14 virtual ~Writer() = default;
15
17 virtual bool
18 complete() = 0;
19
24 virtual void
25 consume(std::size_t bytes) = 0;
26
32 virtual bool
33 prepare(std::size_t bytes, std::function<void(void)> resume) = 0;
34
37 data() = 0;
38};
39
40} // namespace ripple
41
42#endif
virtual ~Writer()=default
virtual std::vector< boost::asio::const_buffer > data()=0
Returns a ConstBufferSequence representing the input sequence.
virtual bool complete()=0
Returns true if there is no more data to pull.
virtual bool prepare(std::size_t bytes, std::function< void(void)> resume)=0
Add data to the input sequence.
virtual void consume(std::size_t bytes)=0
Removes bytes from the input sequence.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6