source: XIOS/dev/dev_olga/src/interface/c/iczoom.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.

File size: 2.3 KB
RevLine 
[784]1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6
[1542]7#include <memory>
8
[784]9#include "xios.hpp"
10
11#include "object_template.hpp"
12#include "group_template.hpp"
13#include "attribute_template.hpp"
14
15#include "icutil.hpp"
16#include "timer.hpp"
17#include "zoom_axis.hpp"
[786]18#include "zoom_domain.hpp"
[784]19
20extern "C"
21{
22// /////////////////////////////// Définitions ////////////////////////////// //
23
24   // ----------------------- Redéfinition de types ----------------------------
25
26   typedef xios::CZoomAxis   * XZoomAxisPtr;
[786]27   typedef xios::CZoomDomain * XZoomDomainPtr;
[784]28   // ------------------------ Création des handle -----------------------------
29   void cxios_zoom_axis_handle_create (XZoomAxisPtr * _ret, const char * _id, int _id_len)
[1612]30   TRY
[784]31   {
32      std::string id;
33      if (!cstr2string(_id, _id_len, id)) return;
34      CTimer::get("XIOS").resume() ;
35      *_ret = xios::CZoomAxis::get(id);
36      CTimer::get("XIOS").suspend() ;
37   }
[1612]38   CATCH_DUMP_STACK
[784]39
40   // -------------------- Vérification des identifiants -----------------------
41   void cxios_zoom_axis_valid_id (bool * _ret, const char * _id, int _id_len)
[1612]42   TRY
[784]43   {
44      std::string id;
45      if (!cstr2string(_id, _id_len, id)) return;
46
47      CTimer::get("XIOS").resume() ;
48      *_ret = xios::CZoomAxis::has(id);
49      CTimer::get("XIOS").suspend() ;
50   }
[1612]51   CATCH_DUMP_STACK
[786]52
53   // ------------------------ Création des handle -----------------------------
54   void cxios_zoom_domain_handle_create(XZoomDomainPtr * _ret, const char * _id, int _id_len)
[1612]55   TRY
[786]56   {
57      std::string id;
58      if (!cstr2string(_id, _id_len, id)) return;
59      CTimer::get("XIOS").resume() ;
60      *_ret = xios::CZoomDomain::get(id);
61      CTimer::get("XIOS").suspend() ;
62   }
[1612]63   CATCH_DUMP_STACK
[786]64
65   // -------------------- Vérification des identifiants -----------------------
66   void cxios_zoom_domain_valid_id(bool * _ret, const char * _id, int _id_len)
[1612]67   TRY
[786]68   {
69      std::string id;
70      if (!cstr2string(_id, _id_len, id)) return;
71
72      CTimer::get("XIOS").resume() ;
73      *_ret = xios::CZoomDomain::has(id);
74      CTimer::get("XIOS").suspend() ;
75   }
[1612]76   CATCH_DUMP_STACK
[784]77} // extern "C"
Note: See TracBrowser for help on using the repository browser.