[325] | 1 | /* ************************************************************************** * |
---|
[335] | 2 | * Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011 * |
---|
[325] | 3 | * ************************************************************************** */ |
---|
| 4 | |
---|
| 5 | #include <boost/multi_array.hpp> |
---|
| 6 | #include <boost/shared_ptr.hpp> |
---|
| 7 | |
---|
| 8 | #include "xmlioserver.hpp" |
---|
| 9 | |
---|
| 10 | #include "object_template_impl.hpp" |
---|
| 11 | #include "group_template_impl.hpp" |
---|
| 12 | #include "attribute_template_impl.hpp" |
---|
| 13 | |
---|
| 14 | #include "icutil.hpp" |
---|
[347] | 15 | #include "timer.hpp" |
---|
[325] | 16 | |
---|
| 17 | extern "C" |
---|
| 18 | { |
---|
| 19 | // /////////////////////////////// Définitions ////////////////////////////// // |
---|
| 20 | |
---|
| 21 | // ----------------------- Redéfinition de types ---------------------------- |
---|
| 22 | |
---|
[345] | 23 | typedef xios::CAxis * XAxisPtr; |
---|
| 24 | typedef xios::CAxisGroup * XAxisGroupPtr; |
---|
[325] | 25 | |
---|
| 26 | // ------------------------ Création des handle ----------------------------- |
---|
| 27 | |
---|
| 28 | void cxios_axis_handle_create (XAxisPtr * _ret, const char * _id, int _id_len) |
---|
| 29 | { |
---|
| 30 | std::string id; |
---|
| 31 | if (!cstr2string(_id, _id_len, id)) return; |
---|
[347] | 32 | CTimer::get("XIOS").resume() ; |
---|
| 33 | *_ret = xios::CAxis::get(id); |
---|
| 34 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 35 | } |
---|
| 36 | |
---|
| 37 | void cxios_axisgroup_handle_create (XAxisGroupPtr * _ret, const char * _id, int _id_len) |
---|
| 38 | { |
---|
| 39 | std::string id; |
---|
| 40 | if (!cstr2string(_id, _id_len, id)) return; |
---|
[347] | 41 | CTimer::get("XIOS").resume() ; |
---|
| 42 | *_ret = xios::CAxisGroup::get(id); |
---|
| 43 | CTimer::get("XIOS").suspend() ; |
---|
| 44 | } |
---|
[325] | 45 | |
---|
| 46 | // -------------------- Vérification des identifiants ----------------------- |
---|
| 47 | |
---|
| 48 | void cxios_axis_valid_id (bool * _ret, const char * _id, int _id_len) |
---|
| 49 | { |
---|
| 50 | std::string id; |
---|
| 51 | if (!cstr2string(_id, _id_len, id)) return; |
---|
| 52 | |
---|
[347] | 53 | CTimer::get("XIOS").resume() ; |
---|
[346] | 54 | *_ret = xios::CAxis::has(id); |
---|
[347] | 55 | CTimer::get("XIOS").suspend() ; |
---|
[325] | 56 | } |
---|
| 57 | |
---|
| 58 | void cxios_axisgroup_valid_id (bool * _ret, const char * _id, int _id_len) |
---|
| 59 | { |
---|
| 60 | std::string id; |
---|
| 61 | if (!cstr2string(_id, _id_len, id)) return; |
---|
| 62 | |
---|
[347] | 63 | CTimer::get("XIOS").resume() ; |
---|
[346] | 64 | *_ret = xios::CAxisGroup::has(id); |
---|
[347] | 65 | CTimer::get("XIOS").suspend() ; |
---|
| 66 | |
---|
[325] | 67 | } |
---|
| 68 | |
---|
| 69 | } // extern "C" |
---|