blob: a24c01e3fda672e35fcd72812f2ecb8adc83906b (
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
25
26
27
28
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "iattributefilewriter.h"
#include <vector>
namespace search
{
/*
* Class to write to a memory buffer representation of a single
* attribute vector file (without header). Used by AttributeMemorySaveTarget.
*/
class AttributeMemoryFileWriter : public IAttributeFileWriter
{
std::vector<Buffer> _bufs;
public:
AttributeMemoryFileWriter();
~AttributeMemoryFileWriter();
virtual Buffer allocBuf(size_t size) override;
virtual void writeBuf(Buffer buf) override;
virtual std::unique_ptr<BufferWriter> allocBufferWriter() override;
void writeTo(IAttributeFileWriter &writer);
};
} // namespace search
|