source: XIOS/trunk/src/interface/c/icgrid.cpp @ 2315

Last change on this file since 2315 was 1622, checked in by oabramkina, 6 years ago

Exception handling on trunk.

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>
6
[591]7#include "xios.hpp"
[325]8
[352]9#include "attribute_template.hpp"
10#include "object_template.hpp"
11#include "group_template.hpp"
[325]12
13#include "icutil.hpp"
[347]14#include "timer.hpp"
[352]15#include "grid.hpp"
[325]16
17extern "C"
18{
19// /////////////////////////////// Définitions ////////////////////////////// //
20
21   // ----------------------- Redéfinition de types ----------------------------
22   
[345]23   typedef xios::CGrid      * XGridPtr;
24   typedef xios::CGridGroup * XGridGroupPtr;
[325]25
26   // ------------------------ Création des handle -----------------------------
27 
28   void cxios_grid_handle_create (XGridPtr * _ret, const char * _id, int _id_len)
[1622]29   TRY
[325]30   {
31      std::string id; 
32      if (!cstr2string(_id, _id_len, id)) return;
[347]33      CTimer::get("XIOS").resume() ;
34      *_ret = CGrid::get(id);
35      CTimer::get("XIOS").suspend() ;
[325]36   }
[1622]37   CATCH_DUMP_STACK
[325]38   
39   void cxios_gridgroup_handle_create (XGridGroupPtr * _ret, const char * _id, int _id_len)
[1622]40   TRY
[325]41   {
42      std::string id; 
43      if (!cstr2string(_id, _id_len, id)) return;
[347]44      CTimer::get("XIOS").resume() ;
45      *_ret = CGridGroup::get(id);
46      CTimer::get("XIOS").suspend() ;
[325]47   }
[1622]48   CATCH_DUMP_STACK
[325]49
50   // -------------------- Vérification des identifiants -----------------------
51
52   void cxios_grid_valid_id (bool * _ret, const char * _id, int _id_len)
[1622]53   TRY
[325]54   {
55      std::string id;
56      if (!cstr2string(_id, _id_len, id)) return;
[347]57      CTimer::get("XIOS").resume() ;
[346]58      *_ret = CGrid::has(id);
[347]59      CTimer::get("XIOS").suspend() ;
[325]60   }
[1622]61   CATCH_DUMP_STACK
[325]62
63   void cxios_gridgroup_valid_id (bool * _ret, const char * _id, int _id_len)
[1622]64   TRY
[325]65   {
66      std::string id;
67      if (!cstr2string(_id, _id_len, id)) return;
[347]68      CTimer::get("XIOS").resume() ;
[346]69      *_ret = CGridGroup::has(id);
[347]70      CTimer::get("XIOS").suspend() ;
[325]71   }
[1622]72   CATCH_DUMP_STACK
[325]73} // extern "C"
Note: See TracBrowser for help on using the repository browser.