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
RevLine 
[325]1/* ************************************************************************** *
[581]2 *               Interface auto generated - do not modify                     *
[325]3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
[1542]6#include <memory>
[591]7#include "xios.hpp"
[352]8#include "attribute_template.hpp"
9#include "object_template.hpp"
10#include "group_template.hpp"
[325]11#include "icutil.hpp"
[532]12#include "icdate.hpp"
[347]13#include "timer.hpp"
[369]14#include "node_type.hpp"
[325]15
16extern "C"
17{
[581]18  typedef xios::CAxis* axis_Ptr;
19
[546]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;
[581]23    if (!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return;
24    CTimer::get("XIOS").resume();
[546]25    axis_hdl->axis_ref.setValue(axis_ref_str);
[581]26    CTimer::get("XIOS").suspend();
[546]27  }
[581]28
[546]29  void cxios_get_axis_axis_ref(axis_Ptr axis_hdl, char * axis_ref, int axis_ref_size)
30  {
[581]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();
[546]35  }
[581]36
37  bool cxios_is_defined_axis_axis_ref(axis_Ptr axis_hdl)
[546]38  {
39     CTimer::get("XIOS").resume();
[581]40     bool isDefined = axis_hdl->axis_ref.hasInheritedValue();
[546]41     CTimer::get("XIOS").suspend();
[581]42     return isDefined;
[546]43  }
[581]44
45
[1492]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
[666]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
[674]95  void cxios_set_axis_bounds(axis_Ptr axis_hdl, double* bounds, int* extent)
[609]96  {
97    CTimer::get("XIOS").resume();
[674]98    CArray<double,2> tmp(bounds, shape(extent[0], extent[1]), neverDeleteData);
[609]99    axis_hdl->bounds.reference(tmp.copy());
100     CTimer::get("XIOS").suspend();
101  }
102
[674]103  void cxios_get_axis_bounds(axis_Ptr axis_hdl, double* bounds, int* extent)
[609]104  {
105    CTimer::get("XIOS").resume();
[674]106    CArray<double,2> tmp(bounds, shape(extent[0], extent[1]), neverDeleteData);
[609]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
[1492]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
[555]172  void cxios_set_axis_data_begin(axis_Ptr axis_hdl, int data_begin)
173  {
[581]174    CTimer::get("XIOS").resume();
[555]175    axis_hdl->data_begin.setValue(data_begin);
[581]176    CTimer::get("XIOS").suspend();
[555]177  }
[581]178
[555]179  void cxios_get_axis_data_begin(axis_Ptr axis_hdl, int* data_begin)
180  {
[581]181    CTimer::get("XIOS").resume();
[555]182    *data_begin = axis_hdl->data_begin.getInheritedValue();
[581]183    CTimer::get("XIOS").suspend();
[555]184  }
[581]185
186  bool cxios_is_defined_axis_data_begin(axis_Ptr axis_hdl)
[555]187  {
188     CTimer::get("XIOS").resume();
[581]189     bool isDefined = axis_hdl->data_begin.hasInheritedValue();
[555]190     CTimer::get("XIOS").suspend();
[581]191     return isDefined;
[555]192  }
[581]193
194
[674]195  void cxios_set_axis_data_index(axis_Ptr axis_hdl, int* data_index, int* extent)
[555]196  {
197    CTimer::get("XIOS").resume();
[674]198    CArray<int,1> tmp(data_index, shape(extent[0]), neverDeleteData);
[555]199    axis_hdl->data_index.reference(tmp.copy());
200     CTimer::get("XIOS").suspend();
201  }
[581]202
[674]203  void cxios_get_axis_data_index(axis_Ptr axis_hdl, int* data_index, int* extent)
[555]204  {
205    CTimer::get("XIOS").resume();
[674]206    CArray<int,1> tmp(data_index, shape(extent[0]), neverDeleteData);
[581]207    tmp=axis_hdl->data_index.getInheritedValue();
[555]208     CTimer::get("XIOS").suspend();
209  }
[581]210
211  bool cxios_is_defined_axis_data_index(axis_Ptr axis_hdl)
[555]212  {
213     CTimer::get("XIOS").resume();
[581]214     bool isDefined = axis_hdl->data_index.hasInheritedValue();
[555]215     CTimer::get("XIOS").suspend();
[581]216     return isDefined;
[555]217  }
[581]218
219
[555]220  void cxios_set_axis_data_n(axis_Ptr axis_hdl, int data_n)
221  {
[581]222    CTimer::get("XIOS").resume();
[555]223    axis_hdl->data_n.setValue(data_n);
[581]224    CTimer::get("XIOS").suspend();
[555]225  }
[581]226
[555]227  void cxios_get_axis_data_n(axis_Ptr axis_hdl, int* data_n)
228  {
[581]229    CTimer::get("XIOS").resume();
[555]230    *data_n = axis_hdl->data_n.getInheritedValue();
[581]231    CTimer::get("XIOS").suspend();
[555]232  }
[581]233
234  bool cxios_is_defined_axis_data_n(axis_Ptr axis_hdl)
[555]235  {
236     CTimer::get("XIOS").resume();
[581]237     bool isDefined = axis_hdl->data_n.hasInheritedValue();
[555]238     CTimer::get("XIOS").suspend();
[581]239     return isDefined;
[555]240  }
[581]241
242
[1492]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
[817]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
[1158]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
[325]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;
[581]429    if (!cstr2string(long_name, long_name_size, long_name_str)) return;
430    CTimer::get("XIOS").resume();
[325]431    axis_hdl->long_name.setValue(long_name_str);
[581]432    CTimer::get("XIOS").suspend();
[325]433  }
[581]434
[325]435  void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)
436  {
[581]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();
[325]441  }
[581]442
443  bool cxios_is_defined_axis_long_name(axis_Ptr axis_hdl)
[432]444  {
445     CTimer::get("XIOS").resume();
[581]446     bool isDefined = axis_hdl->long_name.hasInheritedValue();
[432]447     CTimer::get("XIOS").suspend();
[581]448     return isDefined;
[432]449  }
[581]450
451
[674]452  void cxios_set_axis_mask(axis_Ptr axis_hdl, bool* mask, int* extent)
[555]453  {
454    CTimer::get("XIOS").resume();
[674]455    CArray<bool,1> tmp(mask, shape(extent[0]), neverDeleteData);
[555]456    axis_hdl->mask.reference(tmp.copy());
457     CTimer::get("XIOS").suspend();
458  }
[581]459
[674]460  void cxios_get_axis_mask(axis_Ptr axis_hdl, bool* mask, int* extent)
[555]461  {
462    CTimer::get("XIOS").resume();
[674]463    CArray<bool,1> tmp(mask, shape(extent[0]), neverDeleteData);
[581]464    tmp=axis_hdl->mask.getInheritedValue();
[555]465     CTimer::get("XIOS").suspend();
466  }
[581]467
468  bool cxios_is_defined_axis_mask(axis_Ptr axis_hdl)
[555]469  {
470     CTimer::get("XIOS").resume();
[581]471     bool isDefined = axis_hdl->mask.hasInheritedValue();
[555]472     CTimer::get("XIOS").suspend();
[581]473     return isDefined;
[555]474  }
[581]475
476
[666]477  void cxios_set_axis_n(axis_Ptr axis_hdl, int n)
[325]478  {
[581]479    CTimer::get("XIOS").resume();
[666]480    axis_hdl->n.setValue(n);
[581]481    CTimer::get("XIOS").suspend();
[325]482  }
[581]483
[666]484  void cxios_get_axis_n(axis_Ptr axis_hdl, int* n)
[325]485  {
[581]486    CTimer::get("XIOS").resume();
[666]487    *n = axis_hdl->n.getInheritedValue();
[581]488    CTimer::get("XIOS").suspend();
[325]489  }
[581]490
[666]491  bool cxios_is_defined_axis_n(axis_Ptr axis_hdl)
[432]492  {
493     CTimer::get("XIOS").resume();
[666]494     bool isDefined = axis_hdl->n.hasInheritedValue();
[432]495     CTimer::get("XIOS").suspend();
[581]496     return isDefined;
[432]497  }
[581]498
499
[779]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
[666]523  void cxios_set_axis_n_glo(axis_Ptr axis_hdl, int n_glo)
[555]524  {
[581]525    CTimer::get("XIOS").resume();
[666]526    axis_hdl->n_glo.setValue(n_glo);
[581]527    CTimer::get("XIOS").suspend();
[555]528  }
[581]529
[666]530  void cxios_get_axis_n_glo(axis_Ptr axis_hdl, int* n_glo)
[555]531  {
[581]532    CTimer::get("XIOS").resume();
[666]533    *n_glo = axis_hdl->n_glo.getInheritedValue();
[581]534    CTimer::get("XIOS").suspend();
[555]535  }
[581]536
[666]537  bool cxios_is_defined_axis_n_glo(axis_Ptr axis_hdl)
[555]538  {
539     CTimer::get("XIOS").resume();
[666]540     bool isDefined = axis_hdl->n_glo.hasInheritedValue();
[555]541     CTimer::get("XIOS").suspend();
[581]542     return isDefined;
[555]543  }
[581]544
545
[666]546  void cxios_set_axis_name(axis_Ptr axis_hdl, const char * name, int name_size)
[415]547  {
[666]548    std::string name_str;
549    if (!cstr2string(name, name_size, name_str)) return;
[581]550    CTimer::get("XIOS").resume();
[666]551    axis_hdl->name.setValue(name_str);
[581]552    CTimer::get("XIOS").suspend();
[415]553  }
[581]554
[666]555  void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)
[415]556  {
[581]557    CTimer::get("XIOS").resume();
[666]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");
[581]560    CTimer::get("XIOS").suspend();
[415]561  }
[581]562
[666]563  bool cxios_is_defined_axis_name(axis_Ptr axis_hdl)
[432]564  {
565     CTimer::get("XIOS").resume();
[666]566     bool isDefined = axis_hdl->name.hasInheritedValue();
[432]567     CTimer::get("XIOS").suspend();
[581]568     return isDefined;
[432]569  }
[581]570
571
[666]572  void cxios_set_axis_positive(axis_Ptr axis_hdl, const char * positive, int positive_size)
[325]573  {
[666]574    std::string positive_str;
575    if (!cstr2string(positive, positive_size, positive_str)) return;
[581]576    CTimer::get("XIOS").resume();
[666]577    axis_hdl->positive.fromString(positive_str);
[581]578    CTimer::get("XIOS").suspend();
[325]579  }
[581]580
[666]581  void cxios_get_axis_positive(axis_Ptr axis_hdl, char * positive, int positive_size)
[325]582  {
[581]583    CTimer::get("XIOS").resume();
[666]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");
[581]586    CTimer::get("XIOS").suspend();
[325]587  }
[581]588
[666]589  bool cxios_is_defined_axis_positive(axis_Ptr axis_hdl)
[432]590  {
591     CTimer::get("XIOS").resume();
[666]592     bool isDefined = axis_hdl->positive.hasInheritedValue();
[432]593     CTimer::get("XIOS").suspend();
[581]594     return isDefined;
[432]595  }
[581]596
597
[1158]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
[325]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;
[581]624    if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
625    CTimer::get("XIOS").resume();
[325]626    axis_hdl->standard_name.setValue(standard_name_str);
[581]627    CTimer::get("XIOS").suspend();
[325]628  }
[581]629
[325]630  void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)
631  {
[581]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();
[325]636  }
[581]637
638  bool cxios_is_defined_axis_standard_name(axis_Ptr axis_hdl)
[432]639  {
640     CTimer::get("XIOS").resume();
[581]641     bool isDefined = axis_hdl->standard_name.hasInheritedValue();
[432]642     CTimer::get("XIOS").suspend();
[581]643     return isDefined;
[432]644  }
[581]645
646
[325]647  void cxios_set_axis_unit(axis_Ptr axis_hdl, const char * unit, int unit_size)
648  {
649    std::string unit_str;
[581]650    if (!cstr2string(unit, unit_size, unit_str)) return;
651    CTimer::get("XIOS").resume();
[325]652    axis_hdl->unit.setValue(unit_str);
[581]653    CTimer::get("XIOS").suspend();
[325]654  }
[581]655
[325]656  void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)
657  {
[581]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();
[325]662  }
[581]663
664  bool cxios_is_defined_axis_unit(axis_Ptr axis_hdl)
[432]665  {
666     CTimer::get("XIOS").resume();
[581]667     bool isDefined = axis_hdl->unit.hasInheritedValue();
[432]668     CTimer::get("XIOS").suspend();
[581]669     return isDefined;
[432]670  }
[581]671
672
[674]673  void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int* extent)
[325]674  {
[369]675    CTimer::get("XIOS").resume();
[674]676    CArray<double,1> tmp(value, shape(extent[0]), neverDeleteData);
[369]677    axis_hdl->value.reference(tmp.copy());
[416]678     CTimer::get("XIOS").suspend();
[325]679  }
[581]680
[674]681  void cxios_get_axis_value(axis_Ptr axis_hdl, double* value, int* extent)
[325]682  {
[416]683    CTimer::get("XIOS").resume();
[674]684    CArray<double,1> tmp(value, shape(extent[0]), neverDeleteData);
[581]685    tmp=axis_hdl->value.getInheritedValue();
[347]686     CTimer::get("XIOS").suspend();
[325]687  }
[581]688
689  bool cxios_is_defined_axis_value(axis_Ptr axis_hdl)
[432]690  {
691     CTimer::get("XIOS").resume();
[581]692     bool isDefined = axis_hdl->value.hasInheritedValue();
[432]693     CTimer::get("XIOS").suspend();
[581]694     return isDefined;
[432]695  }
[325]696}
Note: See TracBrowser for help on using the repository browser.