source: XIOS/trunk/src/interface/c_attr/icvariable_attr.cpp @ 472

Last change on this file since 472 was 472, checked in by ymipsl, 8 years ago

Enhancement : user defined global and field attribute can be output in the netcdfcf file.
A variable child element inclosed into a file element will be output as a global file attribute.
A variable child element inclosed into a field element will be output as a field attribute.

+ variable fortran interface added

YM

  • Property svn:eol-style set to native
File size: 2.4 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::CVariable*  variable_Ptr;
18 
19  void cxios_set_variable_name(variable_Ptr variable_hdl, const char * name, int name_size)
20  {
21    std::string name_str;
22    if(!cstr2string(name, name_size, name_str)) return;
23     CTimer::get("XIOS").resume();
24    variable_hdl->name.setValue(name_str);
25    variable_hdl->sendAttributToServer(variable_hdl->name);
26     CTimer::get("XIOS").suspend();
27  }
28 
29  void cxios_get_variable_name(variable_Ptr variable_hdl, char * name, int name_size)
30  {
31     CTimer::get("XIOS").resume();
32    if(!string_copy(variable_hdl->name.getInheritedValue(),name , name_size))
33      ERROR("void cxios_get_variable_name(variable_Ptr variable_hdl, char * name, int name_size)", <<"Input string is to short");
34     CTimer::get("XIOS").suspend();
35  }
36 
37  bool cxios_is_defined_variable_name(variable_Ptr variable_hdl )
38  {
39     CTimer::get("XIOS").resume();
40    return variable_hdl->name.hasInheritedValue();
41     CTimer::get("XIOS").suspend();
42  }
43 
44 
45 
46  void cxios_set_variable_type(variable_Ptr variable_hdl, const char * type, int type_size)
47  {
48    std::string type_str;
49    if(!cstr2string(type, type_size, type_str)) return;
50     CTimer::get("XIOS").resume();
51    variable_hdl->type.setValue(type_str);
52    variable_hdl->sendAttributToServer(variable_hdl->type);
53     CTimer::get("XIOS").suspend();
54  }
55 
56  void cxios_get_variable_type(variable_Ptr variable_hdl, char * type, int type_size)
57  {
58     CTimer::get("XIOS").resume();
59    if(!string_copy(variable_hdl->type.getInheritedValue(),type , type_size))
60      ERROR("void cxios_get_variable_type(variable_Ptr variable_hdl, char * type, int type_size)", <<"Input string is to short");
61     CTimer::get("XIOS").suspend();
62  }
63 
64  bool cxios_is_defined_variable_type(variable_Ptr variable_hdl )
65  {
66     CTimer::get("XIOS").resume();
67    return variable_hdl->type.hasInheritedValue();
68     CTimer::get("XIOS").suspend();
69  }
70 
71 
72 
73 
74}
Note: See TracBrowser for help on using the repository browser.