/* ************************************************************************** * * Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011 * * ************************************************************************** */ #include #include #include "xios.hpp" #include "attribute_template.hpp" #include "object_template.hpp" #include "group_template.hpp" #include "icutil.hpp" #include "timer.hpp" #include "field.hpp" extern "C" { // /////////////////////////////// Définitions ////////////////////////////// // // ----------------------- Redéfinition de types ---------------------------- typedef xios::CField * XFieldPtr; typedef xios::CFieldGroup * XFieldGroupPtr; // -------------------------------------------------------------------------- // ------------------------ Création des handle ----------------------------- // -------------------------------------------------------------------------- void cxios_field_handle_create (XFieldPtr * _ret, const char * _id, int _id_len) { std::string id; if (!cstr2string(_id, _id_len, id)) return; CTimer::get("XIOS").resume() ; *_ret = CField::get(id); CTimer::get("XIOS").suspend() ; } void cxios_fieldgroup_handle_create (XFieldGroupPtr * _ret, const char * _id, int _id_len) { std::string id; if (!cstr2string(_id, _id_len, id)) return; CTimer::get("XIOS").resume() ; *_ret = CFieldGroup::get(id); CTimer::get("XIOS").suspend() ; } // -------------------- Vérification des identifiants ----------------------- void cxios_field_valid_id (bool * _ret, const char * _id, int _id_len) { std::string id; if (!cstr2string(_id, _id_len, id)) return; CTimer::get("XIOS").resume() ; *_ret = CField::has(id); CTimer::get("XIOS").suspend() ; } void cxios_fieldgroup_valid_id (bool * _ret, const char * _id, int _id_len) { std::string id; if (!cstr2string(_id, _id_len, id)) return; CTimer::get("XIOS").resume() ; *_ret = CFieldGroup::has(id); CTimer::get("XIOS").suspend() ; } // ----------------------------------------------------------------------------------------------------- // ------------------------- other function---------- --------------------------- --------------------- // ----------------------------------------------------------------------------------------------------- void cxios_field_is_active (XFieldPtr field_hdl, bool* ret) { CTimer::get("XIOS").resume() ; *ret = field_hdl->isActive(); CTimer::get("XIOS").suspend() ; } } // extern "C"