source: XIOS/trunk/src/interface/c/icfield.cpp @ 329

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

port to gfortran/g++

YM

  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, XMLIOServer, 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_impl.hpp"
11#include "object_template_impl.hpp"
12#include "group_template_impl.hpp"
13
14#include "icutil.hpp"
15
16extern "C"
17{
18// /////////////////////////////// Définitions ////////////////////////////// //
19
20   // ----------------------- Redéfinition de types ----------------------------
21   
22   typedef xmlioserver::tree::CField      * XFieldPtr;
23   typedef xmlioserver::tree::CFieldGroup * XFieldGroupPtr;
24   
25// --------------------------------------------------------------------------   
26// ------------------------ Création des handle -----------------------------
27// --------------------------------------------------------------------------   
28   
29   void cxios_field_handle_create (XFieldPtr * _ret, const char * _id, int _id_len)
30   {
31      std::string id; 
32      if (!cstr2string(_id, _id_len, id)) return;
33
34      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CField>(id).get();
35   }
36   
37   void cxios_fieldgroup_handle_create (XFieldGroupPtr * _ret, const char * _id, int _id_len)
38   {
39      std::string id; 
40      if (!cstr2string(_id, _id_len, id)) return;
41
42      *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CFieldGroup>(id).get();
43   }
44
45
46   // -------------------- Vérification des identifiants -----------------------
47
48   void cxios_field_valid_id (bool * _ret, const char * _id, int _id_len)
49   {
50      std::string id;
51      if (!cstr2string(_id, _id_len, id)) return;
52
53      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CField>(id);
54   }
55
56   void cxios_fieldgroup_valid_id (bool * _ret, const char * _id, int _id_len)
57   {
58      std::string id;
59      if (!cstr2string(_id, _id_len, id)) return;
60
61      *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CFieldGroup>(id);
62   }
63
64// -----------------------------------------------------------------------------------------------------   
65// ------------------------- other function----------  --------------------------- ---------------------
66// -----------------------------------------------------------------------------------------------------   
67
68  void cxios_field_is_active (XFieldPtr field_hdl, bool* ret)
69  {
70    *ret = field_hdl->isActive();
71  }
72   
73} // extern "C"
Note: See TracBrowser for help on using the repository browser.