GPUdb C++ API  Version 7.1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
import_model.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 __IMPORT_MODEL_H__
7 #define __IMPORT_MODEL_H__
8 
9 namespace gpudb
10 {
11 
18  struct ImportModelRequest
19  {
20 
26  ImportModelRequest() :
27  modelName(std::string()),
28  registryName(std::string()),
29  container(std::string()),
30  runFunction(std::string()),
31  modelType(std::string()),
32  options(std::map<std::string, std::string>())
33  {
34  }
35 
53  ImportModelRequest(const std::string& modelName_, const std::string& registryName_, const std::string& container_, const std::string& runFunction_, const std::string& modelType_, const std::map<std::string, std::string>& options_):
54  modelName( modelName_ ),
55  registryName( registryName_ ),
56  container( container_ ),
57  runFunction( runFunction_ ),
58  modelType( modelType_ ),
59  options( options_ )
60  {
61  }
62 
63  std::string modelName;
64  std::string registryName;
65  std::string container;
66  std::string runFunction;
67  std::string modelType;
68  std::map<std::string, std::string> options;
69  };
70 }
71 
76 namespace avro
77 {
78  template<> struct codec_traits<gpudb::ImportModelRequest>
79  {
80  static void encode(Encoder& e, const gpudb::ImportModelRequest& v)
81  {
82  ::avro::encode(e, v.modelName);
83  ::avro::encode(e, v.registryName);
84  ::avro::encode(e, v.container);
85  ::avro::encode(e, v.runFunction);
86  ::avro::encode(e, v.modelType);
87  ::avro::encode(e, v.options);
88  }
89 
90  static void decode(Decoder& d, gpudb::ImportModelRequest& v)
91  {
92  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
93  {
94  const std::vector<size_t> fo = rd->fieldOrder();
95 
96  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
97  {
98  switch (*it)
99  {
100  case 0:
101  ::avro::decode(d, v.modelName);
102  break;
103 
104  case 1:
105  ::avro::decode(d, v.registryName);
106  break;
107 
108  case 2:
109  ::avro::decode(d, v.container);
110  break;
111 
112  case 3:
113  ::avro::decode(d, v.runFunction);
114  break;
115 
116  case 4:
117  ::avro::decode(d, v.modelType);
118  break;
119 
120  case 5:
121  ::avro::decode(d, v.options);
122  break;
123 
124  default:
125  break;
126  }
127  }
128  }
129  else
130  {
131  ::avro::decode(d, v.modelName);
132  ::avro::decode(d, v.registryName);
133  ::avro::decode(d, v.container);
134  ::avro::decode(d, v.runFunction);
135  ::avro::decode(d, v.modelType);
136  ::avro::decode(d, v.options);
137  }
138  }
139  };
140 }
141 
142 namespace gpudb
143 {
144 
151  struct ImportModelResponse
152  {
153 
159  ImportModelResponse() :
160  modelName(std::string()),
161  entityId(int32_t()),
162  info(std::map<std::string, std::string>())
163  {
164  }
165 
166  std::string modelName;
167  int32_t entityId;
168  std::map<std::string, std::string> info;
169  };
170 }
171 
176 namespace avro
177 {
178  template<> struct codec_traits<gpudb::ImportModelResponse>
179  {
180  static void encode(Encoder& e, const gpudb::ImportModelResponse& v)
181  {
182  ::avro::encode(e, v.modelName);
183  ::avro::encode(e, v.entityId);
184  ::avro::encode(e, v.info);
185  }
186 
187  static void decode(Decoder& d, gpudb::ImportModelResponse& v)
188  {
189  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
190  {
191  const std::vector<size_t> fo = rd->fieldOrder();
192 
193  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
194  {
195  switch (*it)
196  {
197  case 0:
198  ::avro::decode(d, v.modelName);
199  break;
200 
201  case 1:
202  ::avro::decode(d, v.entityId);
203  break;
204 
205  case 2:
206  ::avro::decode(d, v.info);
207  break;
208 
209  default:
210  break;
211  }
212  }
213  }
214  else
215  {
216  ::avro::decode(d, v.modelName);
217  ::avro::decode(d, v.entityId);
218  ::avro::decode(d, v.info);
219  }
220  }
221  };
222 }
223 
224 #endif