GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
reserve_resource.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 __RESERVE_RESOURCE_H__
7 #define __RESERVE_RESOURCE_H__
8 
9 namespace gpudb
10 {
11 
18  struct ReserveResourceRequest
19  {
20 
26  ReserveResourceRequest() :
27  component(std::string()),
28  name(std::string()),
29  action(std::string()),
30  bytesRequested(int64_t()),
31  ownerId(int64_t()),
32  options(std::map<std::string, std::string>())
33  {
34  }
35 
61  ReserveResourceRequest(const std::string& component_, const std::string& name_, const std::string& action_, const int64_t bytesRequested_, const int64_t ownerId_, const std::map<std::string, std::string>& options_):
62  component( component_ ),
63  name( name_ ),
64  action( action_ ),
65  bytesRequested( bytesRequested_ ),
66  ownerId( ownerId_ ),
67  options( options_ )
68  {
69  }
70 
71  std::string component;
72  std::string name;
73  std::string action;
74  int64_t bytesRequested;
75  int64_t ownerId;
76  std::map<std::string, std::string> options;
77  };
78 }
79 
84 namespace avro
85 {
86  template<> struct codec_traits<gpudb::ReserveResourceRequest>
87  {
88  static void encode(Encoder& e, const gpudb::ReserveResourceRequest& v)
89  {
90  ::avro::encode(e, v.component);
91  ::avro::encode(e, v.name);
92  ::avro::encode(e, v.action);
93  ::avro::encode(e, v.bytesRequested);
94  ::avro::encode(e, v.ownerId);
95  ::avro::encode(e, v.options);
96  }
97 
98  static void decode(Decoder& d, gpudb::ReserveResourceRequest& v)
99  {
100  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
101  {
102  const std::vector<size_t> fo = rd->fieldOrder();
103 
104  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
105  {
106  switch (*it)
107  {
108  case 0:
109  ::avro::decode(d, v.component);
110  break;
111 
112  case 1:
113  ::avro::decode(d, v.name);
114  break;
115 
116  case 2:
117  ::avro::decode(d, v.action);
118  break;
119 
120  case 3:
121  ::avro::decode(d, v.bytesRequested);
122  break;
123 
124  case 4:
125  ::avro::decode(d, v.ownerId);
126  break;
127 
128  case 5:
129  ::avro::decode(d, v.options);
130  break;
131 
132  default:
133  break;
134  }
135  }
136  }
137  else
138  {
139  ::avro::decode(d, v.component);
140  ::avro::decode(d, v.name);
141  ::avro::decode(d, v.action);
142  ::avro::decode(d, v.bytesRequested);
143  ::avro::decode(d, v.ownerId);
144  ::avro::decode(d, v.options);
145  }
146  }
147  };
148 }
149 
150 namespace gpudb
151 {
152 
159  struct ReserveResourceResponse
160  {
161 
167  ReserveResourceResponse() :
168  component(std::string()),
169  name(std::string()),
170  reservation(int64_t()),
171  info(std::map<std::string, std::string>())
172  {
173  }
174 
175  std::string component;
176  std::string name;
177  int64_t reservation;
178  std::map<std::string, std::string> info;
179  };
180 }
181 
186 namespace avro
187 {
188  template<> struct codec_traits<gpudb::ReserveResourceResponse>
189  {
190  static void encode(Encoder& e, const gpudb::ReserveResourceResponse& v)
191  {
192  ::avro::encode(e, v.component);
193  ::avro::encode(e, v.name);
194  ::avro::encode(e, v.reservation);
195  ::avro::encode(e, v.info);
196  }
197 
198  static void decode(Decoder& d, gpudb::ReserveResourceResponse& v)
199  {
200  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
201  {
202  const std::vector<size_t> fo = rd->fieldOrder();
203 
204  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
205  {
206  switch (*it)
207  {
208  case 0:
209  ::avro::decode(d, v.component);
210  break;
211 
212  case 1:
213  ::avro::decode(d, v.name);
214  break;
215 
216  case 2:
217  ::avro::decode(d, v.reservation);
218  break;
219 
220  case 3:
221  ::avro::decode(d, v.info);
222  break;
223 
224  default:
225  break;
226  }
227  }
228  }
229  else
230  {
231  ::avro::decode(d, v.component);
232  ::avro::decode(d, v.name);
233  ::avro::decode(d, v.reservation);
234  ::avro::decode(d, v.info);
235  }
236  }
237  };
238 }
239 
240 #endif