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

Last change on this file since 1542 was 1542, checked in by oabramkina, 6 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: 2.1 KB
RevLine 
[474]1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
3 * ************************************************************************** */
4
5#include <boost/multi_array.hpp>
6
[1542]7#include <memory>
8
[591]9#include "xios.hpp"
[474]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 "variable.hpp"
18
19extern "C"
20{
21// /////////////////////////////// Définitions ////////////////////////////// //
22
23   // ----------------------- Redéfinition de types ----------------------------
24   
25   typedef xios::CVariable      * XVariablePtr;
26   typedef xios::CVariableGroup * XVariableGroupPtr;
27
28   // ------------------------ Création des handle -----------------------------
29   
30   void cxios_variable_handle_create (XVariablePtr * _ret, const char * _id, int _id_len)
31   {
32      std::string id; 
33      if (!cstr2string(_id, _id_len, id)) return;
34      CTimer::get("XIOS").resume() ;
35      *_ret = xios::CVariable::get(id);
36      CTimer::get("XIOS").suspend() ;
37   }
38   
39   void cxios_variablegroup_handle_create (XVariableGroupPtr * _ret, const char * _id, int _id_len)
40   {
41      std::string id; 
42      if (!cstr2string(_id, _id_len, id)) return;
43      CTimer::get("XIOS").resume() ;
44      *_ret = xios::CVariableGroup::get(id);
45      CTimer::get("XIOS").suspend() ;
46    }
47
48   // -------------------- Vérification des identifiants -----------------------
49
50   void cxios_variable_valid_id (bool * _ret, const char * _id, int _id_len)
51   {
52      std::string id;
53      if (!cstr2string(_id, _id_len, id)) return;
54
55      CTimer::get("XIOS").resume() ;
56      *_ret = xios::CVariable::has(id);
57      CTimer::get("XIOS").suspend() ;
58   }
59
60   void cxios_variablegroup_valid_id (bool * _ret, const char * _id, int _id_len)
61   {
62      std::string id;
63      if (!cstr2string(_id, _id_len, id)) return;
64
65      CTimer::get("XIOS").resume() ;
66      *_ret = xios::CVariableGroup::has(id);
67      CTimer::get("XIOS").suspend() ;
68
69   }
70   
71} // extern "C"
72
Note: See TracBrowser for help on using the repository browser.