source: XIOS/trunk/src/interface/c_attr/iccalendar_wrapper_attr.cpp @ 674

Last change on this file since 674 was 674, checked in by rlacroix, 9 years ago

Fix Fortran interface generation to avoid generating long lines.

Long lines can cause compilation issues with some compilers.

File size: 10.1 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 "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::CCalendarWrapper* calendar_wrapper_Ptr;
19
20  void cxios_set_calendar_wrapper_day_length(calendar_wrapper_Ptr calendar_wrapper_hdl, int day_length)
21  {
22    CTimer::get("XIOS").resume();
23    calendar_wrapper_hdl->day_length.setValue(day_length);
24    CTimer::get("XIOS").suspend();
25  }
26
27  void cxios_get_calendar_wrapper_day_length(calendar_wrapper_Ptr calendar_wrapper_hdl, int* day_length)
28  {
29    CTimer::get("XIOS").resume();
30    *day_length = calendar_wrapper_hdl->day_length.getInheritedValue();
31    CTimer::get("XIOS").suspend();
32  }
33
34  bool cxios_is_defined_calendar_wrapper_day_length(calendar_wrapper_Ptr calendar_wrapper_hdl)
35  {
36     CTimer::get("XIOS").resume();
37     bool isDefined = calendar_wrapper_hdl->day_length.hasInheritedValue();
38     CTimer::get("XIOS").suspend();
39     return isDefined;
40  }
41
42
43  void cxios_set_calendar_wrapper_leap_year_drift(calendar_wrapper_Ptr calendar_wrapper_hdl, double leap_year_drift)
44  {
45    CTimer::get("XIOS").resume();
46    calendar_wrapper_hdl->leap_year_drift.setValue(leap_year_drift);
47    CTimer::get("XIOS").suspend();
48  }
49
50  void cxios_get_calendar_wrapper_leap_year_drift(calendar_wrapper_Ptr calendar_wrapper_hdl, double* leap_year_drift)
51  {
52    CTimer::get("XIOS").resume();
53    *leap_year_drift = calendar_wrapper_hdl->leap_year_drift.getInheritedValue();
54    CTimer::get("XIOS").suspend();
55  }
56
57  bool cxios_is_defined_calendar_wrapper_leap_year_drift(calendar_wrapper_Ptr calendar_wrapper_hdl)
58  {
59     CTimer::get("XIOS").resume();
60     bool isDefined = calendar_wrapper_hdl->leap_year_drift.hasInheritedValue();
61     CTimer::get("XIOS").suspend();
62     return isDefined;
63  }
64
65
66  void cxios_set_calendar_wrapper_leap_year_drift_offset(calendar_wrapper_Ptr calendar_wrapper_hdl, double leap_year_drift_offset)
67  {
68    CTimer::get("XIOS").resume();
69    calendar_wrapper_hdl->leap_year_drift_offset.setValue(leap_year_drift_offset);
70    CTimer::get("XIOS").suspend();
71  }
72
73  void cxios_get_calendar_wrapper_leap_year_drift_offset(calendar_wrapper_Ptr calendar_wrapper_hdl, double* leap_year_drift_offset)
74  {
75    CTimer::get("XIOS").resume();
76    *leap_year_drift_offset = calendar_wrapper_hdl->leap_year_drift_offset.getInheritedValue();
77    CTimer::get("XIOS").suspend();
78  }
79
80  bool cxios_is_defined_calendar_wrapper_leap_year_drift_offset(calendar_wrapper_Ptr calendar_wrapper_hdl)
81  {
82     CTimer::get("XIOS").resume();
83     bool isDefined = calendar_wrapper_hdl->leap_year_drift_offset.hasInheritedValue();
84     CTimer::get("XIOS").suspend();
85     return isDefined;
86  }
87
88
89  void cxios_set_calendar_wrapper_leap_year_month(calendar_wrapper_Ptr calendar_wrapper_hdl, int leap_year_month)
90  {
91    CTimer::get("XIOS").resume();
92    calendar_wrapper_hdl->leap_year_month.setValue(leap_year_month);
93    CTimer::get("XIOS").suspend();
94  }
95
96  void cxios_get_calendar_wrapper_leap_year_month(calendar_wrapper_Ptr calendar_wrapper_hdl, int* leap_year_month)
97  {
98    CTimer::get("XIOS").resume();
99    *leap_year_month = calendar_wrapper_hdl->leap_year_month.getInheritedValue();
100    CTimer::get("XIOS").suspend();
101  }
102
103  bool cxios_is_defined_calendar_wrapper_leap_year_month(calendar_wrapper_Ptr calendar_wrapper_hdl)
104  {
105     CTimer::get("XIOS").resume();
106     bool isDefined = calendar_wrapper_hdl->leap_year_month.hasInheritedValue();
107     CTimer::get("XIOS").suspend();
108     return isDefined;
109  }
110
111
112  void cxios_set_calendar_wrapper_month_lengths(calendar_wrapper_Ptr calendar_wrapper_hdl, int* month_lengths, int* extent)
113  {
114    CTimer::get("XIOS").resume();
115    CArray<int,1> tmp(month_lengths, shape(extent[0]), neverDeleteData);
116    calendar_wrapper_hdl->month_lengths.reference(tmp.copy());
117     CTimer::get("XIOS").suspend();
118  }
119
120  void cxios_get_calendar_wrapper_month_lengths(calendar_wrapper_Ptr calendar_wrapper_hdl, int* month_lengths, int* extent)
121  {
122    CTimer::get("XIOS").resume();
123    CArray<int,1> tmp(month_lengths, shape(extent[0]), neverDeleteData);
124    tmp=calendar_wrapper_hdl->month_lengths.getInheritedValue();
125     CTimer::get("XIOS").suspend();
126  }
127
128  bool cxios_is_defined_calendar_wrapper_month_lengths(calendar_wrapper_Ptr calendar_wrapper_hdl)
129  {
130     CTimer::get("XIOS").resume();
131     bool isDefined = calendar_wrapper_hdl->month_lengths.hasInheritedValue();
132     CTimer::get("XIOS").suspend();
133     return isDefined;
134  }
135
136
137  void cxios_set_calendar_wrapper_start_date(calendar_wrapper_Ptr calendar_wrapper_hdl, const char * start_date, int start_date_size)
138  {
139    std::string start_date_str;
140    if (!cstr2string(start_date, start_date_size, start_date_str)) return;
141    CTimer::get("XIOS").resume();
142    calendar_wrapper_hdl->start_date.setValue(start_date_str);
143    CTimer::get("XIOS").suspend();
144  }
145
146  void cxios_get_calendar_wrapper_start_date(calendar_wrapper_Ptr calendar_wrapper_hdl, char * start_date, int start_date_size)
147  {
148    CTimer::get("XIOS").resume();
149    if (!string_copy(calendar_wrapper_hdl->start_date.getInheritedValue(), start_date, start_date_size))
150      ERROR("void cxios_get_calendar_wrapper_start_date(calendar_wrapper_Ptr calendar_wrapper_hdl, char * start_date, int start_date_size)", << "Input string is too short");
151    CTimer::get("XIOS").suspend();
152  }
153
154  bool cxios_is_defined_calendar_wrapper_start_date(calendar_wrapper_Ptr calendar_wrapper_hdl)
155  {
156     CTimer::get("XIOS").resume();
157     bool isDefined = calendar_wrapper_hdl->start_date.hasInheritedValue();
158     CTimer::get("XIOS").suspend();
159     return isDefined;
160  }
161
162
163  void cxios_set_calendar_wrapper_time_origin(calendar_wrapper_Ptr calendar_wrapper_hdl, const char * time_origin, int time_origin_size)
164  {
165    std::string time_origin_str;
166    if (!cstr2string(time_origin, time_origin_size, time_origin_str)) return;
167    CTimer::get("XIOS").resume();
168    calendar_wrapper_hdl->time_origin.setValue(time_origin_str);
169    CTimer::get("XIOS").suspend();
170  }
171
172  void cxios_get_calendar_wrapper_time_origin(calendar_wrapper_Ptr calendar_wrapper_hdl, char * time_origin, int time_origin_size)
173  {
174    CTimer::get("XIOS").resume();
175    if (!string_copy(calendar_wrapper_hdl->time_origin.getInheritedValue(), time_origin, time_origin_size))
176      ERROR("void cxios_get_calendar_wrapper_time_origin(calendar_wrapper_Ptr calendar_wrapper_hdl, char * time_origin, int time_origin_size)", << "Input string is too short");
177    CTimer::get("XIOS").suspend();
178  }
179
180  bool cxios_is_defined_calendar_wrapper_time_origin(calendar_wrapper_Ptr calendar_wrapper_hdl)
181  {
182     CTimer::get("XIOS").resume();
183     bool isDefined = calendar_wrapper_hdl->time_origin.hasInheritedValue();
184     CTimer::get("XIOS").suspend();
185     return isDefined;
186  }
187
188
189  void cxios_set_calendar_wrapper_timestep(calendar_wrapper_Ptr calendar_wrapper_hdl, cxios_duration timestep_c)
190  {
191    CTimer::get("XIOS").resume();
192    calendar_wrapper_hdl->timestep.allocate();
193    CDuration& timestep = calendar_wrapper_hdl->timestep.get();
194    timestep.year = timestep_c.year;
195    timestep.month = timestep_c.month;
196    timestep.day = timestep_c.day;
197    timestep.hour = timestep_c.hour;
198    timestep.minute = timestep_c.minute;
199    timestep.second = timestep_c.second;
200    timestep.timestep = timestep_c.timestep;
201    CTimer::get("XIOS").suspend();
202  }
203
204  void cxios_get_calendar_wrapper_timestep(calendar_wrapper_Ptr calendar_wrapper_hdl, cxios_duration* timestep_c)
205  {
206    CTimer::get("XIOS").resume();
207    CDuration timestep = calendar_wrapper_hdl->timestep.getInheritedValue();
208    timestep_c->year = timestep.year;
209    timestep_c->month = timestep.month;
210    timestep_c->day = timestep.day;
211    timestep_c->hour = timestep.hour;
212    timestep_c->minute = timestep.minute;
213    timestep_c->second = timestep.second;
214    timestep_c->timestep = timestep.timestep;
215    CTimer::get("XIOS").suspend();
216  }
217
218  bool cxios_is_defined_calendar_wrapper_timestep(calendar_wrapper_Ptr calendar_wrapper_hdl)
219  {
220     CTimer::get("XIOS").resume();
221     bool isDefined = calendar_wrapper_hdl->timestep.hasInheritedValue();
222     CTimer::get("XIOS").suspend();
223     return isDefined;
224  }
225
226
227  void cxios_set_calendar_wrapper_type(calendar_wrapper_Ptr calendar_wrapper_hdl, const char * type, int type_size)
228  {
229    std::string type_str;
230    if (!cstr2string(type, type_size, type_str)) return;
231    CTimer::get("XIOS").resume();
232    calendar_wrapper_hdl->type.fromString(type_str);
233    CTimer::get("XIOS").suspend();
234  }
235
236  void cxios_get_calendar_wrapper_type(calendar_wrapper_Ptr calendar_wrapper_hdl, char * type, int type_size)
237  {
238    CTimer::get("XIOS").resume();
239    if (!string_copy(calendar_wrapper_hdl->type.getInheritedStringValue(), type, type_size))
240      ERROR("void cxios_get_calendar_wrapper_type(calendar_wrapper_Ptr calendar_wrapper_hdl, char * type, int type_size)", << "Input string is too short");
241    CTimer::get("XIOS").suspend();
242  }
243
244  bool cxios_is_defined_calendar_wrapper_type(calendar_wrapper_Ptr calendar_wrapper_hdl)
245  {
246     CTimer::get("XIOS").resume();
247     bool isDefined = calendar_wrapper_hdl->type.hasInheritedValue();
248     CTimer::get("XIOS").suspend();
249     return isDefined;
250  }
251
252
253  void cxios_set_calendar_wrapper_year_length(calendar_wrapper_Ptr calendar_wrapper_hdl, int year_length)
254  {
255    CTimer::get("XIOS").resume();
256    calendar_wrapper_hdl->year_length.setValue(year_length);
257    CTimer::get("XIOS").suspend();
258  }
259
260  void cxios_get_calendar_wrapper_year_length(calendar_wrapper_Ptr calendar_wrapper_hdl, int* year_length)
261  {
262    CTimer::get("XIOS").resume();
263    *year_length = calendar_wrapper_hdl->year_length.getInheritedValue();
264    CTimer::get("XIOS").suspend();
265  }
266
267  bool cxios_is_defined_calendar_wrapper_year_length(calendar_wrapper_Ptr calendar_wrapper_hdl)
268  {
269     CTimer::get("XIOS").resume();
270     bool isDefined = calendar_wrapper_hdl->year_length.hasInheritedValue();
271     CTimer::get("XIOS").suspend();
272     return isDefined;
273  }
274}
Note: See TracBrowser for help on using the repository browser.