GPUdb C++ API  Version 7.2.2.4
import_model.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 __IMPORT_MODEL_H__
7 #define __IMPORT_MODEL_H__
8 
9 namespace gpudb
10 {
12  struct ImportModelRequest
13  {
14  ImportModelRequest() :
15  modelName(std::string()),
16  registryName(std::string()),
17  container(std::string()),
18  runFunction(std::string()),
19  modelType(std::string()),
20  options(std::map<std::string, std::string>())
21  {
22  }
23 
24  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_):
25  modelName( modelName_ ),
26  registryName( registryName_ ),
27  container( container_ ),
28  runFunction( runFunction_ ),
29  modelType( modelType_ ),
30  options( options_ )
31  {
32  }
33 
34  std::string modelName;
35  std::string registryName;
36  std::string container;
37  std::string runFunction;
38  std::string modelType;
39  std::map<std::string, std::string> options;
40  };
41 } // end namespace gpudb
42 
43 namespace avro
44 {
45  template<> struct codec_traits<gpudb::ImportModelRequest>
46  {
47  static void encode(Encoder& e, const gpudb::ImportModelRequest& v)
48  {
49  ::avro::encode(e, v.modelName);
50  ::avro::encode(e, v.registryName);
51  ::avro::encode(e, v.container);
52  ::avro::encode(e, v.runFunction);
53  ::avro::encode(e, v.modelType);
54  ::avro::encode(e, v.options);
55  }
56 
57  static void decode(Decoder& d, gpudb::ImportModelRequest& 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.modelName);
69  break;
70 
71  case 1:
72  ::avro::decode(d, v.registryName);
73  break;
74 
75  case 2:
76  ::avro::decode(d, v.container);
77  break;
78 
79  case 3:
80  ::avro::decode(d, v.runFunction);
81  break;
82 
83  case 4:
84  ::avro::decode(d, v.modelType);
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.modelName);
99  ::avro::decode(d, v.registryName);
100  ::avro::decode(d, v.container);
101  ::avro::decode(d, v.runFunction);
102  ::avro::decode(d, v.modelType);
103  ::avro::decode(d, v.options);
104  }
105  }
106  };
107 } // end namespace avro
108 
109 namespace gpudb
110 {
112  struct ImportModelResponse
113  {
114  ImportModelResponse() :
115  modelName(std::string()),
116  entityId(int32_t()),
117  info(std::map<std::string, std::string>())
118  {
119  }
120 
121  std::string modelName;
122  int32_t entityId;
123  std::map<std::string, std::string> info;
124  };
125 } // end namespace gpudb
126 
127 namespace avro
128 {
129  template<> struct codec_traits<gpudb::ImportModelResponse>
130  {
131  static void encode(Encoder& e, const gpudb::ImportModelResponse& v)
132  {
133  ::avro::encode(e, v.modelName);
134  ::avro::encode(e, v.entityId);
135  ::avro::encode(e, v.info);
136  }
137 
138  static void decode(Decoder& d, gpudb::ImportModelResponse& v)
139  {
140  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
141  {
142  const std::vector<size_t> fo = rd->fieldOrder();
143 
144  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
145  {
146  switch (*it)
147  {
148  case 0:
149  ::avro::decode(d, v.modelName);
150  break;
151 
152  case 1:
153  ::avro::decode(d, v.entityId);
154  break;
155 
156  case 2:
157  ::avro::decode(d, v.info);
158  break;
159 
160  default:
161  break;
162  }
163  }
164  }
165  else
166  {
167  ::avro::decode(d, v.modelName);
168  ::avro::decode(d, v.entityId);
169  ::avro::decode(d, v.info);
170  }
171  }
172  };
173 } // end namespace avro
174 
175 #endif // __IMPORT_MODEL_H__