source: XIOS/trunk/src/interface/c/icfield.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.7 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 "field.hpp"
17
18extern "C"
19{
20// /////////////////////////////// Définitions ////////////////////////////// //
21
22   // ----------------------- Redéfinition de types ----------------------------
23   
24   typedef xios::CField      * XFieldPtr;
25   typedef xios::CFieldGroup * XFieldGroupPtr;
26   
27// --------------------------------------------------------------------------   
28// ------------------------ Création des handle -----------------------------
29// --------------------------------------------------------------------------   
30   
31   void cxios_field_handle_create (XFieldPtr * _ret, const char * _id, int _id_len)
32   {
33      std::string id; 
34      if (!cstr2string(_id, _id_len, id)) return;
35      CTimer::get("XIOS").resume() ;
36      *_ret = CField::get(id);
37      CTimer::get("XIOS").suspend() ;
38   }
39   
40   void cxios_fieldgroup_handle_create (XFieldGroupPtr * _ret, const char * _id, int _id_len)
41   {
42      std::string id; 
43      if (!cstr2string(_id, _id_len, id)) return;
44      CTimer::get("XIOS").resume() ;
45      *_ret = CFieldGroup::get(id);
46      CTimer::get("XIOS").suspend() ;
47   }
48
49
50   // -------------------- Vérification des identifiants -----------------------
51
52   void cxios_field_valid_id (bool * _ret, const char * _id, int _id_len)
53   {
54      std::string id;
55      if (!cstr2string(_id, _id_len, id)) return;
56      CTimer::get("XIOS").resume() ;
57      *_ret = CField::has(id);
58      CTimer::get("XIOS").suspend() ;
59   }
60
61   void cxios_fieldgroup_valid_id (bool * _ret, const char * _id, int _id_len)
62   {
63      std::string id;
64      if (!cstr2string(_id, _id_len, id)) return;
65      CTimer::get("XIOS").resume() ;
66      *_ret = CFieldGroup::has(id);
67      CTimer::get("XIOS").suspend() ;
68   }
69
70// -----------------------------------------------------------------------------------------------------   
71// ------------------------- other function----------  --------------------------- ---------------------
72// -----------------------------------------------------------------------------------------------------   
73
74  void cxios_field_is_active (XFieldPtr field_hdl, bool* ret)
75  {
76    CTimer::get("XIOS").resume() ;
77    *ret = field_hdl->isActive();
78    CTimer::get("XIOS").suspend() ;
79  }
80   
81} // extern "C"
Note: See TracBrowser for help on using the repository browser.