1 | /* ************************************************************************** * |
---|
2 | * Copyright © IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011 * |
---|
3 | * ************************************************************************** */ |
---|
4 | |
---|
5 | #include <boost/multi_array.hpp> |
---|
6 | #include <boost/shared_ptr.hpp> |
---|
7 | |
---|
8 | #include "xmlioserver.hpp" |
---|
9 | |
---|
10 | #include "attribute_template_impl.hpp" |
---|
11 | #include "object_template_impl.hpp" |
---|
12 | #include "group_template_impl.hpp" |
---|
13 | |
---|
14 | #include "icutil.hpp" |
---|
15 | |
---|
16 | extern "C" |
---|
17 | { |
---|
18 | // /////////////////////////////// Définitions ////////////////////////////// // |
---|
19 | |
---|
20 | // ----------------------- Redéfinition de types ---------------------------- |
---|
21 | |
---|
22 | typedef void * XAxisPtr, * XAxisGroupPtr; |
---|
23 | |
---|
24 | // ------------------------- Attributs des axes ----------------------------- |
---|
25 | void xios_set_axis_name |
---|
26 | (XAxisPtr axis_hdl, const char * name , int name_size) |
---|
27 | { |
---|
28 | std::string name_str; |
---|
29 | if (!cstr2string(name, name_size, name_str)) return; |
---|
30 | } |
---|
31 | |
---|
32 | void xios_set_axis_standard_name |
---|
33 | (XAxisPtr axis_hdl, const char * standard_name , int standard_name_size) |
---|
34 | { |
---|
35 | std::string standard_name_str; |
---|
36 | if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return; |
---|
37 | } |
---|
38 | |
---|
39 | void xios_set_axis_long_name |
---|
40 | (XAxisPtr axis_hdl, const char * long_name , int long_name_size) |
---|
41 | { |
---|
42 | std::string long_name_str; |
---|
43 | if (!cstr2string(long_name, long_name_size, long_name_str)) return; |
---|
44 | } |
---|
45 | |
---|
46 | void xios_set_axis_unit |
---|
47 | (XAxisPtr axis_hdl, const char * unit , int unit_size) |
---|
48 | { |
---|
49 | std::string unit_str; |
---|
50 | if (!cstr2string(unit, unit_size, unit_str)) return; |
---|
51 | } |
---|
52 | |
---|
53 | void xios_set_axis_size(void * axis_hdl, int size) |
---|
54 | { |
---|
55 | |
---|
56 | } |
---|
57 | |
---|
58 | void xios_set_axis_zvalue |
---|
59 | (XAxisPtr axis_hdl, const double * zvalue , int zvalue_extent1) |
---|
60 | { |
---|
61 | boost::shared_ptr<boost::multi_array<double, 1> > zvalue_val |
---|
62 | (new boost::multi_array<double, 1>(boost::extents [zvalue_extent1], |
---|
63 | boost::fortran_storage_order())); |
---|
64 | std::copy(zvalue, &(zvalue[zvalue_val->num_elements()]), zvalue_val->data()); |
---|
65 | |
---|
66 | } |
---|
67 | |
---|
68 | // -------------------- Attributs des groupes d'axes ------------------------- |
---|
69 | |
---|
70 | void xios_set_axisgroup_name |
---|
71 | (XAxisGroupPtr axisgroup_hdl, const char * name , int name_size) |
---|
72 | { |
---|
73 | std::string name_str; |
---|
74 | if (!cstr2string(name, name_size, name_str)) return; |
---|
75 | } |
---|
76 | |
---|
77 | void xios_set_axisgroup_standard_name |
---|
78 | (XAxisGroupPtr axisgroup_hdl, const char * standard_name , int standard_name_size) |
---|
79 | { |
---|
80 | std::string standard_name_str; |
---|
81 | if (!cstr2string(standard_name, standard_name_size, standard_name_str)) return; |
---|
82 | } |
---|
83 | |
---|
84 | void xios_set_axisgroup_long_name |
---|
85 | (XAxisGroupPtr axisgroup_hdl, const char * long_name , int long_name_size) |
---|
86 | { |
---|
87 | std::string long_name_str; |
---|
88 | if (!cstr2string(long_name, long_name_size, long_name_str)) return; |
---|
89 | } |
---|
90 | |
---|
91 | void xios_set_axisgroup_unit |
---|
92 | (XAxisGroupPtr axisgroup_hdl, const char * unit , int unit_size) |
---|
93 | { |
---|
94 | std::string unit_str; |
---|
95 | if (!cstr2string(unit, unit_size, unit_str)) return; |
---|
96 | } |
---|
97 | |
---|
98 | void xios_set_axisgroup_size(XAxisGroupPtr axisgroup_hdl, int size) |
---|
99 | { |
---|
100 | |
---|
101 | } |
---|
102 | |
---|
103 | void xios_set_axisgroup_zvalue |
---|
104 | (XAxisGroupPtr axisgroup_hdl, const double * zvalue , int zvalue_extent1) |
---|
105 | { |
---|
106 | boost::shared_ptr<boost::multi_array<double, 1> > zvalue_val |
---|
107 | (new boost::multi_array<double, 1>(boost::extents [zvalue_extent1], |
---|
108 | boost::fortran_storage_order())); |
---|
109 | std::copy(zvalue, &(zvalue[zvalue_val->num_elements()]), zvalue_val->data()); |
---|
110 | } |
---|
111 | |
---|
112 | // ------------------------ Création des handle ----------------------------- |
---|
113 | |
---|
114 | void xios_axis_handle_create (XAxisPtr * _ret, const char * _id, int _id_len) |
---|
115 | { |
---|
116 | std::string id; |
---|
117 | if (!cstr2string(_id, _id_len, id)) return; |
---|
118 | } |
---|
119 | |
---|
120 | void xios_axisgroup_handle_create (XAxisGroupPtr * _ret, const char * _id, int _id_len) |
---|
121 | { |
---|
122 | std::string id; |
---|
123 | if (!cstr2string(_id, _id_len, id)) return; |
---|
124 | } |
---|
125 | |
---|
126 | } // extern "C" |
---|