source: XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp @ 325

Last change on this file since 325 was 325, checked in by ymipsl, 12 years ago

port to gfortran/g++

YM

  • Property svn:eol-style set to native
File size: 3.8 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_impl.hpp"
9#include "object_template_impl.hpp"
10#include "group_template_impl.hpp"
11#include "icutil.hpp"
12
13extern "C"
14{
15  typedef xmlioserver::tree::CAxis*  axis_Ptr;
16 
17  void cxios_set_axis_long_name(axis_Ptr axis_hdl, const char * long_name, int long_name_size)
18  {
19    std::string long_name_str;
20    if(!cstr2string(long_name, long_name_size, long_name_str)) return;
21    axis_hdl->long_name.setValue(long_name_str);
22    axis_hdl->sendAttributToServer(axis_hdl->long_name);
23  }
24 
25  void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)
26  {
27    if(!string_copy(axis_hdl->long_name.getValue(),long_name , long_name_size))
28      ERROR("void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)", <<"Input string is to short");
29  }
30 
31 
32  void cxios_set_axis_name(axis_Ptr axis_hdl, const char * name, int name_size)
33  {
34    std::string name_str;
35    if(!cstr2string(name, name_size, name_str)) return;
36    axis_hdl->name.setValue(name_str);
37    axis_hdl->sendAttributToServer(axis_hdl->name);
38  }
39 
40  void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)
41  {
42    if(!string_copy(axis_hdl->name.getValue(),name , name_size))
43      ERROR("void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)", <<"Input string is to short");
44  }
45 
46 
47  void cxios_set_axis_size(axis_Ptr axis_hdl, int size)
48  {
49    axis_hdl->size.setValue(size);
50    axis_hdl->sendAttributToServer(axis_hdl->size);
51  }
52 
53  void cxios_get_axis_size(axis_Ptr axis_hdl, int* size)
54  {
55    *size = axis_hdl->size.getValue();
56  }
57 
58 
59  void cxios_set_axis_standard_name(axis_Ptr axis_hdl, const char * standard_name, int standard_name_size)
60  {
61    std::string standard_name_str;
62    if(!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
63    axis_hdl->standard_name.setValue(standard_name_str);
64    axis_hdl->sendAttributToServer(axis_hdl->standard_name);
65  }
66 
67  void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)
68  {
69    if(!string_copy(axis_hdl->standard_name.getValue(),standard_name , standard_name_size))
70      ERROR("void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)", <<"Input string is to short");
71  }
72 
73 
74  void cxios_set_axis_unit(axis_Ptr axis_hdl, const char * unit, int unit_size)
75  {
76    std::string unit_str;
77    if(!cstr2string(unit, unit_size, unit_str)) return;
78    axis_hdl->unit.setValue(unit_str);
79    axis_hdl->sendAttributToServer(axis_hdl->unit);
80  }
81 
82  void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)
83  {
84    if(!string_copy(axis_hdl->unit.getValue(),unit , unit_size))
85      ERROR("void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)", <<"Input string is to short");
86  }
87 
88 
89  void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int extent1)
90  {
91    ARRAY(double,1) array_tmp(new CArray<double,1>(boost::extents[extent1]));
92    std::copy(value, &(value[array_tmp->num_elements()]), array_tmp->data());
93    axis_hdl->value.setValue(array_tmp);
94    axis_hdl->sendAttributToServer(axis_hdl->value);
95  }
96 
97  void cxios_get_axis_value(axis_Ptr axis_hdl, double* value, int extent1)
98  {
99    if (!array_copy(axis_hdl->value.getValue(), value, extent1))
100     ERROR("void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int extent1)",<<"Output array size is not conform to array size attribute") ;
101  }
102 
103 
104 
105}
Note: See TracBrowser for help on using the repository browser.