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
7 http://www.apache.org/licenses/LICENSE-2.0
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 ------------------------------------------- */
16 #ifndef BASE_OPERATOR_H
17 #define BASE_OPERATOR_H
19 #include "host_tuple.h"
26 unsigned int output_channel;
29 // Tuple is presented to the operator. Output tuples
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;
39 base_operator(const char* name) {
44 void set_output_channel(unsigned int channel) {
45 output_channel = channel;
48 // Operator's memory footprint in bytes (estimate for the main structures - hash tables, etc )
49 virtual unsigned int get_mem_footprint() { return 0; }
51 virtual const char* get_name() { return op_name; }
53 virtual ~base_operator() {}
56 #endif // BASE_OPERATOR_H