aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/attribute/attribute_initializer_result.h
blob: 528b1eb6812a6ab3e2c1e44f3d6c94dc03ca25a6 (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 Yahoo. 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