aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/attribute/attribute_initializer_result.h
blob: e155336bf4c7b2c68b4aa7627651ccc8cd806eda (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <memory>

namespace search {
class AttributeVector;
}

namespace proton {

/**
 * Class representing an initialized attribute.
 */
class AttributeInitializerResult
{
    using AttributeVectorSP = std::shared_ptr<search::AttributeVector>;
    AttributeVectorSP _attr;
public:
    AttributeInitializerResult(const AttributeVectorSP &attr);
    ~AttributeInitializerResult();
    const AttributeVectorSP &getAttribute() const { return _attr; }
    operator bool() const { return static_cast<bool>(_attr); }
};

} // namespace proton