1 | /* ************************************************************************** * |
---|
2 | * Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011 * |
---|
3 | * ************************************************************************** */ |
---|
4 | |
---|
5 | #include <boost/multi_array.hpp> |
---|
6 | |
---|
7 | #include "xios.hpp" |
---|
8 | |
---|
9 | #include "attribute_template.hpp" |
---|
10 | #include "object_template.hpp" |
---|
11 | #include "group_template.hpp" |
---|
12 | |
---|
13 | #include "icutil.hpp" |
---|
14 | #include "timer.hpp" |
---|
15 | #include "grid.hpp" |
---|
16 | |
---|
17 | extern "C" |
---|
18 | { |
---|
19 | // /////////////////////////////// Définitions ////////////////////////////// // |
---|
20 | |
---|
21 | // ----------------------- Redéfinition de types ---------------------------- |
---|
22 | |
---|
23 | typedef xios::CGrid * XGridPtr; |
---|
24 | typedef xios::CGridGroup * XGridGroupPtr; |
---|
25 | |
---|
26 | // ------------------------ Création des handle ----------------------------- |
---|
27 | |
---|
28 | void cxios_grid_handle_create (XGridPtr * _ret, const char * _id, int _id_len) |
---|
29 | { |
---|
30 | std::string id; |
---|
31 | if (!cstr2string(_id, _id_len, id)) return; |
---|
32 | CTimer::get("XIOS").resume() ; |
---|
33 | *_ret = CGrid::get(id); |
---|
34 | CTimer::get("XIOS").suspend() ; |
---|
35 | } |
---|
36 | |
---|
37 | void cxios_gridgroup_handle_create (XGridGroupPtr * _ret, const char * _id, int _id_len) |
---|
38 | { |
---|
39 | std::string id; |
---|
40 | if (!cstr2string(_id, _id_len, id)) return; |
---|
41 | CTimer::get("XIOS").resume() ; |
---|
42 | *_ret = CGridGroup::get(id); |
---|
43 | CTimer::get("XIOS").suspend() ; |
---|
44 | } |
---|
45 | |
---|
46 | // -------------------- Vérification des identifiants ----------------------- |
---|
47 | |
---|
48 | void cxios_grid_valid_id (bool * _ret, const char * _id, int _id_len) |
---|
49 | { |
---|
50 | std::string id; |
---|
51 | if (!cstr2string(_id, _id_len, id)) return; |
---|
52 | CTimer::get("XIOS").resume() ; |
---|
53 | *_ret = CGrid::has(id); |
---|
54 | CTimer::get("XIOS").suspend() ; |
---|
55 | } |
---|
56 | |
---|
57 | void cxios_gridgroup_valid_id (bool * _ret, const char * _id, int _id_len) |
---|
58 | { |
---|
59 | std::string id; |
---|
60 | if (!cstr2string(_id, _id_len, id)) return; |
---|
61 | CTimer::get("XIOS").resume() ; |
---|
62 | *_ret = CGridGroup::has(id); |
---|
63 | CTimer::get("XIOS").suspend() ; |
---|
64 | } |
---|
65 | } // extern "C" |
---|