source: XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp @ 903

Last change on this file since 903 was 817, checked in by mhnguyen, 8 years ago

Adding some attributes for axis and grid (ticket 71, 78)

+) Add index attribute for axis
+) Change mask?d to mask_?d for grid

Test
+) On Curie
+) Test passes

  • 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: 5.9 KB
RevLine 
[325]1/* ************************************************************************** *
[581]2 *               Interface auto generated - do not modify                     *
[325]3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6#include <boost/shared_ptr.hpp>
[591]7#include "xios.hpp"
[352]8#include "attribute_template.hpp"
9#include "object_template.hpp"
10#include "group_template.hpp"
[325]11#include "icutil.hpp"
[532]12#include "icdate.hpp"
[347]13#include "timer.hpp"
[369]14#include "node_type.hpp"
[325]15
16extern "C"
17{
[581]18  typedef xios::CGridGroup* gridgroup_Ptr;
19
[325]20  void cxios_set_gridgroup_description(gridgroup_Ptr gridgroup_hdl, const char * description, int description_size)
21  {
22    std::string description_str;
[581]23    if (!cstr2string(description, description_size, description_str)) return;
24    CTimer::get("XIOS").resume();
[325]25    gridgroup_hdl->description.setValue(description_str);
[581]26    CTimer::get("XIOS").suspend();
[325]27  }
[581]28
[325]29  void cxios_get_gridgroup_description(gridgroup_Ptr gridgroup_hdl, char * description, int description_size)
30  {
[581]31    CTimer::get("XIOS").resume();
32    if (!string_copy(gridgroup_hdl->description.getInheritedValue(), description, description_size))
33      ERROR("void cxios_get_gridgroup_description(gridgroup_Ptr gridgroup_hdl, char * description, int description_size)", << "Input string is too short");
34    CTimer::get("XIOS").suspend();
[325]35  }
[581]36
37  bool cxios_is_defined_gridgroup_description(gridgroup_Ptr gridgroup_hdl)
[432]38  {
39     CTimer::get("XIOS").resume();
[581]40     bool isDefined = gridgroup_hdl->description.hasInheritedValue();
[432]41     CTimer::get("XIOS").suspend();
[581]42     return isDefined;
[432]43  }
[581]44
45
[325]46  void cxios_set_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl, const char * group_ref, int group_ref_size)
47  {
48    std::string group_ref_str;
[581]49    if (!cstr2string(group_ref, group_ref_size, group_ref_str)) return;
50    CTimer::get("XIOS").resume();
[325]51    gridgroup_hdl->group_ref.setValue(group_ref_str);
[581]52    CTimer::get("XIOS").suspend();
[325]53  }
[581]54
[325]55  void cxios_get_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl, char * group_ref, int group_ref_size)
56  {
[581]57    CTimer::get("XIOS").resume();
58    if (!string_copy(gridgroup_hdl->group_ref.getInheritedValue(), group_ref, group_ref_size))
59      ERROR("void cxios_get_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl, char * group_ref, int group_ref_size)", << "Input string is too short");
60    CTimer::get("XIOS").suspend();
[325]61  }
[581]62
63  bool cxios_is_defined_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl)
[432]64  {
65     CTimer::get("XIOS").resume();
[581]66     bool isDefined = gridgroup_hdl->group_ref.hasInheritedValue();
[432]67     CTimer::get("XIOS").suspend();
[581]68     return isDefined;
[432]69  }
[581]70
71
[817]72  void cxios_set_gridgroup_mask_1d(gridgroup_Ptr gridgroup_hdl, bool* mask_1d, int* extent)
[415]73  {
74    CTimer::get("XIOS").resume();
[817]75    CArray<bool,1> tmp(mask_1d, shape(extent[0]), neverDeleteData);
76    gridgroup_hdl->mask_1d.reference(tmp.copy());
[416]77     CTimer::get("XIOS").suspend();
[415]78  }
[581]79
[817]80  void cxios_get_gridgroup_mask_1d(gridgroup_Ptr gridgroup_hdl, bool* mask_1d, int* extent)
[415]81  {
[416]82    CTimer::get("XIOS").resume();
[817]83    CArray<bool,1> tmp(mask_1d, shape(extent[0]), neverDeleteData);
84    tmp=gridgroup_hdl->mask_1d.getInheritedValue();
[415]85     CTimer::get("XIOS").suspend();
86  }
[581]87
[817]88  bool cxios_is_defined_gridgroup_mask_1d(gridgroup_Ptr gridgroup_hdl)
[432]89  {
90     CTimer::get("XIOS").resume();
[817]91     bool isDefined = gridgroup_hdl->mask_1d.hasInheritedValue();
[432]92     CTimer::get("XIOS").suspend();
[581]93     return isDefined;
[432]94  }
[581]95
96
[817]97  void cxios_set_gridgroup_mask_2d(gridgroup_Ptr gridgroup_hdl, bool* mask_2d, int* extent)
[567]98  {
99    CTimer::get("XIOS").resume();
[817]100    CArray<bool,2> tmp(mask_2d, shape(extent[0], extent[1]), neverDeleteData);
101    gridgroup_hdl->mask_2d.reference(tmp.copy());
[567]102     CTimer::get("XIOS").suspend();
103  }
[581]104
[817]105  void cxios_get_gridgroup_mask_2d(gridgroup_Ptr gridgroup_hdl, bool* mask_2d, int* extent)
[567]106  {
107    CTimer::get("XIOS").resume();
[817]108    CArray<bool,2> tmp(mask_2d, shape(extent[0], extent[1]), neverDeleteData);
109    tmp=gridgroup_hdl->mask_2d.getInheritedValue();
[567]110     CTimer::get("XIOS").suspend();
111  }
[581]112
[817]113  bool cxios_is_defined_gridgroup_mask_2d(gridgroup_Ptr gridgroup_hdl)
[567]114  {
115     CTimer::get("XIOS").resume();
[817]116     bool isDefined = gridgroup_hdl->mask_2d.hasInheritedValue();
[567]117     CTimer::get("XIOS").suspend();
[581]118     return isDefined;
[567]119  }
[581]120
121
[817]122  void cxios_set_gridgroup_mask_3d(gridgroup_Ptr gridgroup_hdl, bool* mask_3d, int* extent)
[567]123  {
124    CTimer::get("XIOS").resume();
[817]125    CArray<bool,3> tmp(mask_3d, shape(extent[0], extent[1], extent[2]), neverDeleteData);
126    gridgroup_hdl->mask_3d.reference(tmp.copy());
[567]127     CTimer::get("XIOS").suspend();
128  }
[581]129
[817]130  void cxios_get_gridgroup_mask_3d(gridgroup_Ptr gridgroup_hdl, bool* mask_3d, int* extent)
[567]131  {
132    CTimer::get("XIOS").resume();
[817]133    CArray<bool,3> tmp(mask_3d, shape(extent[0], extent[1], extent[2]), neverDeleteData);
134    tmp=gridgroup_hdl->mask_3d.getInheritedValue();
[567]135     CTimer::get("XIOS").suspend();
136  }
[581]137
[817]138  bool cxios_is_defined_gridgroup_mask_3d(gridgroup_Ptr gridgroup_hdl)
[567]139  {
140     CTimer::get("XIOS").resume();
[817]141     bool isDefined = gridgroup_hdl->mask_3d.hasInheritedValue();
[567]142     CTimer::get("XIOS").suspend();
[581]143     return isDefined;
[567]144  }
[581]145
146
[325]147  void cxios_set_gridgroup_name(gridgroup_Ptr gridgroup_hdl, const char * name, int name_size)
148  {
149    std::string name_str;
[581]150    if (!cstr2string(name, name_size, name_str)) return;
151    CTimer::get("XIOS").resume();
[325]152    gridgroup_hdl->name.setValue(name_str);
[581]153    CTimer::get("XIOS").suspend();
[325]154  }
[581]155
[325]156  void cxios_get_gridgroup_name(gridgroup_Ptr gridgroup_hdl, char * name, int name_size)
157  {
[581]158    CTimer::get("XIOS").resume();
159    if (!string_copy(gridgroup_hdl->name.getInheritedValue(), name, name_size))
160      ERROR("void cxios_get_gridgroup_name(gridgroup_Ptr gridgroup_hdl, char * name, int name_size)", << "Input string is too short");
161    CTimer::get("XIOS").suspend();
[325]162  }
[581]163
164  bool cxios_is_defined_gridgroup_name(gridgroup_Ptr gridgroup_hdl)
[432]165  {
166     CTimer::get("XIOS").resume();
[581]167     bool isDefined = gridgroup_hdl->name.hasInheritedValue();
[432]168     CTimer::get("XIOS").suspend();
[581]169     return isDefined;
[432]170  }
[325]171}
Note: See TracBrowser for help on using the repository browser.