-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOperator.h
44 lines (35 loc) · 1010 Bytes
/
Operator.h
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
36
37
38
39
40
41
42
43
44
#pragma once
#include <set>
#include <string>
#include "../Schema.h"
namespace Operator
{
class _Operator
{
public:
virtual ~_Operator() = default;
virtual std::string getCode() = 0;
virtual std::set<std::string> getHeaders() { return {}; };
virtual std::string getGlobalDeclarations() { return ""; };
};
class _ConsumingOperator : virtual public _Operator
{
public:
virtual void setInputSchema(std::shared_ptr<_Schema> schema) { _inputSchema = schema; };
protected:
std::shared_ptr<_Schema> _inputSchema;
};
class _ProducingOperator : virtual public _Operator
{
public:
virtual std::shared_ptr<_Schema> getOutputSchema() = 0;
};
class _TransformingOperator
: public _ConsumingOperator
, public _ProducingOperator
{};
class _IdentityOperator : public _TransformingOperator
{
std::shared_ptr<_Schema> getOutputSchema() { return _inputSchema; };
};
}