blob: 1e884b1c836d0e83788ae54ed39e8adfee5b4676 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "input.h"
namespace vespalib {
/**
* Thin wrapper presenting a single chunk of Memory as an Input.
**/
class MemoryInput : public Input
{
private:
Memory _data;
size_t _pos;
public:
MemoryInput(const Memory data) : _data(data), _pos(0) {}
Memory obtain() override;
Input &evict(size_t bytes) override;
};
} // namespace vespalib
|