blob: 1f16a21bd681bda2930704becdf02e059317e228 (
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
28
29
30
31
32
33
34
35
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
* \class document::CollectionDataType
* \ingroup datatype
*
* \brief Data type used for collections of data with similar types.
*
* This contains common functionality for array and weighted set datatypes.
*/
#pragma once
#include "datatype.h"
namespace document {
class CollectionDataType : public DataType {
const DataType *_nestedType;
protected:
CollectionDataType(vespalib::stringref name, const DataType &nestedType) noexcept;
CollectionDataType(vespalib::stringref name, const DataType &nestedType, int32_t id) noexcept;
public:
CollectionDataType(const CollectionDataType&) = delete;
CollectionDataType& operator=(const CollectionDataType&) = delete;
~CollectionDataType() override;
bool equals(const DataType&) const noexcept override;
const DataType &getNestedType() const noexcept { return *_nestedType; }
const CollectionDataType * cast_collection() const noexcept override { return this; }
};
} // document
|