| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <DataTypes/IDataTypeDummy.h> |
| 4 | |
| 5 | |
| 6 | namespace DB |
| 7 | { |
| 8 | |
| 9 | /** Special data type, representing lambda expression. |
| 10 | */ |
| 11 | class DataTypeFunction final : public IDataTypeDummy |
| 12 | { |
| 13 | private: |
| 14 | DataTypes argument_types; |
| 15 | DataTypePtr return_type; |
| 16 | |
| 17 | public: |
| 18 | static constexpr bool is_parametric = true; |
| 19 | bool isParametric() const override { return true; } |
| 20 | |
| 21 | /// Some types could be still unknown. |
| 22 | DataTypeFunction(const DataTypes & argument_types_ = DataTypes(), const DataTypePtr & return_type_ = nullptr) |
| 23 | : argument_types(argument_types_), return_type(return_type_) {} |
| 24 | |
| 25 | std::string doGetName() const override; |
| 26 | const char * getFamilyName() const override { return "Function"; } |
| 27 | TypeIndex getTypeId() const override { return TypeIndex::Function; } |
| 28 | |
| 29 | const DataTypes & getArgumentTypes() const |
| 30 | { |
| 31 | return argument_types; |
| 32 | } |
| 33 | |
| 34 | const DataTypePtr & getReturnType() const |
| 35 | { |
| 36 | return return_type; |
| 37 | } |
| 38 | |
| 39 | bool equals(const IDataType & rhs) const override; |
| 40 | }; |
| 41 | |
| 42 | } |
| 43 |