Fixed newline characters throughout the code
[com/gs-lite.git] / include / hfta / base_operator.h
1 /* ------------------------------------------------
2 Copyright 2014 AT&T Intellectual Property
3    Licensed under the Apache License, Version 2.0 (the "License");
4    you may not use this file except in compliance with the License.
5    You may obtain a copy of the License at
6
7      http://www.apache.org/licenses/LICENSE-2.0
8
9    Unless required by applicable law or agreed to in writing, software
10    distributed under the License is distributed on an "AS IS" BASIS,
11    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12    See the License for the specific language governing permissions and
13    limitations under the License.
14  ------------------------------------------- */
15
16 #ifndef BASE_OPERATOR_H
17 #define BASE_OPERATOR_H
18
19 #include "host_tuple.h"
20 #include <list>
21 using namespace std;
22
23 class base_operator
24 {
25 protected:
26         unsigned int output_channel;
27         const char* op_name;
28 public:
29 //                      Tuple is presented to the operator.  Output tuples
30 //                      returned in result
31         virtual int accept_tuple(host_tuple& tup, list<host_tuple>& result) = 0;
32 //                      Flush output from the system
33         virtual int flush(list<host_tuple>& result) = 0;
34 //                      Accept new query parameters
35         virtual int set_param_block(int sz, void * value) = 0;
36         virtual int get_temp_status(host_tuple& result) = 0;
37         virtual int get_blocked_status () = 0;
38
39         base_operator(const char* name) {
40                 output_channel = 0;
41                 op_name = name;
42         }
43
44         void set_output_channel(unsigned int channel) {
45                 output_channel = channel;
46         }
47
48 //                      Operator's memory footprint in bytes (estimate for the main structures - hash tables, etc )
49         virtual unsigned int get_mem_footprint() { return 0;    }
50
51         virtual const char* get_name() { return op_name; }
52
53         virtual ~base_operator() {}
54 };
55
56 #endif  // BASE_OPERATOR_H