source: XIOS/dev/branch_openmp/src/interface/c_attr/icscalar_attr.cpp @ 1545

Last change on this file since 1545 was 1545, checked in by yushan, 6 years ago

branch_openmp merged with trunk r1544

File size: 11.8 KB
Line 
1/* ************************************************************************** *
2 *               Interface auto generated - do not modify                     *
3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6#include <memory>
7#include "xios.hpp"
8#include "attribute_template.hpp"
9#include "object_template.hpp"
10#include "group_template.hpp"
11#include "icutil.hpp"
12#include "icdate.hpp"
13#include "timer.hpp"
14#include "node_type.hpp"
15
16extern "C"
17{
18  typedef xios::CScalar* scalar_Ptr;
19
20  void cxios_set_scalar_axis_type(scalar_Ptr scalar_hdl, const char * axis_type, int axis_type_size)
21  {
22    std::string axis_type_str;
23    if (!cstr2string(axis_type, axis_type_size, axis_type_str)) return;
24    CTimer::get("XIOS").resume();
25    scalar_hdl->axis_type.fromString(axis_type_str);
26    CTimer::get("XIOS").suspend();
27  }
28
29  void cxios_get_scalar_axis_type(scalar_Ptr scalar_hdl, char * axis_type, int axis_type_size)
30  {
31    CTimer::get("XIOS").resume();
32    if (!string_copy(scalar_hdl->axis_type.getInheritedStringValue(), axis_type, axis_type_size))
33      ERROR("void cxios_get_scalar_axis_type(scalar_Ptr scalar_hdl, char * axis_type, int axis_type_size)", << "Input string is too short");
34    CTimer::get("XIOS").suspend();
35  }
36
37  bool cxios_is_defined_scalar_axis_type(scalar_Ptr scalar_hdl)
38  {
39     CTimer::get("XIOS").resume();
40     bool isDefined = scalar_hdl->axis_type.hasInheritedValue();
41     CTimer::get("XIOS").suspend();
42     return isDefined;
43  }
44
45
46  void cxios_set_scalar_bounds(scalar_Ptr scalar_hdl, double* bounds, int* extent)
47  {
48    CTimer::get("XIOS").resume();
49    CArray<double,1> tmp(bounds, shape(extent[0]), neverDeleteData);
50    scalar_hdl->bounds.reference(tmp.copy());
51     CTimer::get("XIOS").suspend();
52  }
53
54  void cxios_get_scalar_bounds(scalar_Ptr scalar_hdl, double* bounds, int* extent)
55  {
56    CTimer::get("XIOS").resume();
57    CArray<double,1> tmp(bounds, shape(extent[0]), neverDeleteData);
58    tmp=scalar_hdl->bounds.getInheritedValue();
59     CTimer::get("XIOS").suspend();
60  }
61
62  bool cxios_is_defined_scalar_bounds(scalar_Ptr scalar_hdl)
63  {
64     CTimer::get("XIOS").resume();
65     bool isDefined = scalar_hdl->bounds.hasInheritedValue();
66     CTimer::get("XIOS").suspend();
67     return isDefined;
68  }
69
70
71  void cxios_set_scalar_bounds_name(scalar_Ptr scalar_hdl, const char * bounds_name, int bounds_name_size)
72  {
73    std::string bounds_name_str;
74    if (!cstr2string(bounds_name, bounds_name_size, bounds_name_str)) return;
75    CTimer::get("XIOS").resume();
76    scalar_hdl->bounds_name.setValue(bounds_name_str);
77    CTimer::get("XIOS").suspend();
78  }
79
80  void cxios_get_scalar_bounds_name(scalar_Ptr scalar_hdl, char * bounds_name, int bounds_name_size)
81  {
82    CTimer::get("XIOS").resume();
83    if (!string_copy(scalar_hdl->bounds_name.getInheritedValue(), bounds_name, bounds_name_size))
84      ERROR("void cxios_get_scalar_bounds_name(scalar_Ptr scalar_hdl, char * bounds_name, int bounds_name_size)", << "Input string is too short");
85    CTimer::get("XIOS").suspend();
86  }
87
88  bool cxios_is_defined_scalar_bounds_name(scalar_Ptr scalar_hdl)
89  {
90     CTimer::get("XIOS").resume();
91     bool isDefined = scalar_hdl->bounds_name.hasInheritedValue();
92     CTimer::get("XIOS").suspend();
93     return isDefined;
94  }
95
96
97  void cxios_set_scalar_comment(scalar_Ptr scalar_hdl, const char * comment, int comment_size)
98  {
99    std::string comment_str;
100    if (!cstr2string(comment, comment_size, comment_str)) return;
101    CTimer::get("XIOS").resume();
102    scalar_hdl->comment.setValue(comment_str);
103    CTimer::get("XIOS").suspend();
104  }
105
106  void cxios_get_scalar_comment(scalar_Ptr scalar_hdl, char * comment, int comment_size)
107  {
108    CTimer::get("XIOS").resume();
109    if (!string_copy(scalar_hdl->comment.getInheritedValue(), comment, comment_size))
110      ERROR("void cxios_get_scalar_comment(scalar_Ptr scalar_hdl, char * comment, int comment_size)", << "Input string is too short");
111    CTimer::get("XIOS").suspend();
112  }
113
114  bool cxios_is_defined_scalar_comment(scalar_Ptr scalar_hdl)
115  {
116     CTimer::get("XIOS").resume();
117     bool isDefined = scalar_hdl->comment.hasInheritedValue();
118     CTimer::get("XIOS").suspend();
119     return isDefined;
120  }
121
122
123  void cxios_set_scalar_label(scalar_Ptr scalar_hdl, const char * label, int label_size)
124  {
125    std::string label_str;
126    if (!cstr2string(label, label_size, label_str)) return;
127    CTimer::get("XIOS").resume();
128    scalar_hdl->label.setValue(label_str);
129    CTimer::get("XIOS").suspend();
130  }
131
132  void cxios_get_scalar_label(scalar_Ptr scalar_hdl, char * label, int label_size)
133  {
134    CTimer::get("XIOS").resume();
135    if (!string_copy(scalar_hdl->label.getInheritedValue(), label, label_size))
136      ERROR("void cxios_get_scalar_label(scalar_Ptr scalar_hdl, char * label, int label_size)", << "Input string is too short");
137    CTimer::get("XIOS").suspend();
138  }
139
140  bool cxios_is_defined_scalar_label(scalar_Ptr scalar_hdl)
141  {
142     CTimer::get("XIOS").resume();
143     bool isDefined = scalar_hdl->label.hasInheritedValue();
144     CTimer::get("XIOS").suspend();
145     return isDefined;
146  }
147
148
149  void cxios_set_scalar_long_name(scalar_Ptr scalar_hdl, const char * long_name, int long_name_size)
150  {
151    std::string long_name_str;
152    if (!cstr2string(long_name, long_name_size, long_name_str)) return;
153    CTimer::get("XIOS").resume();
154    scalar_hdl->long_name.setValue(long_name_str);
155    CTimer::get("XIOS").suspend();
156  }
157
158  void cxios_get_scalar_long_name(scalar_Ptr scalar_hdl, char * long_name, int long_name_size)
159  {
160    CTimer::get("XIOS").resume();
161    if (!string_copy(scalar_hdl->long_name.getInheritedValue(), long_name, long_name_size))
162      ERROR("void cxios_get_scalar_long_name(scalar_Ptr scalar_hdl, char * long_name, int long_name_size)", << "Input string is too short");
163    CTimer::get("XIOS").suspend();
164  }
165
166  bool cxios_is_defined_scalar_long_name(scalar_Ptr scalar_hdl)
167  {
168     CTimer::get("XIOS").resume();
169     bool isDefined = scalar_hdl->long_name.hasInheritedValue();
170     CTimer::get("XIOS").suspend();
171     return isDefined;
172  }
173
174
175  void cxios_set_scalar_name(scalar_Ptr scalar_hdl, const char * name, int name_size)
176  {
177    std::string name_str;
178    if (!cstr2string(name, name_size, name_str)) return;
179    CTimer::get("XIOS").resume();
180    scalar_hdl->name.setValue(name_str);
181    CTimer::get("XIOS").suspend();
182  }
183
184  void cxios_get_scalar_name(scalar_Ptr scalar_hdl, char * name, int name_size)
185  {
186    CTimer::get("XIOS").resume();
187    if (!string_copy(scalar_hdl->name.getInheritedValue(), name, name_size))
188      ERROR("void cxios_get_scalar_name(scalar_Ptr scalar_hdl, char * name, int name_size)", << "Input string is too short");
189    CTimer::get("XIOS").suspend();
190  }
191
192  bool cxios_is_defined_scalar_name(scalar_Ptr scalar_hdl)
193  {
194     CTimer::get("XIOS").resume();
195     bool isDefined = scalar_hdl->name.hasInheritedValue();
196     CTimer::get("XIOS").suspend();
197     return isDefined;
198  }
199
200
201  void cxios_set_scalar_positive(scalar_Ptr scalar_hdl, const char * positive, int positive_size)
202  {
203    std::string positive_str;
204    if (!cstr2string(positive, positive_size, positive_str)) return;
205    CTimer::get("XIOS").resume();
206    scalar_hdl->positive.fromString(positive_str);
207    CTimer::get("XIOS").suspend();
208  }
209
210  void cxios_get_scalar_positive(scalar_Ptr scalar_hdl, char * positive, int positive_size)
211  {
212    CTimer::get("XIOS").resume();
213    if (!string_copy(scalar_hdl->positive.getInheritedStringValue(), positive, positive_size))
214      ERROR("void cxios_get_scalar_positive(scalar_Ptr scalar_hdl, char * positive, int positive_size)", << "Input string is too short");
215    CTimer::get("XIOS").suspend();
216  }
217
218  bool cxios_is_defined_scalar_positive(scalar_Ptr scalar_hdl)
219  {
220     CTimer::get("XIOS").resume();
221     bool isDefined = scalar_hdl->positive.hasInheritedValue();
222     CTimer::get("XIOS").suspend();
223     return isDefined;
224  }
225
226
227  void cxios_set_scalar_prec(scalar_Ptr scalar_hdl, int prec)
228  {
229    CTimer::get("XIOS").resume();
230    scalar_hdl->prec.setValue(prec);
231    CTimer::get("XIOS").suspend();
232  }
233
234  void cxios_get_scalar_prec(scalar_Ptr scalar_hdl, int* prec)
235  {
236    CTimer::get("XIOS").resume();
237    *prec = scalar_hdl->prec.getInheritedValue();
238    CTimer::get("XIOS").suspend();
239  }
240
241  bool cxios_is_defined_scalar_prec(scalar_Ptr scalar_hdl)
242  {
243     CTimer::get("XIOS").resume();
244     bool isDefined = scalar_hdl->prec.hasInheritedValue();
245     CTimer::get("XIOS").suspend();
246     return isDefined;
247  }
248
249
250  void cxios_set_scalar_scalar_ref(scalar_Ptr scalar_hdl, const char * scalar_ref, int scalar_ref_size)
251  {
252    std::string scalar_ref_str;
253    if (!cstr2string(scalar_ref, scalar_ref_size, scalar_ref_str)) return;
254    CTimer::get("XIOS").resume();
255    scalar_hdl->scalar_ref.setValue(scalar_ref_str);
256    CTimer::get("XIOS").suspend();
257  }
258
259  void cxios_get_scalar_scalar_ref(scalar_Ptr scalar_hdl, char * scalar_ref, int scalar_ref_size)
260  {
261    CTimer::get("XIOS").resume();
262    if (!string_copy(scalar_hdl->scalar_ref.getInheritedValue(), scalar_ref, scalar_ref_size))
263      ERROR("void cxios_get_scalar_scalar_ref(scalar_Ptr scalar_hdl, char * scalar_ref, int scalar_ref_size)", << "Input string is too short");
264    CTimer::get("XIOS").suspend();
265  }
266
267  bool cxios_is_defined_scalar_scalar_ref(scalar_Ptr scalar_hdl)
268  {
269     CTimer::get("XIOS").resume();
270     bool isDefined = scalar_hdl->scalar_ref.hasInheritedValue();
271     CTimer::get("XIOS").suspend();
272     return isDefined;
273  }
274
275
276  void cxios_set_scalar_standard_name(scalar_Ptr scalar_hdl, const char * standard_name, int standard_name_size)
277  {
278    std::string standard_name_str;
279    if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
280    CTimer::get("XIOS").resume();
281    scalar_hdl->standard_name.setValue(standard_name_str);
282    CTimer::get("XIOS").suspend();
283  }
284
285  void cxios_get_scalar_standard_name(scalar_Ptr scalar_hdl, char * standard_name, int standard_name_size)
286  {
287    CTimer::get("XIOS").resume();
288    if (!string_copy(scalar_hdl->standard_name.getInheritedValue(), standard_name, standard_name_size))
289      ERROR("void cxios_get_scalar_standard_name(scalar_Ptr scalar_hdl, char * standard_name, int standard_name_size)", << "Input string is too short");
290    CTimer::get("XIOS").suspend();
291  }
292
293  bool cxios_is_defined_scalar_standard_name(scalar_Ptr scalar_hdl)
294  {
295     CTimer::get("XIOS").resume();
296     bool isDefined = scalar_hdl->standard_name.hasInheritedValue();
297     CTimer::get("XIOS").suspend();
298     return isDefined;
299  }
300
301
302  void cxios_set_scalar_unit(scalar_Ptr scalar_hdl, const char * unit, int unit_size)
303  {
304    std::string unit_str;
305    if (!cstr2string(unit, unit_size, unit_str)) return;
306    CTimer::get("XIOS").resume();
307    scalar_hdl->unit.setValue(unit_str);
308    CTimer::get("XIOS").suspend();
309  }
310
311  void cxios_get_scalar_unit(scalar_Ptr scalar_hdl, char * unit, int unit_size)
312  {
313    CTimer::get("XIOS").resume();
314    if (!string_copy(scalar_hdl->unit.getInheritedValue(), unit, unit_size))
315      ERROR("void cxios_get_scalar_unit(scalar_Ptr scalar_hdl, char * unit, int unit_size)", << "Input string is too short");
316    CTimer::get("XIOS").suspend();
317  }
318
319  bool cxios_is_defined_scalar_unit(scalar_Ptr scalar_hdl)
320  {
321     CTimer::get("XIOS").resume();
322     bool isDefined = scalar_hdl->unit.hasInheritedValue();
323     CTimer::get("XIOS").suspend();
324     return isDefined;
325  }
326
327
328  void cxios_set_scalar_value(scalar_Ptr scalar_hdl, double value)
329  {
330    CTimer::get("XIOS").resume();
331    scalar_hdl->value.setValue(value);
332    CTimer::get("XIOS").suspend();
333  }
334
335  void cxios_get_scalar_value(scalar_Ptr scalar_hdl, double* value)
336  {
337    CTimer::get("XIOS").resume();
338    *value = scalar_hdl->value.getInheritedValue();
339    CTimer::get("XIOS").suspend();
340  }
341
342  bool cxios_is_defined_scalar_value(scalar_Ptr scalar_hdl)
343  {
344     CTimer::get("XIOS").resume();
345     bool isDefined = scalar_hdl->value.hasInheritedValue();
346     CTimer::get("XIOS").suspend();
347     return isDefined;
348  }
349}
Note: See TracBrowser for help on using the repository browser.