source: XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp @ 1542

Last change on this file since 1542 was 1542, checked in by oabramkina, 6 years ago

Replacing Boost's unordered_map and shared_pointer by its STL counterparts.

Two notes for Curie:

  • one can see the content of unordered_map with ddt only if XIOS has been compiled with gnu
  • XIOS will not compile any more with pgi (all available versions use old STL which are not up to the c++11 norms)
  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
  • Property svn:eol-style set to native
File size: 22.4 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::CAxis* axis_Ptr;
19
20  void cxios_set_axis_axis_ref(axis_Ptr axis_hdl, const char * axis_ref, int axis_ref_size)
21  {
22    std::string axis_ref_str;
23    if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return;
24    CTimer::get("XIOS").resume();
25    axis_hdl->axis_ref.setValue(axis_ref_str);
26    CTimer::get("XIOS").suspend();
27  }
28
29  void cxios_get_axis_axis_ref(axis_Ptr axis_hdl, char * axis_ref, int axis_ref_size)
30  {
31    CTimer::get("XIOS").resume();
32    if (!string_copy(axis_hdl->axis_ref.getInheritedValue(), axis_ref, axis_ref_size))
33      ERROR("void cxios_get_axis_axis_ref(axis_Ptr axis_hdl, char * axis_ref, int axis_ref_size)", << "Input string is too short");
34    CTimer::get("XIOS").suspend();
35  }
36
37  bool cxios_is_defined_axis_axis_ref(axis_Ptr axis_hdl)
38  {
39     CTimer::get("XIOS").resume();
40     bool isDefined = axis_hdl->axis_ref.hasInheritedValue();
41     CTimer::get("XIOS").suspend();
42     return isDefined;
43  }
44
45
46  void cxios_set_axis_axis_type(axis_Ptr axis_hdl, const char * axis_type, int axis_type_size)
47  {
48    std::string axis_type_str;
49    if (!cstr2string(axis_type, axis_type_size, axis_type_str)) return;
50    CTimer::get("XIOS").resume();
51    axis_hdl->axis_type.fromString(axis_type_str);
52    CTimer::get("XIOS").suspend();
53  }
54
55  void cxios_get_axis_axis_type(axis_Ptr axis_hdl, char * axis_type, int axis_type_size)
56  {
57    CTimer::get("XIOS").resume();
58    if (!string_copy(axis_hdl->axis_type.getInheritedStringValue(), axis_type, axis_type_size))
59      ERROR("void cxios_get_axis_axis_type(axis_Ptr axis_hdl, char * axis_type, int axis_type_size)", << "Input string is too short");
60    CTimer::get("XIOS").suspend();
61  }
62
63  bool cxios_is_defined_axis_axis_type(axis_Ptr axis_hdl)
64  {
65     CTimer::get("XIOS").resume();
66     bool isDefined = axis_hdl->axis_type.hasInheritedValue();
67     CTimer::get("XIOS").suspend();
68     return isDefined;
69  }
70
71
72  void cxios_set_axis_begin(axis_Ptr axis_hdl, int begin)
73  {
74    CTimer::get("XIOS").resume();
75    axis_hdl->begin.setValue(begin);
76    CTimer::get("XIOS").suspend();
77  }
78
79  void cxios_get_axis_begin(axis_Ptr axis_hdl, int* begin)
80  {
81    CTimer::get("XIOS").resume();
82    *begin = axis_hdl->begin.getInheritedValue();
83    CTimer::get("XIOS").suspend();
84  }
85
86  bool cxios_is_defined_axis_begin(axis_Ptr axis_hdl)
87  {
88     CTimer::get("XIOS").resume();
89     bool isDefined = axis_hdl->begin.hasInheritedValue();
90     CTimer::get("XIOS").suspend();
91     return isDefined;
92  }
93
94
95  void cxios_set_axis_bounds(axis_Ptr axis_hdl, double* bounds, int* extent)
96  {
97    CTimer::get("XIOS").resume();
98    CArray<double,2> tmp(bounds, shape(extent[0], extent[1]), neverDeleteData);
99    axis_hdl->bounds.reference(tmp.copy());
100     CTimer::get("XIOS").suspend();
101  }
102
103  void cxios_get_axis_bounds(axis_Ptr axis_hdl, double* bounds, int* extent)
104  {
105    CTimer::get("XIOS").resume();
106    CArray<double,2> tmp(bounds, shape(extent[0], extent[1]), neverDeleteData);
107    tmp=axis_hdl->bounds.getInheritedValue();
108     CTimer::get("XIOS").suspend();
109  }
110
111  bool cxios_is_defined_axis_bounds(axis_Ptr axis_hdl)
112  {
113     CTimer::get("XIOS").resume();
114     bool isDefined = axis_hdl->bounds.hasInheritedValue();
115     CTimer::get("XIOS").suspend();
116     return isDefined;
117  }
118
119
120  void cxios_set_axis_bounds_name(axis_Ptr axis_hdl, const char * bounds_name, int bounds_name_size)
121  {
122    std::string bounds_name_str;
123    if (!cstr2string(bounds_name, bounds_name_size, bounds_name_str)) return;
124    CTimer::get("XIOS").resume();
125    axis_hdl->bounds_name.setValue(bounds_name_str);
126    CTimer::get("XIOS").suspend();
127  }
128
129  void cxios_get_axis_bounds_name(axis_Ptr axis_hdl, char * bounds_name, int bounds_name_size)
130  {
131    CTimer::get("XIOS").resume();
132    if (!string_copy(axis_hdl->bounds_name.getInheritedValue(), bounds_name, bounds_name_size))
133      ERROR("void cxios_get_axis_bounds_name(axis_Ptr axis_hdl, char * bounds_name, int bounds_name_size)", << "Input string is too short");
134    CTimer::get("XIOS").suspend();
135  }
136
137  bool cxios_is_defined_axis_bounds_name(axis_Ptr axis_hdl)
138  {
139     CTimer::get("XIOS").resume();
140     bool isDefined = axis_hdl->bounds_name.hasInheritedValue();
141     CTimer::get("XIOS").suspend();
142     return isDefined;
143  }
144
145
146  void cxios_set_axis_comment(axis_Ptr axis_hdl, const char * comment, int comment_size)
147  {
148    std::string comment_str;
149    if (!cstr2string(comment, comment_size, comment_str)) return;
150    CTimer::get("XIOS").resume();
151    axis_hdl->comment.setValue(comment_str);
152    CTimer::get("XIOS").suspend();
153  }
154
155  void cxios_get_axis_comment(axis_Ptr axis_hdl, char * comment, int comment_size)
156  {
157    CTimer::get("XIOS").resume();
158    if (!string_copy(axis_hdl->comment.getInheritedValue(), comment, comment_size))
159      ERROR("void cxios_get_axis_comment(axis_Ptr axis_hdl, char * comment, int comment_size)", << "Input string is too short");
160    CTimer::get("XIOS").suspend();
161  }
162
163  bool cxios_is_defined_axis_comment(axis_Ptr axis_hdl)
164  {
165     CTimer::get("XIOS").resume();
166     bool isDefined = axis_hdl->comment.hasInheritedValue();
167     CTimer::get("XIOS").suspend();
168     return isDefined;
169  }
170
171
172  void cxios_set_axis_data_begin(axis_Ptr axis_hdl, int data_begin)
173  {
174    CTimer::get("XIOS").resume();
175    axis_hdl->data_begin.setValue(data_begin);
176    CTimer::get("XIOS").suspend();
177  }
178
179  void cxios_get_axis_data_begin(axis_Ptr axis_hdl, int* data_begin)
180  {
181    CTimer::get("XIOS").resume();
182    *data_begin = axis_hdl->data_begin.getInheritedValue();
183    CTimer::get("XIOS").suspend();
184  }
185
186  bool cxios_is_defined_axis_data_begin(axis_Ptr axis_hdl)
187  {
188     CTimer::get("XIOS").resume();
189     bool isDefined = axis_hdl->data_begin.hasInheritedValue();
190     CTimer::get("XIOS").suspend();
191     return isDefined;
192  }
193
194
195  void cxios_set_axis_data_index(axis_Ptr axis_hdl, int* data_index, int* extent)
196  {
197    CTimer::get("XIOS").resume();
198    CArray<int,1> tmp(data_index, shape(extent[0]), neverDeleteData);
199    axis_hdl->data_index.reference(tmp.copy());
200     CTimer::get("XIOS").suspend();
201  }
202
203  void cxios_get_axis_data_index(axis_Ptr axis_hdl, int* data_index, int* extent)
204  {
205    CTimer::get("XIOS").resume();
206    CArray<int,1> tmp(data_index, shape(extent[0]), neverDeleteData);
207    tmp=axis_hdl->data_index.getInheritedValue();
208     CTimer::get("XIOS").suspend();
209  }
210
211  bool cxios_is_defined_axis_data_index(axis_Ptr axis_hdl)
212  {
213     CTimer::get("XIOS").resume();
214     bool isDefined = axis_hdl->data_index.hasInheritedValue();
215     CTimer::get("XIOS").suspend();
216     return isDefined;
217  }
218
219
220  void cxios_set_axis_data_n(axis_Ptr axis_hdl, int data_n)
221  {
222    CTimer::get("XIOS").resume();
223    axis_hdl->data_n.setValue(data_n);
224    CTimer::get("XIOS").suspend();
225  }
226
227  void cxios_get_axis_data_n(axis_Ptr axis_hdl, int* data_n)
228  {
229    CTimer::get("XIOS").resume();
230    *data_n = axis_hdl->data_n.getInheritedValue();
231    CTimer::get("XIOS").suspend();
232  }
233
234  bool cxios_is_defined_axis_data_n(axis_Ptr axis_hdl)
235  {
236     CTimer::get("XIOS").resume();
237     bool isDefined = axis_hdl->data_n.hasInheritedValue();
238     CTimer::get("XIOS").suspend();
239     return isDefined;
240  }
241
242
243  void cxios_set_axis_dim_name(axis_Ptr axis_hdl, const char * dim_name, int dim_name_size)
244  {
245    std::string dim_name_str;
246    if (!cstr2string(dim_name, dim_name_size, dim_name_str)) return;
247    CTimer::get("XIOS").resume();
248    axis_hdl->dim_name.setValue(dim_name_str);
249    CTimer::get("XIOS").suspend();
250  }
251
252  void cxios_get_axis_dim_name(axis_Ptr axis_hdl, char * dim_name, int dim_name_size)
253  {
254    CTimer::get("XIOS").resume();
255    if (!string_copy(axis_hdl->dim_name.getInheritedValue(), dim_name, dim_name_size))
256      ERROR("void cxios_get_axis_dim_name(axis_Ptr axis_hdl, char * dim_name, int dim_name_size)", << "Input string is too short");
257    CTimer::get("XIOS").suspend();
258  }
259
260  bool cxios_is_defined_axis_dim_name(axis_Ptr axis_hdl)
261  {
262     CTimer::get("XIOS").resume();
263     bool isDefined = axis_hdl->dim_name.hasInheritedValue();
264     CTimer::get("XIOS").suspend();
265     return isDefined;
266  }
267
268
269  void cxios_set_axis_formula(axis_Ptr axis_hdl, const char * formula, int formula_size)
270  {
271    std::string formula_str;
272    if (!cstr2string(formula, formula_size, formula_str)) return;
273    CTimer::get("XIOS").resume();
274    axis_hdl->formula.setValue(formula_str);
275    CTimer::get("XIOS").suspend();
276  }
277
278  void cxios_get_axis_formula(axis_Ptr axis_hdl, char * formula, int formula_size)
279  {
280    CTimer::get("XIOS").resume();
281    if (!string_copy(axis_hdl->formula.getInheritedValue(), formula, formula_size))
282      ERROR("void cxios_get_axis_formula(axis_Ptr axis_hdl, char * formula, int formula_size)", << "Input string is too short");
283    CTimer::get("XIOS").suspend();
284  }
285
286  bool cxios_is_defined_axis_formula(axis_Ptr axis_hdl)
287  {
288     CTimer::get("XIOS").resume();
289     bool isDefined = axis_hdl->formula.hasInheritedValue();
290     CTimer::get("XIOS").suspend();
291     return isDefined;
292  }
293
294
295  void cxios_set_axis_formula_bounds(axis_Ptr axis_hdl, const char * formula_bounds, int formula_bounds_size)
296  {
297    std::string formula_bounds_str;
298    if (!cstr2string(formula_bounds, formula_bounds_size, formula_bounds_str)) return;
299    CTimer::get("XIOS").resume();
300    axis_hdl->formula_bounds.setValue(formula_bounds_str);
301    CTimer::get("XIOS").suspend();
302  }
303
304  void cxios_get_axis_formula_bounds(axis_Ptr axis_hdl, char * formula_bounds, int formula_bounds_size)
305  {
306    CTimer::get("XIOS").resume();
307    if (!string_copy(axis_hdl->formula_bounds.getInheritedValue(), formula_bounds, formula_bounds_size))
308      ERROR("void cxios_get_axis_formula_bounds(axis_Ptr axis_hdl, char * formula_bounds, int formula_bounds_size)", << "Input string is too short");
309    CTimer::get("XIOS").suspend();
310  }
311
312  bool cxios_is_defined_axis_formula_bounds(axis_Ptr axis_hdl)
313  {
314     CTimer::get("XIOS").resume();
315     bool isDefined = axis_hdl->formula_bounds.hasInheritedValue();
316     CTimer::get("XIOS").suspend();
317     return isDefined;
318  }
319
320
321  void cxios_set_axis_formula_term(axis_Ptr axis_hdl, const char * formula_term, int formula_term_size)
322  {
323    std::string formula_term_str;
324    if (!cstr2string(formula_term, formula_term_size, formula_term_str)) return;
325    CTimer::get("XIOS").resume();
326    axis_hdl->formula_term.setValue(formula_term_str);
327    CTimer::get("XIOS").suspend();
328  }
329
330  void cxios_get_axis_formula_term(axis_Ptr axis_hdl, char * formula_term, int formula_term_size)
331  {
332    CTimer::get("XIOS").resume();
333    if (!string_copy(axis_hdl->formula_term.getInheritedValue(), formula_term, formula_term_size))
334      ERROR("void cxios_get_axis_formula_term(axis_Ptr axis_hdl, char * formula_term, int formula_term_size)", << "Input string is too short");
335    CTimer::get("XIOS").suspend();
336  }
337
338  bool cxios_is_defined_axis_formula_term(axis_Ptr axis_hdl)
339  {
340     CTimer::get("XIOS").resume();
341     bool isDefined = axis_hdl->formula_term.hasInheritedValue();
342     CTimer::get("XIOS").suspend();
343     return isDefined;
344  }
345
346
347  void cxios_set_axis_formula_term_bounds(axis_Ptr axis_hdl, const char * formula_term_bounds, int formula_term_bounds_size)
348  {
349    std::string formula_term_bounds_str;
350    if (!cstr2string(formula_term_bounds, formula_term_bounds_size, formula_term_bounds_str)) return;
351    CTimer::get("XIOS").resume();
352    axis_hdl->formula_term_bounds.setValue(formula_term_bounds_str);
353    CTimer::get("XIOS").suspend();
354  }
355
356  void cxios_get_axis_formula_term_bounds(axis_Ptr axis_hdl, char * formula_term_bounds, int formula_term_bounds_size)
357  {
358    CTimer::get("XIOS").resume();
359    if (!string_copy(axis_hdl->formula_term_bounds.getInheritedValue(), formula_term_bounds, formula_term_bounds_size))
360      ERROR("void cxios_get_axis_formula_term_bounds(axis_Ptr axis_hdl, char * formula_term_bounds, int formula_term_bounds_size)", << "Input string is too short");
361    CTimer::get("XIOS").suspend();
362  }
363
364  bool cxios_is_defined_axis_formula_term_bounds(axis_Ptr axis_hdl)
365  {
366     CTimer::get("XIOS").resume();
367     bool isDefined = axis_hdl->formula_term_bounds.hasInheritedValue();
368     CTimer::get("XIOS").suspend();
369     return isDefined;
370  }
371
372
373  void cxios_set_axis_index(axis_Ptr axis_hdl, int* index, int* extent)
374  {
375    CTimer::get("XIOS").resume();
376    CArray<int,1> tmp(index, shape(extent[0]), neverDeleteData);
377    axis_hdl->index.reference(tmp.copy());
378     CTimer::get("XIOS").suspend();
379  }
380
381  void cxios_get_axis_index(axis_Ptr axis_hdl, int* index, int* extent)
382  {
383    CTimer::get("XIOS").resume();
384    CArray<int,1> tmp(index, shape(extent[0]), neverDeleteData);
385    tmp=axis_hdl->index.getInheritedValue();
386     CTimer::get("XIOS").suspend();
387  }
388
389  bool cxios_is_defined_axis_index(axis_Ptr axis_hdl)
390  {
391     CTimer::get("XIOS").resume();
392     bool isDefined = axis_hdl->index.hasInheritedValue();
393     CTimer::get("XIOS").suspend();
394     return isDefined;
395  }
396
397
398  void cxios_set_axis_label(axis_Ptr axis_hdl, char* label, int str_len, int* str_size, int* extent)
399  {
400    CTimer::get("XIOS").resume();
401    axis_hdl->label.resize(shape(extent[0]));
402    Array<StdString,1>::iterator it, itb=axis_hdl->label.begin(), ite=axis_hdl->label.end() ;
403    int i, n ;
404    for(it=itb, i=0, n=0 ; it!=ite ; ++it,n+=str_len,++i) *it=StdString(&label[n],str_size[i]) ;
405    CTimer::get("XIOS").suspend();
406  }
407
408  void cxios_get_axis_label(axis_Ptr axis_hdl, char* label, int str_size, int* extent)
409  {
410    CTimer::get("XIOS").resume();
411    Array<StdString,1>::const_iterator it, itb=axis_hdl->label.getInheritedValue().begin(), ite=axis_hdl->label.getInheritedValue().end() ;
412    int n ;
413    for(it=itb, n=0 ; it!=ite ; ++it, n+=str_size) it->copy(&label[n],it->size()) ; 
414    CTimer::get("XIOS").suspend();
415  }
416
417  bool cxios_is_defined_axis_label(axis_Ptr axis_hdl)
418  {
419     CTimer::get("XIOS").resume();
420     bool isDefined = axis_hdl->label.hasInheritedValue();
421     CTimer::get("XIOS").suspend();
422     return isDefined;
423  }
424
425
426  void cxios_set_axis_long_name(axis_Ptr axis_hdl, const char * long_name, int long_name_size)
427  {
428    std::string long_name_str;
429    if (!cstr2string(long_name, long_name_size, long_name_str)) return;
430    CTimer::get("XIOS").resume();
431    axis_hdl->long_name.setValue(long_name_str);
432    CTimer::get("XIOS").suspend();
433  }
434
435  void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)
436  {
437    CTimer::get("XIOS").resume();
438    if (!string_copy(axis_hdl->long_name.getInheritedValue(), long_name, long_name_size))
439      ERROR("void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)", << "Input string is too short");
440    CTimer::get("XIOS").suspend();
441  }
442
443  bool cxios_is_defined_axis_long_name(axis_Ptr axis_hdl)
444  {
445     CTimer::get("XIOS").resume();
446     bool isDefined = axis_hdl->long_name.hasInheritedValue();
447     CTimer::get("XIOS").suspend();
448     return isDefined;
449  }
450
451
452  void cxios_set_axis_mask(axis_Ptr axis_hdl, bool* mask, int* extent)
453  {
454    CTimer::get("XIOS").resume();
455    CArray<bool,1> tmp(mask, shape(extent[0]), neverDeleteData);
456    axis_hdl->mask.reference(tmp.copy());
457     CTimer::get("XIOS").suspend();
458  }
459
460  void cxios_get_axis_mask(axis_Ptr axis_hdl, bool* mask, int* extent)
461  {
462    CTimer::get("XIOS").resume();
463    CArray<bool,1> tmp(mask, shape(extent[0]), neverDeleteData);
464    tmp=axis_hdl->mask.getInheritedValue();
465     CTimer::get("XIOS").suspend();
466  }
467
468  bool cxios_is_defined_axis_mask(axis_Ptr axis_hdl)
469  {
470     CTimer::get("XIOS").resume();
471     bool isDefined = axis_hdl->mask.hasInheritedValue();
472     CTimer::get("XIOS").suspend();
473     return isDefined;
474  }
475
476
477  void cxios_set_axis_n(axis_Ptr axis_hdl, int n)
478  {
479    CTimer::get("XIOS").resume();
480    axis_hdl->n.setValue(n);
481    CTimer::get("XIOS").suspend();
482  }
483
484  void cxios_get_axis_n(axis_Ptr axis_hdl, int* n)
485  {
486    CTimer::get("XIOS").resume();
487    *n = axis_hdl->n.getInheritedValue();
488    CTimer::get("XIOS").suspend();
489  }
490
491  bool cxios_is_defined_axis_n(axis_Ptr axis_hdl)
492  {
493     CTimer::get("XIOS").resume();
494     bool isDefined = axis_hdl->n.hasInheritedValue();
495     CTimer::get("XIOS").suspend();
496     return isDefined;
497  }
498
499
500  void cxios_set_axis_n_distributed_partition(axis_Ptr axis_hdl, int n_distributed_partition)
501  {
502    CTimer::get("XIOS").resume();
503    axis_hdl->n_distributed_partition.setValue(n_distributed_partition);
504    CTimer::get("XIOS").suspend();
505  }
506
507  void cxios_get_axis_n_distributed_partition(axis_Ptr axis_hdl, int* n_distributed_partition)
508  {
509    CTimer::get("XIOS").resume();
510    *n_distributed_partition = axis_hdl->n_distributed_partition.getInheritedValue();
511    CTimer::get("XIOS").suspend();
512  }
513
514  bool cxios_is_defined_axis_n_distributed_partition(axis_Ptr axis_hdl)
515  {
516     CTimer::get("XIOS").resume();
517     bool isDefined = axis_hdl->n_distributed_partition.hasInheritedValue();
518     CTimer::get("XIOS").suspend();
519     return isDefined;
520  }
521
522
523  void cxios_set_axis_n_glo(axis_Ptr axis_hdl, int n_glo)
524  {
525    CTimer::get("XIOS").resume();
526    axis_hdl->n_glo.setValue(n_glo);
527    CTimer::get("XIOS").suspend();
528  }
529
530  void cxios_get_axis_n_glo(axis_Ptr axis_hdl, int* n_glo)
531  {
532    CTimer::get("XIOS").resume();
533    *n_glo = axis_hdl->n_glo.getInheritedValue();
534    CTimer::get("XIOS").suspend();
535  }
536
537  bool cxios_is_defined_axis_n_glo(axis_Ptr axis_hdl)
538  {
539     CTimer::get("XIOS").resume();
540     bool isDefined = axis_hdl->n_glo.hasInheritedValue();
541     CTimer::get("XIOS").suspend();
542     return isDefined;
543  }
544
545
546  void cxios_set_axis_name(axis_Ptr axis_hdl, const char * name, int name_size)
547  {
548    std::string name_str;
549    if (!cstr2string(name, name_size, name_str)) return;
550    CTimer::get("XIOS").resume();
551    axis_hdl->name.setValue(name_str);
552    CTimer::get("XIOS").suspend();
553  }
554
555  void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)
556  {
557    CTimer::get("XIOS").resume();
558    if (!string_copy(axis_hdl->name.getInheritedValue(), name, name_size))
559      ERROR("void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)", << "Input string is too short");
560    CTimer::get("XIOS").suspend();
561  }
562
563  bool cxios_is_defined_axis_name(axis_Ptr axis_hdl)
564  {
565     CTimer::get("XIOS").resume();
566     bool isDefined = axis_hdl->name.hasInheritedValue();
567     CTimer::get("XIOS").suspend();
568     return isDefined;
569  }
570
571
572  void cxios_set_axis_positive(axis_Ptr axis_hdl, const char * positive, int positive_size)
573  {
574    std::string positive_str;
575    if (!cstr2string(positive, positive_size, positive_str)) return;
576    CTimer::get("XIOS").resume();
577    axis_hdl->positive.fromString(positive_str);
578    CTimer::get("XIOS").suspend();
579  }
580
581  void cxios_get_axis_positive(axis_Ptr axis_hdl, char * positive, int positive_size)
582  {
583    CTimer::get("XIOS").resume();
584    if (!string_copy(axis_hdl->positive.getInheritedStringValue(), positive, positive_size))
585      ERROR("void cxios_get_axis_positive(axis_Ptr axis_hdl, char * positive, int positive_size)", << "Input string is too short");
586    CTimer::get("XIOS").suspend();
587  }
588
589  bool cxios_is_defined_axis_positive(axis_Ptr axis_hdl)
590  {
591     CTimer::get("XIOS").resume();
592     bool isDefined = axis_hdl->positive.hasInheritedValue();
593     CTimer::get("XIOS").suspend();
594     return isDefined;
595  }
596
597
598  void cxios_set_axis_prec(axis_Ptr axis_hdl, int prec)
599  {
600    CTimer::get("XIOS").resume();
601    axis_hdl->prec.setValue(prec);
602    CTimer::get("XIOS").suspend();
603  }
604
605  void cxios_get_axis_prec(axis_Ptr axis_hdl, int* prec)
606  {
607    CTimer::get("XIOS").resume();
608    *prec = axis_hdl->prec.getInheritedValue();
609    CTimer::get("XIOS").suspend();
610  }
611
612  bool cxios_is_defined_axis_prec(axis_Ptr axis_hdl)
613  {
614     CTimer::get("XIOS").resume();
615     bool isDefined = axis_hdl->prec.hasInheritedValue();
616     CTimer::get("XIOS").suspend();
617     return isDefined;
618  }
619
620
621  void cxios_set_axis_standard_name(axis_Ptr axis_hdl, const char * standard_name, int standard_name_size)
622  {
623    std::string standard_name_str;
624    if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
625    CTimer::get("XIOS").resume();
626    axis_hdl->standard_name.setValue(standard_name_str);
627    CTimer::get("XIOS").suspend();
628  }
629
630  void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)
631  {
632    CTimer::get("XIOS").resume();
633    if (!string_copy(axis_hdl->standard_name.getInheritedValue(), standard_name, standard_name_size))
634      ERROR("void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)", << "Input string is too short");
635    CTimer::get("XIOS").suspend();
636  }
637
638  bool cxios_is_defined_axis_standard_name(axis_Ptr axis_hdl)
639  {
640     CTimer::get("XIOS").resume();
641     bool isDefined = axis_hdl->standard_name.hasInheritedValue();
642     CTimer::get("XIOS").suspend();
643     return isDefined;
644  }
645
646
647  void cxios_set_axis_unit(axis_Ptr axis_hdl, const char * unit, int unit_size)
648  {
649    std::string unit_str;
650    if (!cstr2string(unit, unit_size, unit_str)) return;
651    CTimer::get("XIOS").resume();
652    axis_hdl->unit.setValue(unit_str);
653    CTimer::get("XIOS").suspend();
654  }
655
656  void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)
657  {
658    CTimer::get("XIOS").resume();
659    if (!string_copy(axis_hdl->unit.getInheritedValue(), unit, unit_size))
660      ERROR("void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)", << "Input string is too short");
661    CTimer::get("XIOS").suspend();
662  }
663
664  bool cxios_is_defined_axis_unit(axis_Ptr axis_hdl)
665  {
666     CTimer::get("XIOS").resume();
667     bool isDefined = axis_hdl->unit.hasInheritedValue();
668     CTimer::get("XIOS").suspend();
669     return isDefined;
670  }
671
672
673  void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int* extent)
674  {
675    CTimer::get("XIOS").resume();
676    CArray<double,1> tmp(value, shape(extent[0]), neverDeleteData);
677    axis_hdl->value.reference(tmp.copy());
678     CTimer::get("XIOS").suspend();
679  }
680
681  void cxios_get_axis_value(axis_Ptr axis_hdl, double* value, int* extent)
682  {
683    CTimer::get("XIOS").resume();
684    CArray<double,1> tmp(value, shape(extent[0]), neverDeleteData);
685    tmp=axis_hdl->value.getInheritedValue();
686     CTimer::get("XIOS").suspend();
687  }
688
689  bool cxios_is_defined_axis_value(axis_Ptr axis_hdl)
690  {
691     CTimer::get("XIOS").resume();
692     bool isDefined = axis_hdl->value.hasInheritedValue();
693     CTimer::get("XIOS").suspend();
694     return isDefined;
695  }
696}
Note: See TracBrowser for help on using the repository browser.