New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
icaxis_attr.cpp in vendors/XIOS/current/src/interface/c_attr – NEMO

source: vendors/XIOS/current/src/interface/c_attr/icaxis_attr.cpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

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