source: XIOS3/trunk/src/interface/c_attr/icaxis_attr.cpp @ 2622

Last change on this file since 2622 was 2616, checked in by jderouillat, 4 months ago

Add XIOS3 fortran interfaces (resources management, chunking, compression)

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