blob: 082af648419fbe7dc62d6202b8bb8f26b66e35ab (
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
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/eval/eval/value.h>
#include <cassert>
namespace vespalib::eval {
/**
* A dense-only value that just owns a vector of cells.
**/
template<typename T>
class DenseCellsValue : public Value {
private:
ValueType _type;
std::vector<T> _cells;
public:
DenseCellsValue(const ValueType &type_ref, std::vector<T> cells)
: _type(type_ref), _cells(std::move(cells))
{
assert(check_cell_type<T>(_type.cell_type()));
assert(_cells.size() == _type.dense_subspace_size());
}
const ValueType &type() const override { return _type; }
TypedCells cells() const override { return TypedCells(_cells); }
const Index &index() const override { return TrivialIndex::get(); }
MemoryUsage get_memory_usage() const override;
~DenseCellsValue();
};
}
|