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

Last change on this file since 352 was 352, checked in by ymipsl, 12 years ago
  • Property svn:eol-style set to native
File size: 4.5 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 "axis.hpp"
14
15extern "C"
16{
17  typedef xios::CAxis*  axis_Ptr;
18 
19  void cxios_set_axis_long_name(axis_Ptr axis_hdl, const char * long_name, int long_name_size)
20  {
21    std::string long_name_str;
22    if(!cstr2string(long_name, long_name_size, long_name_str)) return;
23     CTimer::get("XIOS").resume();
24    axis_hdl->long_name.setValue(long_name_str);
25    axis_hdl->sendAttributToServer(axis_hdl->long_name);
26     CTimer::get("XIOS").suspend();
27  }
28 
29  void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)
30  {
31     CTimer::get("XIOS").resume();
32    if(!string_copy(axis_hdl->long_name.getValue(),long_name , long_name_size))
33      ERROR("void cxios_get_axis_long_name(axis_Ptr axis_hdl, char * long_name, int long_name_size)", <<"Input string is to short");
34     CTimer::get("XIOS").suspend();
35  }
36 
37 
38  void cxios_set_axis_name(axis_Ptr axis_hdl, const char * name, int name_size)
39  {
40    std::string name_str;
41    if(!cstr2string(name, name_size, name_str)) return;
42     CTimer::get("XIOS").resume();
43    axis_hdl->name.setValue(name_str);
44    axis_hdl->sendAttributToServer(axis_hdl->name);
45     CTimer::get("XIOS").suspend();
46  }
47 
48  void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)
49  {
50     CTimer::get("XIOS").resume();
51    if(!string_copy(axis_hdl->name.getValue(),name , name_size))
52      ERROR("void cxios_get_axis_name(axis_Ptr axis_hdl, char * name, int name_size)", <<"Input string is to short");
53     CTimer::get("XIOS").suspend();
54  }
55 
56 
57  void cxios_set_axis_size(axis_Ptr axis_hdl, int size)
58  {
59     CTimer::get("XIOS").resume();
60    axis_hdl->size.setValue(size);
61    axis_hdl->sendAttributToServer(axis_hdl->size);
62     CTimer::get("XIOS").suspend();
63  }
64 
65  void cxios_get_axis_size(axis_Ptr axis_hdl, int* size)
66  {
67    *size = axis_hdl->size.getValue();
68  }
69 
70 
71  void cxios_set_axis_standard_name(axis_Ptr axis_hdl, const char * standard_name, int standard_name_size)
72  {
73    std::string standard_name_str;
74    if(!cstr2string(standard_name, standard_name_size, standard_name_str)) return;
75     CTimer::get("XIOS").resume();
76    axis_hdl->standard_name.setValue(standard_name_str);
77    axis_hdl->sendAttributToServer(axis_hdl->standard_name);
78     CTimer::get("XIOS").suspend();
79  }
80 
81  void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)
82  {
83     CTimer::get("XIOS").resume();
84    if(!string_copy(axis_hdl->standard_name.getValue(),standard_name , standard_name_size))
85      ERROR("void cxios_get_axis_standard_name(axis_Ptr axis_hdl, char * standard_name, int standard_name_size)", <<"Input string is to short");
86     CTimer::get("XIOS").suspend();
87  }
88 
89 
90  void cxios_set_axis_unit(axis_Ptr axis_hdl, const char * unit, int unit_size)
91  {
92    std::string unit_str;
93    if(!cstr2string(unit, unit_size, unit_str)) return;
94     CTimer::get("XIOS").resume();
95    axis_hdl->unit.setValue(unit_str);
96    axis_hdl->sendAttributToServer(axis_hdl->unit);
97     CTimer::get("XIOS").suspend();
98  }
99 
100  void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)
101  {
102     CTimer::get("XIOS").resume();
103    if(!string_copy(axis_hdl->unit.getValue(),unit , unit_size))
104      ERROR("void cxios_get_axis_unit(axis_Ptr axis_hdl, char * unit, int unit_size)", <<"Input string is to short");
105     CTimer::get("XIOS").suspend();
106  }
107 
108 
109  void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int extent1)
110  {
111     CTimer::get("XIOS").resume();
112    ARRAY(double,1) array_tmp(new CArray<double,1>(boost::extents[extent1]));
113    std::copy(value, &(value[array_tmp->num_elements()]), array_tmp->data());
114    axis_hdl->value.setValue(array_tmp);
115    axis_hdl->sendAttributToServer(axis_hdl->value);
116  }
117 
118  void cxios_get_axis_value(axis_Ptr axis_hdl, double* value, int extent1)
119  {
120    if (!array_copy(axis_hdl->value.getValue(), value, extent1))
121     ERROR("void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int extent1)",<<"Output array size is not conform to array size attribute") ;
122     CTimer::get("XIOS").suspend();
123  }
124 
125 
126 
127}
Note: See TracBrowser for help on using the repository browser.