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

Last change on this file since 501 was 501, checked in by ymipsl, 10 years ago

Add licence copyright to all file ond directory src using the command :
svn propset -R copyright -F header_licence src

XIOS is now officialy under CeCILL licence

YM

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