1#pragma once
2
3#include "ValueSourceVisitor.h"
4#include <Common/Exception.h>
5
6namespace DB
7{
8
9namespace ErrorCodes
10{
11 extern const int NOT_IMPLEMENTED;
12}
13
14namespace GatherUtils
15{
16
17struct IValueSource
18{
19 virtual ~IValueSource() = default;
20
21 virtual void accept(ValueSourceVisitor &)
22 {
23 throw Exception("Accept not implemented for " + demangle(typeid(*this).name()), ErrorCodes::NOT_IMPLEMENTED);
24 }
25
26 virtual bool isConst() const { return false; }
27};
28
29template <typename Derived>
30class ValueSourceImpl : public Visitable<Derived, IValueSource, ValueSourceVisitor> {};
31
32}
33
34}
35