source: XIOS/dev/dev_olga/src/interface/c/icaxis.cpp @ 1612

Last change on this file since 1612 was 1612, checked in by oabramkina, 5 years ago

Dev: adding exception handling.

To activate it, compilation flag -DXIOS_EXCEPTION should be added.

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
  • Property svn:eol-style set to native
File size: 2.1 KB
RevLine 
[325]1/* ************************************************************************** *
[335]2 *      Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
[325]3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
[1542]6#include <memory>
[325]7
[591]8#include "xios.hpp"
[325]9
[352]10#include "object_template.hpp"
11#include "group_template.hpp"
12#include "attribute_template.hpp"
[325]13
14#include "icutil.hpp"
[347]15#include "timer.hpp"
[352]16#include "axis.hpp"
[325]17
18extern "C"
19{
20// /////////////////////////////// Définitions ////////////////////////////// //
21
22   // ----------------------- Redéfinition de types ----------------------------
23   
[345]24   typedef xios::CAxis      * XAxisPtr;
25   typedef xios::CAxisGroup * XAxisGroupPtr;
[325]26
27   // ------------------------ Création des handle -----------------------------
28   
29   void cxios_axis_handle_create (XAxisPtr * _ret, const char * _id, int _id_len)
[1612]30   TRY
[325]31   {
32      std::string id; 
33      if (!cstr2string(_id, _id_len, id)) return;
[347]34      CTimer::get("XIOS").resume() ;
35      *_ret = xios::CAxis::get(id);
36      CTimer::get("XIOS").suspend() ;
[325]37   }
[1612]38   CATCH_DUMP_STACK
[325]39   
40   void cxios_axisgroup_handle_create (XAxisGroupPtr * _ret, const char * _id, int _id_len)
[1612]41   TRY
[325]42   {
43      std::string id; 
44      if (!cstr2string(_id, _id_len, id)) return;
[347]45      CTimer::get("XIOS").resume() ;
46      *_ret = xios::CAxisGroup::get(id);
47      CTimer::get("XIOS").suspend() ;
48    }
[1612]49   CATCH_DUMP_STACK
[325]50
51   // -------------------- Vérification des identifiants -----------------------
52
53   void cxios_axis_valid_id (bool * _ret, const char * _id, int _id_len)
[1612]54   TRY
[325]55   {
56      std::string id;
57      if (!cstr2string(_id, _id_len, id)) return;
58
[347]59      CTimer::get("XIOS").resume() ;
[346]60      *_ret = xios::CAxis::has(id);
[347]61      CTimer::get("XIOS").suspend() ;
[325]62   }
[1612]63   CATCH_DUMP_STACK
[325]64
65   void cxios_axisgroup_valid_id (bool * _ret, const char * _id, int _id_len)
[1612]66   TRY
[325]67   {
68      std::string id;
69      if (!cstr2string(_id, _id_len, id)) return;
70
[347]71      CTimer::get("XIOS").resume() ;
[346]72      *_ret = xios::CAxisGroup::has(id);
[347]73      CTimer::get("XIOS").suspend() ;
74
[325]75   }
[1612]76   CATCH_DUMP_STACK
[325]77   
78} // extern "C"
Note: See TracBrowser for help on using the repository browser.