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

Last change on this file since 532 was 532, checked in by rlacroix, 10 years ago

Add a new attribute type for dates and use it for the context's start_date and time_origin.

The "xios_date" type should now be used to get/set date attributes through the Fortran interface. This avoids using strings to manipulate dates.

  • 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: 7.6 KB
Line 
1/* ************************************************************************** *
2 *               Interface auto generated - do not modify                   *
3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6#include <boost/shared_ptr.hpp>
7#include "xmlioserver.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_long_name(axis_Ptr axis_hdl, const char * long_name, int long_name_size)
21  {
22    std::string long_name_str;
23    if(!cstr2string(long_name, long_name_size, long_name_str)) return;
24     CTimer::get("XIOS").resume();
25    axis_hdl->long_name.setValue(long_name_str);
26     CTimer::get("XIOS").suspend();
27  }
28 
29  void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)
30  {
31     CTimer::get("XIOS").resume();
32    if(!string_copy(axis_hdl->long_name.getInheritedValue(),long_name , long_name_size))
33      ERROR("void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)", <<"Input string is to short");
34     CTimer::get("XIOS").suspend();
35  }
36 
37  bool cxios_is_defined_axis_long_name(axis_Ptr axis_hdl )
38  {
39     CTimer::get("XIOS").resume();
40    return axis_hdl->long_name.hasInheritedValue();
41     CTimer::get("XIOS").suspend();
42  }
43 
44 
45 
46  void cxios_set_axis_name(axis_Ptr axis_hdl, const char * name, int name_size)
47  {
48    std::string name_str;
49    if(!cstr2string(name, name_size, name_str)) return;
50     CTimer::get("XIOS").resume();
51    axis_hdl->name.setValue(name_str);
52     CTimer::get("XIOS").suspend();
53  }
54 
55  void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)
56  {
57     CTimer::get("XIOS").resume();
58    if(!string_copy(axis_hdl->name.getInheritedValue(),name , name_size))
59      ERROR("void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)", <<"Input string is to short");
60     CTimer::get("XIOS").suspend();
61  }
62 
63  bool cxios_is_defined_axis_name(axis_Ptr axis_hdl )
64  {
65     CTimer::get("XIOS").resume();
66    return axis_hdl->name.hasInheritedValue();
67     CTimer::get("XIOS").suspend();
68  }
69 
70 
71 
72  void cxios_set_axis_positive(axis_Ptr axis_hdl, const char * positive, int positive_size)
73  {
74    std::string positive_str;
75    if(!cstr2string(positive, positive_size, positive_str)) return;
76     CTimer::get("XIOS").resume();
77    axis_hdl->positive.fromString(positive_str);
78     CTimer::get("XIOS").suspend();
79  }
80 
81  void cxios_get_axis_positive(axis_Ptr axis_hdl, char * positive, int positive_size)
82  {
83     CTimer::get("XIOS").resume();
84    if(!string_copy(axis_hdl->positive.getInheritedStringValue(),positive , positive_size))
85      ERROR("void cxios_get_axis_positive(axis_Ptr axis_hdl, char * positive, int positive_size)", <<"Input string is to short");
86     CTimer::get("XIOS").suspend();
87  }
88 
89  bool cxios_is_defined_axis_positive(axis_Ptr axis_hdl )
90  {
91     CTimer::get("XIOS").resume();
92    return axis_hdl->positive.hasInheritedValue();
93     CTimer::get("XIOS").suspend();
94  }
95 
96 
97 
98  void cxios_set_axis_size(axis_Ptr axis_hdl, int size)
99  {
100     CTimer::get("XIOS").resume();
101    axis_hdl->size.setValue(size);
102     CTimer::get("XIOS").suspend();
103  }
104 
105  void cxios_get_axis_size(axis_Ptr axis_hdl, int* size)
106  {
107    *size = axis_hdl->size.getInheritedValue();
108  }
109 
110  bool cxios_is_defined_axis_size(axis_Ptr axis_hdl )
111  {
112     CTimer::get("XIOS").resume();
113    return axis_hdl->size.hasInheritedValue();
114     CTimer::get("XIOS").suspend();
115  }
116 
117 
118 
119  void cxios_set_axis_standard_name(axis_Ptr axis_hdl, const char * standard_name, int standard_name_size)
120  {
121    std::string standard_name_str;
122    if(!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
123     CTimer::get("XIOS").resume();
124    axis_hdl->standard_name.setValue(standard_name_str);
125     CTimer::get("XIOS").suspend();
126  }
127 
128  void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)
129  {
130     CTimer::get("XIOS").resume();
131    if(!string_copy(axis_hdl->standard_name.getInheritedValue(),standard_name , standard_name_size))
132      ERROR("void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)", <<"Input string is to short");
133     CTimer::get("XIOS").suspend();
134  }
135 
136  bool cxios_is_defined_axis_standard_name(axis_Ptr axis_hdl )
137  {
138     CTimer::get("XIOS").resume();
139    return axis_hdl->standard_name.hasInheritedValue();
140     CTimer::get("XIOS").suspend();
141  }
142 
143 
144 
145  void cxios_set_axis_unit(axis_Ptr axis_hdl, const char * unit, int unit_size)
146  {
147    std::string unit_str;
148    if(!cstr2string(unit, unit_size, unit_str)) return;
149     CTimer::get("XIOS").resume();
150    axis_hdl->unit.setValue(unit_str);
151     CTimer::get("XIOS").suspend();
152  }
153 
154  void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)
155  {
156     CTimer::get("XIOS").resume();
157    if(!string_copy(axis_hdl->unit.getInheritedValue(),unit , unit_size))
158      ERROR("void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)", <<"Input string is to short");
159     CTimer::get("XIOS").suspend();
160  }
161 
162  bool cxios_is_defined_axis_unit(axis_Ptr axis_hdl )
163  {
164     CTimer::get("XIOS").resume();
165    return axis_hdl->unit.hasInheritedValue();
166     CTimer::get("XIOS").suspend();
167  }
168 
169 
170 
171  void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int extent1)
172  {
173    CTimer::get("XIOS").resume();
174    CArray<double,1> tmp(value,shape(extent1),neverDeleteData) ;
175    axis_hdl->value.reference(tmp.copy());
176     CTimer::get("XIOS").suspend();
177  }
178 
179  void cxios_get_axis_value(axis_Ptr axis_hdl, double* value, int extent1)
180  {
181    CTimer::get("XIOS").resume();
182    CArray<double,1> tmp(value,shape(extent1),neverDeleteData) ;
183    tmp=axis_hdl->value.getInheritedValue() ;
184     CTimer::get("XIOS").suspend();
185  }
186 
187  bool cxios_is_defined_axis_value(axis_Ptr axis_hdl )
188  {
189     CTimer::get("XIOS").resume();
190    return axis_hdl->value.hasInheritedValue();
191     CTimer::get("XIOS").suspend();
192  }
193 
194 
195 
196  void cxios_set_axis_zoom_begin(axis_Ptr axis_hdl, int zoom_begin)
197  {
198     CTimer::get("XIOS").resume();
199    axis_hdl->zoom_begin.setValue(zoom_begin);
200     CTimer::get("XIOS").suspend();
201  }
202 
203  void cxios_get_axis_zoom_begin(axis_Ptr axis_hdl, int* zoom_begin)
204  {
205    *zoom_begin = axis_hdl->zoom_begin.getInheritedValue();
206  }
207 
208  bool cxios_is_defined_axis_zoom_begin(axis_Ptr axis_hdl )
209  {
210     CTimer::get("XIOS").resume();
211    return axis_hdl->zoom_begin.hasInheritedValue();
212     CTimer::get("XIOS").suspend();
213  }
214 
215 
216 
217  void cxios_set_axis_zoom_end(axis_Ptr axis_hdl, int zoom_end)
218  {
219     CTimer::get("XIOS").resume();
220    axis_hdl->zoom_end.setValue(zoom_end);
221     CTimer::get("XIOS").suspend();
222  }
223 
224  void cxios_get_axis_zoom_end(axis_Ptr axis_hdl, int* zoom_end)
225  {
226    *zoom_end = axis_hdl->zoom_end.getInheritedValue();
227  }
228 
229  bool cxios_is_defined_axis_zoom_end(axis_Ptr axis_hdl )
230  {
231     CTimer::get("XIOS").resume();
232    return axis_hdl->zoom_end.hasInheritedValue();
233     CTimer::get("XIOS").suspend();
234  }
235 
236 
237 
238  void cxios_set_axis_zoom_size(axis_Ptr axis_hdl, int zoom_size)
239  {
240     CTimer::get("XIOS").resume();
241    axis_hdl->zoom_size.setValue(zoom_size);
242     CTimer::get("XIOS").suspend();
243  }
244 
245  void cxios_get_axis_zoom_size(axis_Ptr axis_hdl, int* zoom_size)
246  {
247    *zoom_size = axis_hdl->zoom_size.getInheritedValue();
248  }
249 
250  bool cxios_is_defined_axis_zoom_size(axis_Ptr axis_hdl )
251  {
252     CTimer::get("XIOS").resume();
253    return axis_hdl->zoom_size.hasInheritedValue();
254     CTimer::get("XIOS").suspend();
255  }
256 
257 
258 
259 
260}
Note: See TracBrowser for help on using the repository browser.