aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchcommon/common/iblobconverter.h
blob: 4cb79a2547c8cdbd4b51e107c345ded62466c472 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/util/buffer.h>
#include <memory>

namespace search::common {

class BlobConverter
{
public:
    using SP = std::shared_ptr<BlobConverter>;
    using UP = std::unique_ptr<BlobConverter>;
    using ConstBufferRef = vespalib::ConstBufferRef;
    virtual ~BlobConverter() = default;
    ConstBufferRef convert(const ConstBufferRef & src) const { return onConvert(src); }
private:
    virtual ConstBufferRef onConvert(const ConstBufferRef & src) const = 0;
};

}