aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/data/slime/external_memory.h
blob: d8d48d57c2b963d0fa9d2fc97fa2b10d83bc0e77 (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 Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <memory>
#include <vespa/vespalib/data/memory.h>

namespace vespalib::slime {

/**
 * Interface used to access external memory. External memory does not
 * need to be copied when added to a Slime object. The Memory obtained
 * by calling the get function must be valid until the object
 * implementing this interface is destructed.
 **/
struct ExternalMemory {
    using UP = std::unique_ptr<ExternalMemory>;
    virtual Memory get() const = 0;
    virtual ~ExternalMemory() = default;
};

} // namespace vespalib::slime