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