source: XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp @ 445

Last change on this file since 445 was 445, checked in by ymipsl, 11 years ago

Add possibility to make inheritance of attributes and reference before closing the context definition.
New fortran fonction : xios_solve inheritance()
After this call, the value of attribute have the inherited value of their parent.

YM

  • Property svn:eol-style set to native
File size: 6.6 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::CGridGroup*  gridgroup_Ptr;
18 
19  void cxios_set_gridgroup_axis_ref(gridgroup_Ptr gridgroup_hdl, const char * axis_ref, int axis_ref_size)
20  {
21    std::string axis_ref_str;
22    if(!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return;
23     CTimer::get("XIOS").resume();
24    gridgroup_hdl->axis_ref.setValue(axis_ref_str);
25    gridgroup_hdl->sendAttributToServer(gridgroup_hdl->axis_ref);
26     CTimer::get("XIOS").suspend();
27  }
28 
29  void cxios_get_gridgroup_axis_ref(gridgroup_Ptr gridgroup_hdl, char * axis_ref, int axis_ref_size)
30  {
31     CTimer::get("XIOS").resume();
32    if(!string_copy(gridgroup_hdl->axis_ref.getInheritedValue(),axis_ref , axis_ref_size))
33      ERROR("void cxios_get_gridgroup_axis_ref(gridgroup_Ptr gridgroup_hdl, char * axis_ref, int axis_ref_size)", <<"Input string is to short");
34     CTimer::get("XIOS").suspend();
35  }
36 
37  bool cxios_is_defined_gridgroup_axis_ref(gridgroup_Ptr gridgroup_hdl )
38  {
39     CTimer::get("XIOS").resume();
40    return gridgroup_hdl->axis_ref.hasInheritedValue();
41     CTimer::get("XIOS").suspend();
42  }
43 
44 
45 
46  void cxios_set_gridgroup_description(gridgroup_Ptr gridgroup_hdl, const char * description, int description_size)
47  {
48    std::string description_str;
49    if(!cstr2string(description, description_size, description_str)) return;
50     CTimer::get("XIOS").resume();
51    gridgroup_hdl->description.setValue(description_str);
52    gridgroup_hdl->sendAttributToServer(gridgroup_hdl->description);
53     CTimer::get("XIOS").suspend();
54  }
55 
56  void cxios_get_gridgroup_description(gridgroup_Ptr gridgroup_hdl, char * description, int description_size)
57  {
58     CTimer::get("XIOS").resume();
59    if(!string_copy(gridgroup_hdl->description.getInheritedValue(),description , description_size))
60      ERROR("void cxios_get_gridgroup_description(gridgroup_Ptr gridgroup_hdl, char * description, int description_size)", <<"Input string is to short");
61     CTimer::get("XIOS").suspend();
62  }
63 
64  bool cxios_is_defined_gridgroup_description(gridgroup_Ptr gridgroup_hdl )
65  {
66     CTimer::get("XIOS").resume();
67    return gridgroup_hdl->description.hasInheritedValue();
68     CTimer::get("XIOS").suspend();
69  }
70 
71 
72 
73  void cxios_set_gridgroup_domain_ref(gridgroup_Ptr gridgroup_hdl, const char * domain_ref, int domain_ref_size)
74  {
75    std::string domain_ref_str;
76    if(!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return;
77     CTimer::get("XIOS").resume();
78    gridgroup_hdl->domain_ref.setValue(domain_ref_str);
79    gridgroup_hdl->sendAttributToServer(gridgroup_hdl->domain_ref);
80     CTimer::get("XIOS").suspend();
81  }
82 
83  void cxios_get_gridgroup_domain_ref(gridgroup_Ptr gridgroup_hdl, char * domain_ref, int domain_ref_size)
84  {
85     CTimer::get("XIOS").resume();
86    if(!string_copy(gridgroup_hdl->domain_ref.getInheritedValue(),domain_ref , domain_ref_size))
87      ERROR("void cxios_get_gridgroup_domain_ref(gridgroup_Ptr gridgroup_hdl, char * domain_ref, int domain_ref_size)", <<"Input string is to short");
88     CTimer::get("XIOS").suspend();
89  }
90 
91  bool cxios_is_defined_gridgroup_domain_ref(gridgroup_Ptr gridgroup_hdl )
92  {
93     CTimer::get("XIOS").resume();
94    return gridgroup_hdl->domain_ref.hasInheritedValue();
95     CTimer::get("XIOS").suspend();
96  }
97 
98 
99 
100  void cxios_set_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl, const char * group_ref, int group_ref_size)
101  {
102    std::string group_ref_str;
103    if(!cstr2string(group_ref, group_ref_size, group_ref_str)) return;
104     CTimer::get("XIOS").resume();
105    gridgroup_hdl->group_ref.setValue(group_ref_str);
106    gridgroup_hdl->sendAttributToServer(gridgroup_hdl->group_ref);
107     CTimer::get("XIOS").suspend();
108  }
109 
110  void cxios_get_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl, char * group_ref, int group_ref_size)
111  {
112     CTimer::get("XIOS").resume();
113    if(!string_copy(gridgroup_hdl->group_ref.getInheritedValue(),group_ref , group_ref_size))
114      ERROR("void cxios_get_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl, char * group_ref, int group_ref_size)", <<"Input string is to short");
115     CTimer::get("XIOS").suspend();
116  }
117 
118  bool cxios_is_defined_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl )
119  {
120     CTimer::get("XIOS").resume();
121    return gridgroup_hdl->group_ref.hasInheritedValue();
122     CTimer::get("XIOS").suspend();
123  }
124 
125 
126 
127  void cxios_set_gridgroup_mask(gridgroup_Ptr gridgroup_hdl, bool* mask, int extent1, int extent2, int extent3)
128  {
129    CTimer::get("XIOS").resume();
130    CArray<bool,3> tmp(mask,shape(extent1,extent2,extent3),neverDeleteData) ;
131    gridgroup_hdl->mask.reference(tmp.copy());
132    gridgroup_hdl->sendAttributToServer(gridgroup_hdl->mask);
133     CTimer::get("XIOS").suspend();
134  }
135 
136  void cxios_get_gridgroup_mask(gridgroup_Ptr gridgroup_hdl, bool* mask, int extent1, int extent2, int extent3)
137  {
138    CTimer::get("XIOS").resume();
139    CArray<bool,3> tmp(mask,shape(extent1,extent2,extent3),neverDeleteData) ;
140    tmp=gridgroup_hdl->mask.getInheritedValue() ;
141     CTimer::get("XIOS").suspend();
142  }
143 
144  bool cxios_is_defined_gridgroup_mask(gridgroup_Ptr gridgroup_hdl )
145  {
146     CTimer::get("XIOS").resume();
147    return gridgroup_hdl->mask.hasInheritedValue();
148     CTimer::get("XIOS").suspend();
149  }
150 
151 
152 
153  void cxios_set_gridgroup_name(gridgroup_Ptr gridgroup_hdl, const char * name, int name_size)
154  {
155    std::string name_str;
156    if(!cstr2string(name, name_size, name_str)) return;
157     CTimer::get("XIOS").resume();
158    gridgroup_hdl->name.setValue(name_str);
159    gridgroup_hdl->sendAttributToServer(gridgroup_hdl->name);
160     CTimer::get("XIOS").suspend();
161  }
162 
163  void cxios_get_gridgroup_name(gridgroup_Ptr gridgroup_hdl, char * name, int name_size)
164  {
165     CTimer::get("XIOS").resume();
166    if(!string_copy(gridgroup_hdl->name.getInheritedValue(),name , name_size))
167      ERROR("void cxios_get_gridgroup_name(gridgroup_Ptr gridgroup_hdl, char * name, int name_size)", <<"Input string is to short");
168     CTimer::get("XIOS").suspend();
169  }
170 
171  bool cxios_is_defined_gridgroup_name(gridgroup_Ptr gridgroup_hdl )
172  {
173     CTimer::get("XIOS").resume();
174    return gridgroup_hdl->name.hasInheritedValue();
175     CTimer::get("XIOS").suspend();
176  }
177 
178 
179 
180 
181}
Note: See TracBrowser for help on using the repository browser.