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

Last change on this file since 1542 was 1542, checked in by oabramkina, 2 years ago

Replacing Boost's unordered_map and shared_pointer by its STL counterparts.

Two notes for Curie:

  • one can see the content of unordered_map with ddt only if XIOS has been compiled with gnu
  • XIOS will not compile any more with pgi (all available versions use old STL which are not up to the c++11 norms)
  • 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: 1.9 KB
Line 
1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6
7#include "xios.hpp"
8
9#include "attribute_template.hpp"
10#include "object_template.hpp"
11#include "group_template.hpp"
12
13#include "icutil.hpp"
14#include "timer.hpp"
15#include "grid.hpp"
16
17extern "C"
18{
19// /////////////////////////////// Définitions ////////////////////////////// //
20
21   // ----------------------- Redéfinition de types ----------------------------
22   
23   typedef xios::CGrid      * XGridPtr;
24   typedef xios::CGridGroup * XGridGroupPtr;
25
26   // ------------------------ Création des handle -----------------------------
27 
28   void cxios_grid_handle_create (XGridPtr * _ret, const char * _id, int _id_len)
29   {
30      std::string id; 
31      if (!cstr2string(_id, _id_len, id)) return;
32      CTimer::get("XIOS").resume() ;
33      *_ret = CGrid::get(id);
34      CTimer::get("XIOS").suspend() ;
35   }
36   
37   void cxios_gridgroup_handle_create (XGridGroupPtr * _ret, const char * _id, int _id_len)
38   {
39      std::string id; 
40      if (!cstr2string(_id, _id_len, id)) return;
41      CTimer::get("XIOS").resume() ;
42      *_ret = CGridGroup::get(id);
43      CTimer::get("XIOS").suspend() ;
44   }
45
46   // -------------------- Vérification des identifiants -----------------------
47
48   void cxios_grid_valid_id (bool * _ret, const char * _id, int _id_len)
49   {
50      std::string id;
51      if (!cstr2string(_id, _id_len, id)) return;
52      CTimer::get("XIOS").resume() ;
53      *_ret = CGrid::has(id);
54      CTimer::get("XIOS").suspend() ;
55   }
56
57   void cxios_gridgroup_valid_id (bool * _ret, const char * _id, int _id_len)
58   {
59      std::string id;
60      if (!cstr2string(_id, _id_len, id)) return;
61      CTimer::get("XIOS").resume() ;
62      *_ret = CGridGroup::has(id);
63      CTimer::get("XIOS").suspend() ;
64   }
65} // extern "C"
Note: See TracBrowser for help on using the repository browser.