source: XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp @ 501

Last change on this file since 501 was 501, checked in by ymipsl, 7 years ago

Add licence copyright to all file ond directory src using the command :
svn propset -R copyright -F header_licence src

XIOS is now officialy under CeCILL licence

YM

  • 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.1 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::CGrid*  grid_Ptr;
18 
19  void cxios_set_grid_axis_ref(grid_Ptr grid_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    grid_hdl->axis_ref.setValue(axis_ref_str);
25    grid_hdl->sendAttributToServer(grid_hdl->axis_ref);
26     CTimer::get("XIOS").suspend();
27  }
28 
29  void cxios_get_grid_axis_ref(grid_Ptr grid_hdl, char * axis_ref, int axis_ref_size)
30  {
31     CTimer::get("XIOS").resume();
32    if(!string_copy(grid_hdl->axis_ref.getInheritedValue(),axis_ref , axis_ref_size))
33      ERROR("void cxios_get_grid_axis_ref(grid_Ptr grid_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_grid_axis_ref(grid_Ptr grid_hdl )
38  {
39     CTimer::get("XIOS").resume();
40    return grid_hdl->axis_ref.hasInheritedValue();
41     CTimer::get("XIOS").suspend();
42  }
43 
44 
45 
46  void cxios_set_grid_description(grid_Ptr grid_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    grid_hdl->description.setValue(description_str);
52    grid_hdl->sendAttributToServer(grid_hdl->description);
53     CTimer::get("XIOS").suspend();
54  }
55 
56  void cxios_get_grid_description(grid_Ptr grid_hdl, char * description, int description_size)
57  {
58     CTimer::get("XIOS").resume();
59    if(!string_copy(grid_hdl->description.getInheritedValue(),description , description_size))
60      ERROR("void cxios_get_grid_description(grid_Ptr grid_hdl, char * description, int description_size)", <<"Input string is to short");
61     CTimer::get("XIOS").suspend();
62  }
63 
64  bool cxios_is_defined_grid_description(grid_Ptr grid_hdl )
65  {
66     CTimer::get("XIOS").resume();
67    return grid_hdl->description.hasInheritedValue();
68     CTimer::get("XIOS").suspend();
69  }
70 
71 
72 
73  void cxios_set_grid_domain_ref(grid_Ptr grid_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    grid_hdl->domain_ref.setValue(domain_ref_str);
79    grid_hdl->sendAttributToServer(grid_hdl->domain_ref);
80     CTimer::get("XIOS").suspend();
81  }
82 
83  void cxios_get_grid_domain_ref(grid_Ptr grid_hdl, char * domain_ref, int domain_ref_size)
84  {
85     CTimer::get("XIOS").resume();
86    if(!string_copy(grid_hdl->domain_ref.getInheritedValue(),domain_ref , domain_ref_size))
87      ERROR("void cxios_get_grid_domain_ref(grid_Ptr grid_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_grid_domain_ref(grid_Ptr grid_hdl )
92  {
93     CTimer::get("XIOS").resume();
94    return grid_hdl->domain_ref.hasInheritedValue();
95     CTimer::get("XIOS").suspend();
96  }
97 
98 
99 
100  void cxios_set_grid_mask(grid_Ptr grid_hdl, bool* mask, int extent1, int extent2, int extent3)
101  {
102    CTimer::get("XIOS").resume();
103    CArray<bool,3> tmp(mask,shape(extent1,extent2,extent3),neverDeleteData) ;
104    grid_hdl->mask.reference(tmp.copy());
105    grid_hdl->sendAttributToServer(grid_hdl->mask);
106     CTimer::get("XIOS").suspend();
107  }
108 
109  void cxios_get_grid_mask(grid_Ptr grid_hdl, bool* mask, int extent1, int extent2, int extent3)
110  {
111    CTimer::get("XIOS").resume();
112    CArray<bool,3> tmp(mask,shape(extent1,extent2,extent3),neverDeleteData) ;
113    tmp=grid_hdl->mask.getInheritedValue() ;
114     CTimer::get("XIOS").suspend();
115  }
116 
117  bool cxios_is_defined_grid_mask(grid_Ptr grid_hdl )
118  {
119     CTimer::get("XIOS").resume();
120    return grid_hdl->mask.hasInheritedValue();
121     CTimer::get("XIOS").suspend();
122  }
123 
124 
125 
126  void cxios_set_grid_name(grid_Ptr grid_hdl, const char * name, int name_size)
127  {
128    std::string name_str;
129    if(!cstr2string(name, name_size, name_str)) return;
130     CTimer::get("XIOS").resume();
131    grid_hdl->name.setValue(name_str);
132    grid_hdl->sendAttributToServer(grid_hdl->name);
133     CTimer::get("XIOS").suspend();
134  }
135 
136  void cxios_get_grid_name(grid_Ptr grid_hdl, char * name, int name_size)
137  {
138     CTimer::get("XIOS").resume();
139    if(!string_copy(grid_hdl->name.getInheritedValue(),name , name_size))
140      ERROR("void cxios_get_grid_name(grid_Ptr grid_hdl, char * name, int name_size)", <<"Input string is to short");
141     CTimer::get("XIOS").suspend();
142  }
143 
144  bool cxios_is_defined_grid_name(grid_Ptr grid_hdl )
145  {
146     CTimer::get("XIOS").resume();
147    return grid_hdl->name.hasInheritedValue();
148     CTimer::get("XIOS").suspend();
149  }
150 
151 
152 
153 
154}
Note: See TracBrowser for help on using the repository browser.