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