source: XIOS/trunk/src/interface/c_attr/icfile_attr.cpp @ 581

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

Fix the Fortran interface generation to avoid generating dead code that caused a timer not to be stopped.

  • 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: 13.3 KB
RevLine 
[325]1/* ************************************************************************** *
[581]2 *               Interface auto generated - do not modify                     *
[325]3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6#include <boost/shared_ptr.hpp>
7#include "xmlioserver.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::CFile* file_Ptr;
19
[528]20  void cxios_set_file_append(file_Ptr file_hdl, bool append)
21  {
[581]22    CTimer::get("XIOS").resume();
[528]23    file_hdl->append.setValue(append);
[581]24    CTimer::get("XIOS").suspend();
[528]25  }
[581]26
[528]27  void cxios_get_file_append(file_Ptr file_hdl, bool* append)
28  {
[581]29    CTimer::get("XIOS").resume();
[528]30    *append = file_hdl->append.getInheritedValue();
[581]31    CTimer::get("XIOS").suspend();
[528]32  }
[581]33
34  bool cxios_is_defined_file_append(file_Ptr file_hdl)
[528]35  {
36     CTimer::get("XIOS").resume();
[581]37     bool isDefined = file_hdl->append.hasInheritedValue();
[528]38     CTimer::get("XIOS").suspend();
[581]39     return isDefined;
[528]40  }
[581]41
42
[325]43  void cxios_set_file_description(file_Ptr file_hdl, const char * description, int description_size)
44  {
45    std::string description_str;
[581]46    if (!cstr2string(description, description_size, description_str)) return;
47    CTimer::get("XIOS").resume();
[325]48    file_hdl->description.setValue(description_str);
[581]49    CTimer::get("XIOS").suspend();
[325]50  }
[581]51
[325]52  void cxios_get_file_description(file_Ptr file_hdl, char * description, int description_size)
53  {
[581]54    CTimer::get("XIOS").resume();
55    if (!string_copy(file_hdl->description.getInheritedValue(), description, description_size))
56      ERROR("void cxios_get_file_description(file_Ptr file_hdl, char * description, int description_size)", << "Input string is too short");
57    CTimer::get("XIOS").suspend();
[325]58  }
[581]59
60  bool cxios_is_defined_file_description(file_Ptr file_hdl)
[432]61  {
62     CTimer::get("XIOS").resume();
[581]63     bool isDefined = file_hdl->description.hasInheritedValue();
[432]64     CTimer::get("XIOS").suspend();
[581]65     return isDefined;
[432]66  }
[581]67
68
[325]69  void cxios_set_file_enabled(file_Ptr file_hdl, bool enabled)
70  {
[581]71    CTimer::get("XIOS").resume();
[325]72    file_hdl->enabled.setValue(enabled);
[581]73    CTimer::get("XIOS").suspend();
[325]74  }
[581]75
[325]76  void cxios_get_file_enabled(file_Ptr file_hdl, bool* enabled)
77  {
[581]78    CTimer::get("XIOS").resume();
[445]79    *enabled = file_hdl->enabled.getInheritedValue();
[581]80    CTimer::get("XIOS").suspend();
[325]81  }
[581]82
83  bool cxios_is_defined_file_enabled(file_Ptr file_hdl)
[432]84  {
85     CTimer::get("XIOS").resume();
[581]86     bool isDefined = file_hdl->enabled.hasInheritedValue();
[432]87     CTimer::get("XIOS").suspend();
[581]88     return isDefined;
[432]89  }
[581]90
91
[517]92  void cxios_set_file_format(file_Ptr file_hdl, const char * format, int format_size)
93  {
94    std::string format_str;
[581]95    if (!cstr2string(format, format_size, format_str)) return;
96    CTimer::get("XIOS").resume();
[517]97    file_hdl->format.fromString(format_str);
[581]98    CTimer::get("XIOS").suspend();
[517]99  }
[581]100
[517]101  void cxios_get_file_format(file_Ptr file_hdl, char * format, int format_size)
102  {
[581]103    CTimer::get("XIOS").resume();
104    if (!string_copy(file_hdl->format.getInheritedStringValue(), format, format_size))
105      ERROR("void cxios_get_file_format(file_Ptr file_hdl, char * format, int format_size)", << "Input string is too short");
106    CTimer::get("XIOS").suspend();
[517]107  }
[581]108
109  bool cxios_is_defined_file_format(file_Ptr file_hdl)
[517]110  {
111     CTimer::get("XIOS").resume();
[581]112     bool isDefined = file_hdl->format.hasInheritedValue();
[517]113     CTimer::get("XIOS").suspend();
[581]114     return isDefined;
[517]115  }
[581]116
117
[415]118  void cxios_set_file_min_digits(file_Ptr file_hdl, int min_digits)
119  {
[581]120    CTimer::get("XIOS").resume();
[415]121    file_hdl->min_digits.setValue(min_digits);
[581]122    CTimer::get("XIOS").suspend();
[415]123  }
[581]124
[415]125  void cxios_get_file_min_digits(file_Ptr file_hdl, int* min_digits)
126  {
[581]127    CTimer::get("XIOS").resume();
[445]128    *min_digits = file_hdl->min_digits.getInheritedValue();
[581]129    CTimer::get("XIOS").suspend();
[415]130  }
[581]131
132  bool cxios_is_defined_file_min_digits(file_Ptr file_hdl)
[432]133  {
134     CTimer::get("XIOS").resume();
[581]135     bool isDefined = file_hdl->min_digits.hasInheritedValue();
[432]136     CTimer::get("XIOS").suspend();
[581]137     return isDefined;
[432]138  }
[581]139
140
[325]141  void cxios_set_file_name(file_Ptr file_hdl, const char * name, int name_size)
142  {
143    std::string name_str;
[581]144    if (!cstr2string(name, name_size, name_str)) return;
145    CTimer::get("XIOS").resume();
[325]146    file_hdl->name.setValue(name_str);
[581]147    CTimer::get("XIOS").suspend();
[325]148  }
[581]149
[325]150  void cxios_get_file_name(file_Ptr file_hdl, char * name, int name_size)
151  {
[581]152    CTimer::get("XIOS").resume();
153    if (!string_copy(file_hdl->name.getInheritedValue(), name, name_size))
154      ERROR("void cxios_get_file_name(file_Ptr file_hdl, char * name, int name_size)", << "Input string is too short");
155    CTimer::get("XIOS").suspend();
[325]156  }
[581]157
158  bool cxios_is_defined_file_name(file_Ptr file_hdl)
[432]159  {
160     CTimer::get("XIOS").resume();
[581]161     bool isDefined = file_hdl->name.hasInheritedValue();
[432]162     CTimer::get("XIOS").suspend();
[581]163     return isDefined;
[432]164  }
[581]165
166
[325]167  void cxios_set_file_name_suffix(file_Ptr file_hdl, const char * name_suffix, int name_suffix_size)
168  {
169    std::string name_suffix_str;
[581]170    if (!cstr2string(name_suffix, name_suffix_size, name_suffix_str)) return;
171    CTimer::get("XIOS").resume();
[325]172    file_hdl->name_suffix.setValue(name_suffix_str);
[581]173    CTimer::get("XIOS").suspend();
[325]174  }
[581]175
[325]176  void cxios_get_file_name_suffix(file_Ptr file_hdl, char * name_suffix, int name_suffix_size)
177  {
[581]178    CTimer::get("XIOS").resume();
179    if (!string_copy(file_hdl->name_suffix.getInheritedValue(), name_suffix, name_suffix_size))
180      ERROR("void cxios_get_file_name_suffix(file_Ptr file_hdl, char * name_suffix, int name_suffix_size)", << "Input string is too short");
181    CTimer::get("XIOS").suspend();
[325]182  }
[581]183
184  bool cxios_is_defined_file_name_suffix(file_Ptr file_hdl)
[432]185  {
186     CTimer::get("XIOS").resume();
[581]187     bool isDefined = file_hdl->name_suffix.hasInheritedValue();
[432]188     CTimer::get("XIOS").suspend();
[581]189     return isDefined;
[432]190  }
[581]191
192
[538]193  void cxios_set_file_output_freq(file_Ptr file_hdl, cxios_duration output_freq_c)
[325]194  {
[538]195    CTimer::get("XIOS").resume();
196    file_hdl->output_freq.allocate();
197    CDuration& output_freq = file_hdl->output_freq.get();
198    output_freq.year = output_freq_c.year;
199    output_freq.month = output_freq_c.month;
200    output_freq.day = output_freq_c.day;
201    output_freq.hour = output_freq_c.hour;
202    output_freq.minute = output_freq_c.minute;
203    output_freq.second = output_freq_c.second;
204    output_freq.timestep = output_freq_c.timestep;
205    CTimer::get("XIOS").suspend();
[325]206  }
[581]207
[538]208  void cxios_get_file_output_freq(file_Ptr file_hdl, cxios_duration* output_freq_c)
[325]209  {
[538]210    CTimer::get("XIOS").resume();
211    CDuration output_freq = file_hdl->output_freq.getInheritedValue();
212    output_freq_c->year = output_freq.year;
213    output_freq_c->month = output_freq.month;
214    output_freq_c->day = output_freq.day;
215    output_freq_c->hour = output_freq.hour;
216    output_freq_c->minute = output_freq.minute;
217    output_freq_c->second = output_freq.second;
218    output_freq_c->timestep = output_freq.timestep;
219    CTimer::get("XIOS").suspend();
[325]220  }
[581]221
222  bool cxios_is_defined_file_output_freq(file_Ptr file_hdl)
[432]223  {
224     CTimer::get("XIOS").resume();
[581]225     bool isDefined = file_hdl->output_freq.hasInheritedValue();
[432]226     CTimer::get("XIOS").suspend();
[581]227     return isDefined;
[432]228  }
[581]229
230
[325]231  void cxios_set_file_output_level(file_Ptr file_hdl, int output_level)
232  {
[581]233    CTimer::get("XIOS").resume();
[325]234    file_hdl->output_level.setValue(output_level);
[581]235    CTimer::get("XIOS").suspend();
[325]236  }
[581]237
[325]238  void cxios_get_file_output_level(file_Ptr file_hdl, int* output_level)
239  {
[581]240    CTimer::get("XIOS").resume();
[445]241    *output_level = file_hdl->output_level.getInheritedValue();
[581]242    CTimer::get("XIOS").suspend();
[325]243  }
[581]244
245  bool cxios_is_defined_file_output_level(file_Ptr file_hdl)
[432]246  {
247     CTimer::get("XIOS").resume();
[581]248     bool isDefined = file_hdl->output_level.hasInheritedValue();
[432]249     CTimer::get("XIOS").suspend();
[581]250     return isDefined;
[432]251  }
[581]252
253
[336]254  void cxios_set_file_par_access(file_Ptr file_hdl, const char * par_access, int par_access_size)
255  {
256    std::string par_access_str;
[581]257    if (!cstr2string(par_access, par_access_size, par_access_str)) return;
258    CTimer::get("XIOS").resume();
[526]259    file_hdl->par_access.fromString(par_access_str);
[581]260    CTimer::get("XIOS").suspend();
[336]261  }
[581]262
[336]263  void cxios_get_file_par_access(file_Ptr file_hdl, char * par_access, int par_access_size)
264  {
[581]265    CTimer::get("XIOS").resume();
266    if (!string_copy(file_hdl->par_access.getInheritedStringValue(), par_access, par_access_size))
267      ERROR("void cxios_get_file_par_access(file_Ptr file_hdl, char * par_access, int par_access_size)", << "Input string is too short");
268    CTimer::get("XIOS").suspend();
[336]269  }
[581]270
271  bool cxios_is_defined_file_par_access(file_Ptr file_hdl)
[432]272  {
273     CTimer::get("XIOS").resume();
[581]274     bool isDefined = file_hdl->par_access.hasInheritedValue();
[432]275     CTimer::get("XIOS").suspend();
[581]276     return isDefined;
[432]277  }
[581]278
279
[538]280  void cxios_set_file_split_freq(file_Ptr file_hdl, cxios_duration split_freq_c)
[325]281  {
[538]282    CTimer::get("XIOS").resume();
283    file_hdl->split_freq.allocate();
284    CDuration& split_freq = file_hdl->split_freq.get();
285    split_freq.year = split_freq_c.year;
286    split_freq.month = split_freq_c.month;
287    split_freq.day = split_freq_c.day;
288    split_freq.hour = split_freq_c.hour;
289    split_freq.minute = split_freq_c.minute;
290    split_freq.second = split_freq_c.second;
291    split_freq.timestep = split_freq_c.timestep;
292    CTimer::get("XIOS").suspend();
[325]293  }
[581]294
[538]295  void cxios_get_file_split_freq(file_Ptr file_hdl, cxios_duration* split_freq_c)
[325]296  {
[538]297    CTimer::get("XIOS").resume();
298    CDuration split_freq = file_hdl->split_freq.getInheritedValue();
299    split_freq_c->year = split_freq.year;
300    split_freq_c->month = split_freq.month;
301    split_freq_c->day = split_freq.day;
302    split_freq_c->hour = split_freq.hour;
303    split_freq_c->minute = split_freq.minute;
304    split_freq_c->second = split_freq.second;
305    split_freq_c->timestep = split_freq.timestep;
306    CTimer::get("XIOS").suspend();
[325]307  }
[581]308
309  bool cxios_is_defined_file_split_freq(file_Ptr file_hdl)
[432]310  {
311     CTimer::get("XIOS").resume();
[581]312     bool isDefined = file_hdl->split_freq.hasInheritedValue();
[432]313     CTimer::get("XIOS").suspend();
[581]314     return isDefined;
[432]315  }
[581]316
317
[432]318  void cxios_set_file_split_freq_format(file_Ptr file_hdl, const char * split_freq_format, int split_freq_format_size)
319  {
320    std::string split_freq_format_str;
[581]321    if (!cstr2string(split_freq_format, split_freq_format_size, split_freq_format_str)) return;
322    CTimer::get("XIOS").resume();
[432]323    file_hdl->split_freq_format.setValue(split_freq_format_str);
[581]324    CTimer::get("XIOS").suspend();
[432]325  }
[581]326
[432]327  void cxios_get_file_split_freq_format(file_Ptr file_hdl, char * split_freq_format, int split_freq_format_size)
328  {
[581]329    CTimer::get("XIOS").resume();
330    if (!string_copy(file_hdl->split_freq_format.getInheritedValue(), split_freq_format, split_freq_format_size))
331      ERROR("void cxios_get_file_split_freq_format(file_Ptr file_hdl, char * split_freq_format, int split_freq_format_size)", << "Input string is too short");
332    CTimer::get("XIOS").suspend();
[432]333  }
[581]334
335  bool cxios_is_defined_file_split_freq_format(file_Ptr file_hdl)
[432]336  {
337     CTimer::get("XIOS").resume();
[581]338     bool isDefined = file_hdl->split_freq_format.hasInheritedValue();
[432]339     CTimer::get("XIOS").suspend();
[581]340     return isDefined;
[432]341  }
[581]342
343
[538]344  void cxios_set_file_sync_freq(file_Ptr file_hdl, cxios_duration sync_freq_c)
[325]345  {
[538]346    CTimer::get("XIOS").resume();
347    file_hdl->sync_freq.allocate();
348    CDuration& sync_freq = file_hdl->sync_freq.get();
349    sync_freq.year = sync_freq_c.year;
350    sync_freq.month = sync_freq_c.month;
351    sync_freq.day = sync_freq_c.day;
352    sync_freq.hour = sync_freq_c.hour;
353    sync_freq.minute = sync_freq_c.minute;
354    sync_freq.second = sync_freq_c.second;
355    sync_freq.timestep = sync_freq_c.timestep;
356    CTimer::get("XIOS").suspend();
[325]357  }
[581]358
[538]359  void cxios_get_file_sync_freq(file_Ptr file_hdl, cxios_duration* sync_freq_c)
[325]360  {
[538]361    CTimer::get("XIOS").resume();
362    CDuration sync_freq = file_hdl->sync_freq.getInheritedValue();
363    sync_freq_c->year = sync_freq.year;
364    sync_freq_c->month = sync_freq.month;
365    sync_freq_c->day = sync_freq.day;
366    sync_freq_c->hour = sync_freq.hour;
367    sync_freq_c->minute = sync_freq.minute;
368    sync_freq_c->second = sync_freq.second;
369    sync_freq_c->timestep = sync_freq.timestep;
370    CTimer::get("XIOS").suspend();
[325]371  }
[581]372
373  bool cxios_is_defined_file_sync_freq(file_Ptr file_hdl)
[432]374  {
375     CTimer::get("XIOS").resume();
[581]376     bool isDefined = file_hdl->sync_freq.hasInheritedValue();
[432]377     CTimer::get("XIOS").suspend();
[581]378     return isDefined;
[432]379  }
[581]380
381
[325]382  void cxios_set_file_type(file_Ptr file_hdl, const char * type, int type_size)
383  {
384    std::string type_str;
[581]385    if (!cstr2string(type, type_size, type_str)) return;
386    CTimer::get("XIOS").resume();
[369]387    file_hdl->type.fromString(type_str);
[581]388    CTimer::get("XIOS").suspend();
[325]389  }
[581]390
[325]391  void cxios_get_file_type(file_Ptr file_hdl, char * type, int type_size)
392  {
[581]393    CTimer::get("XIOS").resume();
394    if (!string_copy(file_hdl->type.getInheritedStringValue(), type, type_size))
395      ERROR("void cxios_get_file_type(file_Ptr file_hdl, char * type, int type_size)", << "Input string is too short");
396    CTimer::get("XIOS").suspend();
[325]397  }
[581]398
399  bool cxios_is_defined_file_type(file_Ptr file_hdl)
[432]400  {
401     CTimer::get("XIOS").resume();
[581]402     bool isDefined = file_hdl->type.hasInheritedValue();
[432]403     CTimer::get("XIOS").suspend();
[581]404     return isDefined;
[432]405  }
[325]406}
Note: See TracBrowser for help on using the repository browser.