GPUdb C++ API  Version 6.1.0.0
filter.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the GPUdb schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __FILTER_H__
7 #define __FILTER_H__
8 
9 namespace gpudb
10 {
11 
28  {
29 
34  tableName(std::string()),
35  viewName(std::string()),
36  expression(std::string()),
37  options(std::map<std::string, std::string>())
38  {
39  }
40 
73  FilterRequest(const std::string& tableName_, const std::string& viewName_, const std::string& expression_, const std::map<std::string, std::string>& options_):
74  tableName( tableName_ ),
75  viewName( viewName_ ),
76  expression( expression_ ),
77  options( options_ )
78  {
79  }
80 
81  std::string tableName;
82  std::string viewName;
83  std::string expression;
84  std::map<std::string, std::string> options;
85  };
86 }
87 
88 namespace avro
89 {
90  template<> struct codec_traits<gpudb::FilterRequest>
91  {
92  static void encode(Encoder& e, const gpudb::FilterRequest& v)
93  {
94  ::avro::encode(e, v.tableName);
95  ::avro::encode(e, v.viewName);
96  ::avro::encode(e, v.expression);
97  ::avro::encode(e, v.options);
98  }
99 
100  static void decode(Decoder& d, gpudb::FilterRequest& v)
101  {
102  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
103  {
104  const std::vector<size_t> fo = rd->fieldOrder();
105 
106  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
107  {
108  switch (*it)
109  {
110  case 0:
111  ::avro::decode(d, v.tableName);
112  break;
113 
114  case 1:
115  ::avro::decode(d, v.viewName);
116  break;
117 
118  case 2:
119  ::avro::decode(d, v.expression);
120  break;
121 
122  case 3:
123  ::avro::decode(d, v.options);
124  break;
125 
126  default:
127  break;
128  }
129  }
130  }
131  else
132  {
133  ::avro::decode(d, v.tableName);
134  ::avro::decode(d, v.viewName);
135  ::avro::decode(d, v.expression);
136  ::avro::decode(d, v.options);
137  }
138  }
139  };
140 }
141 
142 namespace gpudb
143 {
144 
161  {
162 
167  count(int64_t())
168  {
169  }
170 
171  int64_t count;
172  };
173 }
174 
175 namespace avro
176 {
177  template<> struct codec_traits<gpudb::FilterResponse>
178  {
179  static void encode(Encoder& e, const gpudb::FilterResponse& v)
180  {
181  ::avro::encode(e, v.count);
182  }
183 
184  static void decode(Decoder& d, gpudb::FilterResponse& v)
185  {
186  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
187  {
188  const std::vector<size_t> fo = rd->fieldOrder();
189 
190  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
191  {
192  switch (*it)
193  {
194  case 0:
195  ::avro::decode(d, v.count);
196  break;
197 
198  default:
199  break;
200  }
201  }
202  }
203  else
204  {
205  ::avro::decode(d, v.count);
206  }
207  }
208  };
209 }
210 
211 #endif
std::map< std::string, std::string > options
Definition: filter.h:84
FilterRequest()
Constructs a FilterRequest object with default parameter values.
Definition: filter.h:33
FilterResponse()
Constructs a FilterResponse object with default parameter values.
Definition: filter.h:166
A set of input parameters for filter(const FilterRequest&) const.
Definition: filter.h:27
std::string viewName
Definition: filter.h:82
std::string tableName
Definition: filter.h:81
A set of output parameters for filter(const FilterRequest&) const.
Definition: filter.h:160
std::string expression
Definition: filter.h:83
FilterRequest(const std::string &tableName_, const std::string &viewName_, const std::string &expression_, const std::map< std::string, std::string > &options_)
Constructs a FilterRequest object with the specified parameters.
Definition: filter.h:73