source: XIOS/trunk/src/interface/c_attr/icvariablegroup_attr.cpp @ 527

Last change on this file since 527 was 527, checked in by rlacroix, 7 years ago

Make the variable typing stricter.

The type must now be one of:

  • bool
  • int or int32
  • int16
  • int64
  • float
  • double
  • string

WARNING: The variable type was previously not checked and using an unsupported type did not lead to any error message. Be aware that this change can make your existing configuration files invalid. However the adjustments required to adapt existing files should be minor.

  • 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: 3.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 "node_type.hpp"
14
15extern "C"
16{
17  typedef xios::CVariableGroup*  variablegroup_Ptr;
18 
19  void cxios_set_variablegroup_group_ref(variablegroup_Ptr variablegroup_hdl, const char * group_ref, int group_ref_size)
20  {
21    std::string group_ref_str;
22    if(!cstr2string(group_ref, group_ref_size, group_ref_str)) return;
23     CTimer::get("XIOS").resume();
24    variablegroup_hdl->group_ref.setValue(group_ref_str);
25     CTimer::get("XIOS").suspend();
26  }
27 
28  void cxios_get_variablegroup_group_ref(variablegroup_Ptr variablegroup_hdl, char * group_ref, int group_ref_size)
29  {
30     CTimer::get("XIOS").resume();
31    if(!string_copy(variablegroup_hdl->group_ref.getInheritedValue(),group_ref , group_ref_size))
32      ERROR("void cxios_get_variablegroup_group_ref(variablegroup_Ptr variablegroup_hdl, char * group_ref, int group_ref_size)", <<"Input string is to short");
33     CTimer::get("XIOS").suspend();
34  }
35 
36  bool cxios_is_defined_variablegroup_group_ref(variablegroup_Ptr variablegroup_hdl )
37  {
38     CTimer::get("XIOS").resume();
39    return variablegroup_hdl->group_ref.hasInheritedValue();
40     CTimer::get("XIOS").suspend();
41  }
42 
43 
44 
45  void cxios_set_variablegroup_name(variablegroup_Ptr variablegroup_hdl, const char * name, int name_size)
46  {
47    std::string name_str;
48    if(!cstr2string(name, name_size, name_str)) return;
49     CTimer::get("XIOS").resume();
50    variablegroup_hdl->name.setValue(name_str);
51     CTimer::get("XIOS").suspend();
52  }
53 
54  void cxios_get_variablegroup_name(variablegroup_Ptr variablegroup_hdl, char * name, int name_size)
55  {
56     CTimer::get("XIOS").resume();
57    if(!string_copy(variablegroup_hdl->name.getInheritedValue(),name , name_size))
58      ERROR("void cxios_get_variablegroup_name(variablegroup_Ptr variablegroup_hdl, char * name, int name_size)", <<"Input string is to short");
59     CTimer::get("XIOS").suspend();
60  }
61 
62  bool cxios_is_defined_variablegroup_name(variablegroup_Ptr variablegroup_hdl )
63  {
64     CTimer::get("XIOS").resume();
65    return variablegroup_hdl->name.hasInheritedValue();
66     CTimer::get("XIOS").suspend();
67  }
68 
69 
70 
71  void cxios_set_variablegroup_type(variablegroup_Ptr variablegroup_hdl, const char * type, int type_size)
72  {
73    std::string type_str;
74    if(!cstr2string(type, type_size, type_str)) return;
75     CTimer::get("XIOS").resume();
76    variablegroup_hdl->type.fromString(type_str);
77     CTimer::get("XIOS").suspend();
78  }
79 
80  void cxios_get_variablegroup_type(variablegroup_Ptr variablegroup_hdl, char * type, int type_size)
81  {
82     CTimer::get("XIOS").resume();
83    if(!string_copy(variablegroup_hdl->type.getInheritedStringValue(),type , type_size))
84      ERROR("void cxios_get_variablegroup_type(variablegroup_Ptr variablegroup_hdl, char * type, int type_size)", <<"Input string is to short");
85     CTimer::get("XIOS").suspend();
86  }
87 
88  bool cxios_is_defined_variablegroup_type(variablegroup_Ptr variablegroup_hdl )
89  {
90     CTimer::get("XIOS").resume();
91    return variablegroup_hdl->type.hasInheritedValue();
92     CTimer::get("XIOS").suspend();
93  }
94 
95 
96 
97 
98}
Note: See TracBrowser for help on using the repository browser.