GPUdb C++ API  Version 5.2.0.0
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 
27  {
28 
34  tableName(std::string()),
35  columnName(std::string()),
36  start(double()),
37  end(double()),
38  interval(double()),
39  options(std::map<std::string, std::string>())
40  {
41  }
42 
69  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):
70  tableName(tableName),
71  columnName(columnName),
72  start(start),
73  end(end),
74  interval(interval),
75  options(options)
76  {
77  }
78 
79  std::string tableName;
80  std::string columnName;
81  double start;
82  double end;
83  double interval;
84  std::map<std::string, std::string> options;
85  };
86 }
87 
88 namespace avro
89 {
90  template<> struct codec_traits<gpudb::AggregateHistogramRequest>
91  {
92  static void encode(Encoder& e, const gpudb::AggregateHistogramRequest& v)
93  {
94  ::avro::encode(e, v.tableName);
95  ::avro::encode(e, v.columnName);
96  ::avro::encode(e, v.start);
97  ::avro::encode(e, v.end);
98  ::avro::encode(e, v.interval);
99  ::avro::encode(e, v.options);
100  }
101 
102  static void decode(Decoder& d, gpudb::AggregateHistogramRequest& v)
103  {
104  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
105  {
106  const std::vector<size_t> fo = rd->fieldOrder();
107 
108  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
109  {
110  switch (*it)
111  {
112  case 0:
113  ::avro::decode(d, v.tableName);
114  break;
115 
116  case 1:
117  ::avro::decode(d, v.columnName);
118  break;
119 
120  case 2:
121  ::avro::decode(d, v.start);
122  break;
123 
124  case 3:
125  ::avro::decode(d, v.end);
126  break;
127 
128  case 4:
129  ::avro::decode(d, v.interval);
130  break;
131 
132  case 5:
133  ::avro::decode(d, v.options);
134  break;
135 
136  default:
137  break;
138  }
139  }
140  }
141  else
142  {
143  ::avro::decode(d, v.tableName);
144  ::avro::decode(d, v.columnName);
145  ::avro::decode(d, v.start);
146  ::avro::decode(d, v.end);
147  ::avro::decode(d, v.interval);
148  ::avro::decode(d, v.options);
149  }
150  }
151  };
152 }
153 
154 namespace gpudb
155 {
156 
172  {
173 
179  counts(std::vector<double>()),
180  start(double()),
181  end(double())
182  {
183  }
184 
185  std::vector<double> counts;
186  double start;
187  double end;
188  };
189 }
190 
191 namespace avro
192 {
193  template<> struct codec_traits<gpudb::AggregateHistogramResponse>
194  {
195  static void encode(Encoder& e, const gpudb::AggregateHistogramResponse& v)
196  {
197  ::avro::encode(e, v.counts);
198  ::avro::encode(e, v.start);
199  ::avro::encode(e, v.end);
200  }
201 
202  static void decode(Decoder& d, gpudb::AggregateHistogramResponse& v)
203  {
204  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
205  {
206  const std::vector<size_t> fo = rd->fieldOrder();
207 
208  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
209  {
210  switch (*it)
211  {
212  case 0:
213  ::avro::decode(d, v.counts);
214  break;
215 
216  case 1:
217  ::avro::decode(d, v.start);
218  break;
219 
220  case 2:
221  ::avro::decode(d, v.end);
222  break;
223 
224  default:
225  break;
226  }
227  }
228  }
229  else
230  {
231  ::avro::decode(d, v.counts);
232  ::avro::decode(d, v.start);
233  ::avro::decode(d, v.end);
234  }
235  }
236  };
237 }
238 
239 #endif
AggregateHistogramRequest()
Constructs an AggregateHistogramRequest object with default parameter values.
std::map< std::string, std::string > options
AggregateHistogramResponse()
Constructs an AggregateHistogramResponse object with default parameter values.
A set of output parameters for aggregateHistogram(const AggregateHistogramRequest&) const...
A set of input parameters for aggregateHistogram(const AggregateHistogramRequest&) const...
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.