[44] | 1 | /* ************************************************************************** * |
---|
| 2 | * Copyright © IPSL/LSCE, xios, 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.hpp" |
---|
| 11 | #include "object_template.hpp" |
---|
| 12 | #include "group_template.hpp" |
---|
| 13 | |
---|
| 14 | #include "icutil.hpp" |
---|
| 15 | #include "timer.hpp" |
---|
| 16 | #include "domain.hpp" |
---|
| 17 | |
---|
| 18 | extern "C" |
---|
| 19 | { |
---|
| 20 | // /////////////////////////////// Définitions ////////////////////////////// // |
---|
| 21 | |
---|
| 22 | // ----------------------- Redéfinition de types ---------------------------- |
---|
| 23 | |
---|
| 24 | typedef xios::CDomain * XDomainPtr; |
---|
| 25 | typedef xios::CDomainGroup * XDomainGroupPtr; |
---|
| 26 | |
---|
| 27 | // ------------------------ Création des handle ----------------------------- |
---|
| 28 | |
---|
| 29 | void cxios_domain_handle_create (XDomainPtr * _ret, const char * _id, int _id_len) |
---|
| 30 | { |
---|
| 31 | std::string id; |
---|
| 32 | if (!cstr2string(_id, _id_len, id)) return; |
---|
| 33 | CTimer::get("XIOS").resume() ; |
---|
| 34 | *_ret = CDomain::get(id); |
---|
| 35 | CTimer::get("XIOS").suspend() ; |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | void cxios_domaingroup_handle_create (XDomainGroupPtr * _ret, const char * _id, int _id_len) |
---|
| 39 | { |
---|
| 40 | std::string id; |
---|
| 41 | if (!cstr2string(_id, _id_len, id)) return; |
---|
| 42 | |
---|
| 43 | CTimer::get("XIOS").resume() ; |
---|
| 44 | *_ret = CDomainGroup::get(id); |
---|
| 45 | CTimer::get("XIOS").suspend() ; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | // -------------------- Vérification des identifiants ----------------------- |
---|
| 49 | |
---|
| 50 | void cxios_domain_valid_id (bool * _ret, const char * _id, int _id_len) |
---|
| 51 | { |
---|
| 52 | std::string id; |
---|
| 53 | if (!cstr2string(_id, _id_len, id)) return; |
---|
| 54 | |
---|
| 55 | CTimer::get("XIOS").resume() ; |
---|
| 56 | *_ret = CDomain::has(id); |
---|
| 57 | CTimer::get("XIOS").suspend() ; |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | void cxios_domaingroup_valid_id (bool * _ret, const char * _id, int _id_len) |
---|
| 61 | { |
---|
| 62 | std::string id; |
---|
| 63 | if (!cstr2string(_id, _id_len, id)) return; |
---|
| 64 | CTimer::get("XIOS").resume() ; |
---|
| 65 | *_ret = CDomainGroup::has(id); |
---|
| 66 | CTimer::get("XIOS").suspend() ; |
---|
| 67 | } |
---|
| 68 | } // extern "C" |
---|