GPUdb C++ API  Version 6.1.0.0
admin_replace_tom.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 __ADMIN_REPLACE_TOM_H__
7 #define __ADMIN_REPLACE_TOM_H__
8 
13 namespace gpudb
14 {
15 
22  struct AdminReplaceTomRequest
23  {
24 
30  AdminReplaceTomRequest() :
31  oldRankTom(int64_t()),
32  newRankTom(int64_t())
33  {
34  }
35 
45  AdminReplaceTomRequest(const int64_t oldRankTom_, const int64_t newRankTom_):
46  oldRankTom( oldRankTom_ ),
47  newRankTom( newRankTom_ )
48  {
49  }
50 
55  int64_t oldRankTom;
56  int64_t newRankTom;
57  };
58 }
59 
64 namespace avro
65 {
66  template<> struct codec_traits<gpudb::AdminReplaceTomRequest>
67  {
68  static void encode(Encoder& e, const gpudb::AdminReplaceTomRequest& v)
69  {
70  ::avro::encode(e, v.oldRankTom);
71  ::avro::encode(e, v.newRankTom);
72  }
73 
74  static void decode(Decoder& d, gpudb::AdminReplaceTomRequest& v)
75  {
76  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
77  {
78  const std::vector<size_t> fo = rd->fieldOrder();
79 
80  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
81  {
82  switch (*it)
83  {
84  case 0:
85  ::avro::decode(d, v.oldRankTom);
86  break;
87 
88  case 1:
89  ::avro::decode(d, v.newRankTom);
90  break;
91 
92  default:
93  break;
94  }
95  }
96  }
97  else
98  {
99  ::avro::decode(d, v.oldRankTom);
100  ::avro::decode(d, v.newRankTom);
101  }
102  }
103  };
104 }
105 
110 namespace gpudb
111 {
112 
119  struct AdminReplaceTomResponse
120  {
121 
127  AdminReplaceTomResponse() :
128  oldRankTom(int64_t()),
129  newRankTom(int64_t())
130  {
131  }
132 
137  int64_t oldRankTom;
138  int64_t newRankTom;
139  };
140 }
141 
146 namespace avro
147 {
148  template<> struct codec_traits<gpudb::AdminReplaceTomResponse>
149  {
150  static void encode(Encoder& e, const gpudb::AdminReplaceTomResponse& v)
151  {
152  ::avro::encode(e, v.oldRankTom);
153  ::avro::encode(e, v.newRankTom);
154  }
155 
156  static void decode(Decoder& d, gpudb::AdminReplaceTomResponse& v)
157  {
158  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
159  {
160  const std::vector<size_t> fo = rd->fieldOrder();
161 
162  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
163  {
164  switch (*it)
165  {
166  case 0:
167  ::avro::decode(d, v.oldRankTom);
168  break;
169 
170  case 1:
171  ::avro::decode(d, v.newRankTom);
172  break;
173 
174  default:
175  break;
176  }
177  }
178  }
179  else
180  {
181  ::avro::decode(d, v.oldRankTom);
182  ::avro::decode(d, v.newRankTom);
183  }
184  }
185  };
186 }
187 
188 #endif