GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
aggregate_histogram.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 __AGGREGATE_HISTOGRAM_H__
7 #define __AGGREGATE_HISTOGRAM_H__
8 
9 namespace gpudb
10 {
11 
35  {
36 
42  tableName(std::string()),
43  columnName(std::string()),
44  start(double()),
45  end(double()),
46  interval(double()),
47  options(std::map<std::string, std::string>())
48  {
49  }
50 
81  AggregateHistogramRequest(const std::string& tableName_, const std::string& columnName_, const double start_, const double end_, const double interval_, const std::map<std::string, std::string>& options_):
82  tableName( tableName_ ),
83  columnName( columnName_ ),
84  start( start_ ),
85  end( end_ ),
86  interval( interval_ ),
87  options( options_ )
88  {
89  }
90 
91  std::string tableName;
92  std::string columnName;
93  double start;
94  double end;
95  double interval;
96  std::map<std::string, std::string> options;
97  };
98 }
99 
100 namespace avro
101 {
102  template<> struct codec_traits<gpudb::AggregateHistogramRequest>
103  {
104  static void encode(Encoder& e, const gpudb::AggregateHistogramRequest& v)
105  {
106  ::avro::encode(e, v.tableName);
107  ::avro::encode(e, v.columnName);
108  ::avro::encode(e, v.start);
109  ::avro::encode(e, v.end);
110  ::avro::encode(e, v.interval);
111  ::avro::encode(e, v.options);
112  }
113 
114  static void decode(Decoder& d, gpudb::AggregateHistogramRequest& v)
115  {
116  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
117  {
118  const std::vector<size_t> fo = rd->fieldOrder();
119 
120  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
121  {
122  switch (*it)
123  {
124  case 0:
125  ::avro::decode(d, v.tableName);
126  break;
127 
128  case 1:
129  ::avro::decode(d, v.columnName);
130  break;
131 
132  case 2:
133  ::avro::decode(d, v.start);
134  break;
135 
136  case 3:
137  ::avro::decode(d, v.end);
138  break;
139 
140  case 4:
141  ::avro::decode(d, v.interval);
142  break;
143 
144  case 5:
145  ::avro::decode(d, v.options);
146  break;
147 
148  default:
149  break;
150  }
151  }
152  }
153  else
154  {
155  ::avro::decode(d, v.tableName);
156  ::avro::decode(d, v.columnName);
157  ::avro::decode(d, v.start);
158  ::avro::decode(d, v.end);
159  ::avro::decode(d, v.interval);
160  ::avro::decode(d, v.options);
161  }
162  }
163  };
164 }
165 
166 namespace gpudb
167 {
168 
192  {
193 
199  counts(std::vector<double>()),
200  start(double()),
201  end(double()),
202  info(std::map<std::string, std::string>())
203  {
204  }
205 
206  std::vector<double> counts;
207  double start;
208  double end;
209  std::map<std::string, std::string> info;
210  };
211 }
212 
213 namespace avro
214 {
215  template<> struct codec_traits<gpudb::AggregateHistogramResponse>
216  {
217  static void encode(Encoder& e, const gpudb::AggregateHistogramResponse& v)
218  {
219  ::avro::encode(e, v.counts);
220  ::avro::encode(e, v.start);
221  ::avro::encode(e, v.end);
222  ::avro::encode(e, v.info);
223  }
224 
225  static void decode(Decoder& d, gpudb::AggregateHistogramResponse& v)
226  {
227  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
228  {
229  const std::vector<size_t> fo = rd->fieldOrder();
230 
231  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
232  {
233  switch (*it)
234  {
235  case 0:
236  ::avro::decode(d, v.counts);
237  break;
238 
239  case 1:
240  ::avro::decode(d, v.start);
241  break;
242 
243  case 2:
244  ::avro::decode(d, v.end);
245  break;
246 
247  case 3:
248  ::avro::decode(d, v.info);
249  break;
250 
251  default:
252  break;
253  }
254  }
255  }
256  else
257  {
258  ::avro::decode(d, v.counts);
259  ::avro::decode(d, v.start);
260  ::avro::decode(d, v.end);
261  ::avro::decode(d, v.info);
262  }
263  }
264  };
265 }
266 
267 #endif
AggregateHistogramRequest()
Constructs an AggregateHistogramRequest object with default parameter values.
std::map< std::string, std::string > options
AggregateHistogramRequest(const std::string &tableName_, const std::string &columnName_, const double start_, const double end_, const double interval_, const std::map< std::string, std::string > &options_)
Constructs an AggregateHistogramRequest object with the specified parameters.
AggregateHistogramResponse()
Constructs an AggregateHistogramResponse object with default parameter values.
A set of output parameters for const.
A set of input parameters for const.
std::map< std::string, std::string > info