1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/function/function_set.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/function/aggregate_function.hpp"
12#include "duckdb/function/scalar_function.hpp"
13
14namespace duckdb {
15
16template <class T> class FunctionSet {
17public:
18 FunctionSet(string name) : name(name) {
19 }
20
21 //! The name of the function set
22 string name;
23 //! The set of functions
24 vector<T> functions;
25
26public:
27 void AddFunction(T function) {
28 function.name = name;
29 functions.push_back(function);
30 }
31};
32
33class ScalarFunctionSet : public FunctionSet<ScalarFunction> {
34public:
35 ScalarFunctionSet(string name) : FunctionSet(move(name)) {
36 }
37};
38
39class AggregateFunctionSet : public FunctionSet<AggregateFunction> {
40public:
41 AggregateFunctionSet(string name) : FunctionSet(move(name)) {
42 }
43};
44
45} // namespace duckdb
46