source: XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp @ 529

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

Convert some attributes to enumerations:

  • file: par_access
  • context: calendar_type

Those changes should have no effect on existing XML configuration files and ensure that a proper error message is always displayed during parsing if the value is not supported.

  • 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: 5.4 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::CContext*  context_Ptr;
18 
19  void cxios_set_context_calendar_type(context_Ptr context_hdl, const char * calendar_type, int calendar_type_size)
20  {
21    std::string calendar_type_str;
22    if(!cstr2string(calendar_type, calendar_type_size, calendar_type_str)) return;
23     CTimer::get("XIOS").resume();
24    context_hdl->calendar_type.fromString(calendar_type_str);
25     CTimer::get("XIOS").suspend();
26  }
27 
28  void cxios_get_context_calendar_type(context_Ptr context_hdl, char * calendar_type, int calendar_type_size)
29  {
30     CTimer::get("XIOS").resume();
31    if(!string_copy(context_hdl->calendar_type.getInheritedStringValue(),calendar_type , calendar_type_size))
32      ERROR("void cxios_get_context_calendar_type(context_Ptr context_hdl, char * calendar_type, int calendar_type_size)", <<"Input string is to short");
33     CTimer::get("XIOS").suspend();
34  }
35 
36  bool cxios_is_defined_context_calendar_type(context_Ptr context_hdl )
37  {
38     CTimer::get("XIOS").resume();
39    return context_hdl->calendar_type.hasInheritedValue();
40     CTimer::get("XIOS").suspend();
41  }
42 
43 
44 
45  void cxios_set_context_output_dir(context_Ptr context_hdl, const char * output_dir, int output_dir_size)
46  {
47    std::string output_dir_str;
48    if(!cstr2string(output_dir, output_dir_size, output_dir_str)) return;
49     CTimer::get("XIOS").resume();
50    context_hdl->output_dir.setValue(output_dir_str);
51     CTimer::get("XIOS").suspend();
52  }
53 
54  void cxios_get_context_output_dir(context_Ptr context_hdl, char * output_dir, int output_dir_size)
55  {
56     CTimer::get("XIOS").resume();
57    if(!string_copy(context_hdl->output_dir.getInheritedValue(),output_dir , output_dir_size))
58      ERROR("void cxios_get_context_output_dir(context_Ptr context_hdl, char * output_dir, int output_dir_size)", <<"Input string is to short");
59     CTimer::get("XIOS").suspend();
60  }
61 
62  bool cxios_is_defined_context_output_dir(context_Ptr context_hdl )
63  {
64     CTimer::get("XIOS").resume();
65    return context_hdl->output_dir.hasInheritedValue();
66     CTimer::get("XIOS").suspend();
67  }
68 
69 
70 
71  void cxios_set_context_start_date(context_Ptr context_hdl, const char * start_date, int start_date_size)
72  {
73    std::string start_date_str;
74    if(!cstr2string(start_date, start_date_size, start_date_str)) return;
75     CTimer::get("XIOS").resume();
76    context_hdl->start_date.setValue(start_date_str);
77     CTimer::get("XIOS").suspend();
78  }
79 
80  void cxios_get_context_start_date(context_Ptr context_hdl, char * start_date, int start_date_size)
81  {
82     CTimer::get("XIOS").resume();
83    if(!string_copy(context_hdl->start_date.getInheritedValue(),start_date , start_date_size))
84      ERROR("void cxios_get_context_start_date(context_Ptr context_hdl, char * start_date, int start_date_size)", <<"Input string is to short");
85     CTimer::get("XIOS").suspend();
86  }
87 
88  bool cxios_is_defined_context_start_date(context_Ptr context_hdl )
89  {
90     CTimer::get("XIOS").resume();
91    return context_hdl->start_date.hasInheritedValue();
92     CTimer::get("XIOS").suspend();
93  }
94 
95 
96 
97  void cxios_set_context_time_origin(context_Ptr context_hdl, const char * time_origin, int time_origin_size)
98  {
99    std::string time_origin_str;
100    if(!cstr2string(time_origin, time_origin_size, time_origin_str)) return;
101     CTimer::get("XIOS").resume();
102    context_hdl->time_origin.setValue(time_origin_str);
103     CTimer::get("XIOS").suspend();
104  }
105 
106  void cxios_get_context_time_origin(context_Ptr context_hdl, char * time_origin, int time_origin_size)
107  {
108     CTimer::get("XIOS").resume();
109    if(!string_copy(context_hdl->time_origin.getInheritedValue(),time_origin , time_origin_size))
110      ERROR("void cxios_get_context_time_origin(context_Ptr context_hdl, char * time_origin, int time_origin_size)", <<"Input string is to short");
111     CTimer::get("XIOS").suspend();
112  }
113 
114  bool cxios_is_defined_context_time_origin(context_Ptr context_hdl )
115  {
116     CTimer::get("XIOS").resume();
117    return context_hdl->time_origin.hasInheritedValue();
118     CTimer::get("XIOS").suspend();
119  }
120 
121 
122 
123  void cxios_set_context_timestep(context_Ptr context_hdl, const char * timestep, int timestep_size)
124  {
125    std::string timestep_str;
126    if(!cstr2string(timestep, timestep_size, timestep_str)) return;
127     CTimer::get("XIOS").resume();
128    context_hdl->timestep.setValue(timestep_str);
129     CTimer::get("XIOS").suspend();
130  }
131 
132  void cxios_get_context_timestep(context_Ptr context_hdl, char * timestep, int timestep_size)
133  {
134     CTimer::get("XIOS").resume();
135    if(!string_copy(context_hdl->timestep.getInheritedValue(),timestep , timestep_size))
136      ERROR("void cxios_get_context_timestep(context_Ptr context_hdl, char * timestep, int timestep_size)", <<"Input string is to short");
137     CTimer::get("XIOS").suspend();
138  }
139 
140  bool cxios_is_defined_context_timestep(context_Ptr context_hdl )
141  {
142     CTimer::get("XIOS").resume();
143    return context_hdl->timestep.hasInheritedValue();
144     CTimer::get("XIOS").suspend();
145  }
146 
147 
148 
149 
150}
Note: See TracBrowser for help on using the repository browser.