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

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

Add the Fortran interface for the "compression_level" attribute.

It had been forgotten in r606.

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