aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/vespa/document/datatype/annotationreferencedatatype.h
blob: 1498f01c80842362e1da3e799a0b078748a3ae13 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "annotationtype.h"
#include "datatype.h"

namespace document {

class AnnotationReferenceDataType final : public DataType {
    const AnnotationType *_type;

public:
    using SP = std::shared_ptr<AnnotationReferenceDataType>;

    AnnotationReferenceDataType(const AnnotationType &type, int id);
    AnnotationReferenceDataType(const AnnotationReferenceDataType &) = delete;
    AnnotationReferenceDataType & operator=(const AnnotationReferenceDataType &) = delete;
    ~AnnotationReferenceDataType() override;
    const AnnotationType &getAnnotationType() const;
    void print(std::ostream &out, bool verbose, const std::string &indent) const override;
    std::unique_ptr<FieldValue> createFieldValue() const override;
    void onBuildFieldPath(FieldPath & path, vespalib::stringref remainFieldName) const override;
};

}  // namespace document