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

Last change on this file since 445 was 445, checked in by ymipsl, 11 years ago

Add possibility to make inheritance of attributes and reference before closing the context definition.
New fortran fonction : xios_solve inheritance()
After this call, the value of attribute have the inherited value of their parent.

YM

  • Property svn:eol-style set to native
File size: 8.2 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 "timer.hpp"
13#include "node_type.hpp"
14
15extern "C"
16{
17  typedef xios::CAxis*  axis_Ptr;
18 
19  void cxios_set_axis_long_name(axis_Ptr axis_hdl, const char * long_name, int long_name_size)
20  {
21    std::string long_name_str;
22    if(!cstr2string(long_name, long_name_size, long_name_str)) return;
23     CTimer::get("XIOS").resume();
24    axis_hdl->long_name.setValue(long_name_str);
25    axis_hdl->sendAttributToServer(axis_hdl->long_name);
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    axis_hdl->sendAttributToServer(axis_hdl->name);
53     CTimer::get("XIOS").suspend();
54  }
55 
56  void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)
57  {
58     CTimer::get("XIOS").resume();
59    if(!string_copy(axis_hdl->name.getInheritedValue(),name , name_size))
60      ERROR("void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)", <<"Input string is to short");
61     CTimer::get("XIOS").suspend();
62  }
63 
64  bool cxios_is_defined_axis_name(axis_Ptr axis_hdl )
65  {
66     CTimer::get("XIOS").resume();
67    return axis_hdl->name.hasInheritedValue();
68     CTimer::get("XIOS").suspend();
69  }
70 
71 
72 
73  void cxios_set_axis_positive(axis_Ptr axis_hdl, const char * positive, int positive_size)
74  {
75    std::string positive_str;
76    if(!cstr2string(positive, positive_size, positive_str)) return;
77     CTimer::get("XIOS").resume();
78    axis_hdl->positive.fromString(positive_str);
79    axis_hdl->sendAttributToServer(axis_hdl->positive);
80     CTimer::get("XIOS").suspend();
81  }
82 
83  void cxios_get_axis_positive(axis_Ptr axis_hdl, char * positive, int positive_size)
84  {
85     CTimer::get("XIOS").resume();
86    if(!string_copy(axis_hdl->positive.getInheritedStringValue(),positive , positive_size))
87      ERROR("void cxios_get_axis_positive(axis_Ptr axis_hdl, char * positive, int positive_size)", <<"Input string is to short");
88     CTimer::get("XIOS").suspend();
89  }
90 
91  bool cxios_is_defined_axis_positive(axis_Ptr axis_hdl )
92  {
93     CTimer::get("XIOS").resume();
94    return axis_hdl->positive.hasInheritedValue();
95     CTimer::get("XIOS").suspend();
96  }
97 
98 
99 
100  void cxios_set_axis_size(axis_Ptr axis_hdl, int size)
101  {
102     CTimer::get("XIOS").resume();
103    axis_hdl->size.setValue(size);
104    axis_hdl->sendAttributToServer(axis_hdl->size);
105     CTimer::get("XIOS").suspend();
106  }
107 
108  void cxios_get_axis_size(axis_Ptr axis_hdl, int* size)
109  {
110    *size = axis_hdl->size.getInheritedValue();
111  }
112 
113  bool cxios_is_defined_axis_size(axis_Ptr axis_hdl )
114  {
115     CTimer::get("XIOS").resume();
116    return axis_hdl->size.hasInheritedValue();
117     CTimer::get("XIOS").suspend();
118  }
119 
120 
121 
122  void cxios_set_axis_standard_name(axis_Ptr axis_hdl, const char * standard_name, int standard_name_size)
123  {
124    std::string standard_name_str;
125    if(!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
126     CTimer::get("XIOS").resume();
127    axis_hdl->standard_name.setValue(standard_name_str);
128    axis_hdl->sendAttributToServer(axis_hdl->standard_name);
129     CTimer::get("XIOS").suspend();
130  }
131 
132  void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)
133  {
134     CTimer::get("XIOS").resume();
135    if(!string_copy(axis_hdl->standard_name.getInheritedValue(),standard_name , standard_name_size))
136      ERROR("void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)", <<"Input string is to short");
137     CTimer::get("XIOS").suspend();
138  }
139 
140  bool cxios_is_defined_axis_standard_name(axis_Ptr axis_hdl )
141  {
142     CTimer::get("XIOS").resume();
143    return axis_hdl->standard_name.hasInheritedValue();
144     CTimer::get("XIOS").suspend();
145  }
146 
147 
148 
149  void cxios_set_axis_unit(axis_Ptr axis_hdl, const char * unit, int unit_size)
150  {
151    std::string unit_str;
152    if(!cstr2string(unit, unit_size, unit_str)) return;
153     CTimer::get("XIOS").resume();
154    axis_hdl->unit.setValue(unit_str);
155    axis_hdl->sendAttributToServer(axis_hdl->unit);
156     CTimer::get("XIOS").suspend();
157  }
158 
159  void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)
160  {
161     CTimer::get("XIOS").resume();
162    if(!string_copy(axis_hdl->unit.getInheritedValue(),unit , unit_size))
163      ERROR("void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)", <<"Input string is to short");
164     CTimer::get("XIOS").suspend();
165  }
166 
167  bool cxios_is_defined_axis_unit(axis_Ptr axis_hdl )
168  {
169     CTimer::get("XIOS").resume();
170    return axis_hdl->unit.hasInheritedValue();
171     CTimer::get("XIOS").suspend();
172  }
173 
174 
175 
176  void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int extent1)
177  {
178    CTimer::get("XIOS").resume();
179    CArray<double,1> tmp(value,shape(extent1),neverDeleteData) ;
180    axis_hdl->value.reference(tmp.copy());
181    axis_hdl->sendAttributToServer(axis_hdl->value);
182     CTimer::get("XIOS").suspend();
183  }
184 
185  void cxios_get_axis_value(axis_Ptr axis_hdl, double* value, int extent1)
186  {
187    CTimer::get("XIOS").resume();
188    CArray<double,1> tmp(value,shape(extent1),neverDeleteData) ;
189    tmp=axis_hdl->value.getInheritedValue() ;
190     CTimer::get("XIOS").suspend();
191  }
192 
193  bool cxios_is_defined_axis_value(axis_Ptr axis_hdl )
194  {
195     CTimer::get("XIOS").resume();
196    return axis_hdl->value.hasInheritedValue();
197     CTimer::get("XIOS").suspend();
198  }
199 
200 
201 
202  void cxios_set_axis_zoom_begin(axis_Ptr axis_hdl, int zoom_begin)
203  {
204     CTimer::get("XIOS").resume();
205    axis_hdl->zoom_begin.setValue(zoom_begin);
206    axis_hdl->sendAttributToServer(axis_hdl->zoom_begin);
207     CTimer::get("XIOS").suspend();
208  }
209 
210  void cxios_get_axis_zoom_begin(axis_Ptr axis_hdl, int* zoom_begin)
211  {
212    *zoom_begin = axis_hdl->zoom_begin.getInheritedValue();
213  }
214 
215  bool cxios_is_defined_axis_zoom_begin(axis_Ptr axis_hdl )
216  {
217     CTimer::get("XIOS").resume();
218    return axis_hdl->zoom_begin.hasInheritedValue();
219     CTimer::get("XIOS").suspend();
220  }
221 
222 
223 
224  void cxios_set_axis_zoom_end(axis_Ptr axis_hdl, int zoom_end)
225  {
226     CTimer::get("XIOS").resume();
227    axis_hdl->zoom_end.setValue(zoom_end);
228    axis_hdl->sendAttributToServer(axis_hdl->zoom_end);
229     CTimer::get("XIOS").suspend();
230  }
231 
232  void cxios_get_axis_zoom_end(axis_Ptr axis_hdl, int* zoom_end)
233  {
234    *zoom_end = axis_hdl->zoom_end.getInheritedValue();
235  }
236 
237  bool cxios_is_defined_axis_zoom_end(axis_Ptr axis_hdl )
238  {
239     CTimer::get("XIOS").resume();
240    return axis_hdl->zoom_end.hasInheritedValue();
241     CTimer::get("XIOS").suspend();
242  }
243 
244 
245 
246  void cxios_set_axis_zoom_size(axis_Ptr axis_hdl, int zoom_size)
247  {
248     CTimer::get("XIOS").resume();
249    axis_hdl->zoom_size.setValue(zoom_size);
250    axis_hdl->sendAttributToServer(axis_hdl->zoom_size);
251     CTimer::get("XIOS").suspend();
252  }
253 
254  void cxios_get_axis_zoom_size(axis_Ptr axis_hdl, int* zoom_size)
255  {
256    *zoom_size = axis_hdl->zoom_size.getInheritedValue();
257  }
258 
259  bool cxios_is_defined_axis_zoom_size(axis_Ptr axis_hdl )
260  {
261     CTimer::get("XIOS").resume();
262    return axis_hdl->zoom_size.hasInheritedValue();
263     CTimer::get("XIOS").suspend();
264  }
265 
266 
267 
268 
269}
Note: See TracBrowser for help on using the repository browser.