GPUdb C++ API  Version 7.2.2.4
reserve_resource.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the Kinetica schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __RESERVE_RESOURCE_H__
7 #define __RESERVE_RESOURCE_H__
8 
9 namespace gpudb
10 {
12  struct ReserveResourceRequest
13  {
14  ReserveResourceRequest() :
15  component(std::string()),
16  name(std::string()),
17  action(std::string()),
18  bytesRequested(int64_t()),
19  ownerId(int64_t()),
20  options(std::map<std::string, std::string>())
21  {
22  }
23 
24  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_):
25  component( component_ ),
26  name( name_ ),
27  action( action_ ),
28  bytesRequested( bytesRequested_ ),
29  ownerId( ownerId_ ),
30  options( options_ )
31  {
32  }
33 
34  std::string component;
35  std::string name;
36  std::string action;
37  int64_t bytesRequested;
38  int64_t ownerId;
39  std::map<std::string, std::string> options;
40  };
41 } // end namespace gpudb
42 
43 namespace avro
44 {
45  template<> struct codec_traits<gpudb::ReserveResourceRequest>
46  {
47  static void encode(Encoder& e, const gpudb::ReserveResourceRequest& v)
48  {
49  ::avro::encode(e, v.component);
50  ::avro::encode(e, v.name);
51  ::avro::encode(e, v.action);
52  ::avro::encode(e, v.bytesRequested);
53  ::avro::encode(e, v.ownerId);
54  ::avro::encode(e, v.options);
55  }
56 
57  static void decode(Decoder& d, gpudb::ReserveResourceRequest& v)
58  {
59  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
60  {
61  const std::vector<size_t> fo = rd->fieldOrder();
62 
63  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
64  {
65  switch (*it)
66  {
67  case 0:
68  ::avro::decode(d, v.component);
69  break;
70 
71  case 1:
72  ::avro::decode(d, v.name);
73  break;
74 
75  case 2:
76  ::avro::decode(d, v.action);
77  break;
78 
79  case 3:
80  ::avro::decode(d, v.bytesRequested);
81  break;
82 
83  case 4:
84  ::avro::decode(d, v.ownerId);
85  break;
86 
87  case 5:
88  ::avro::decode(d, v.options);
89  break;
90 
91  default:
92  break;
93  }
94  }
95  }
96  else
97  {
98  ::avro::decode(d, v.component);
99  ::avro::decode(d, v.name);
100  ::avro::decode(d, v.action);
101  ::avro::decode(d, v.bytesRequested);
102  ::avro::decode(d, v.ownerId);
103  ::avro::decode(d, v.options);
104  }
105  }
106  };
107 } // end namespace avro
108 
109 namespace gpudb
110 {
112  struct ReserveResourceResponse
113  {
114  ReserveResourceResponse() :
115  component(std::string()),
116  name(std::string()),
117  reservation(int64_t()),
118  info(std::map<std::string, std::string>())
119  {
120  }
121 
122  std::string component;
123  std::string name;
124  int64_t reservation;
125  std::map<std::string, std::string> info;
126  };
127 } // end namespace gpudb
128 
129 namespace avro
130 {
131  template<> struct codec_traits<gpudb::ReserveResourceResponse>
132  {
133  static void encode(Encoder& e, const gpudb::ReserveResourceResponse& v)
134  {
135  ::avro::encode(e, v.component);
136  ::avro::encode(e, v.name);
137  ::avro::encode(e, v.reservation);
138  ::avro::encode(e, v.info);
139  }
140 
141  static void decode(Decoder& d, gpudb::ReserveResourceResponse& v)
142  {
143  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
144  {
145  const std::vector<size_t> fo = rd->fieldOrder();
146 
147  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
148  {
149  switch (*it)
150  {
151  case 0:
152  ::avro::decode(d, v.component);
153  break;
154 
155  case 1:
156  ::avro::decode(d, v.name);
157  break;
158 
159  case 2:
160  ::avro::decode(d, v.reservation);
161  break;
162 
163  case 3:
164  ::avro::decode(d, v.info);
165  break;
166 
167  default:
168  break;
169  }
170  }
171  }
172  else
173  {
174  ::avro::decode(d, v.component);
175  ::avro::decode(d, v.name);
176  ::avro::decode(d, v.reservation);
177  ::avro::decode(d, v.info);
178  }
179  }
180  };
181 } // end namespace avro
182 
183 #endif // __RESERVE_RESOURCE_H__