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 | |
---|
16 | extern "C" |
---|
17 | { |
---|
18 | // /////////////////////////////// Définitions ////////////////////////////// // |
---|
19 | |
---|
20 | // ----------------------- Redéfinition de types ---------------------------- |
---|
21 | |
---|
22 | typedef xmlioserver::tree::CDomain * XDomainPtr; |
---|
23 | typedef xmlioserver::tree::CDomainGroup * XDomainGroupPtr; |
---|
24 | |
---|
25 | // ------------------------ Création des handle ----------------------------- |
---|
26 | |
---|
27 | void cxios_domain_handle_create (XDomainPtr * _ret, const char * _id, int _id_len) |
---|
28 | { |
---|
29 | std::string id; |
---|
30 | if (!cstr2string(_id, _id_len, id)) return; |
---|
31 | |
---|
32 | *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CDomain>(id).get(); |
---|
33 | } |
---|
34 | |
---|
35 | void cxios_domaingroup_handle_create (XDomainGroupPtr * _ret, const char * _id, int _id_len) |
---|
36 | { |
---|
37 | std::string id; |
---|
38 | if (!cstr2string(_id, _id_len, id)) return; |
---|
39 | |
---|
40 | *_ret = xmlioserver::CObjectFactory::GetObject<xmlioserver::tree::CDomainGroup>(id).get(); |
---|
41 | } |
---|
42 | |
---|
43 | // -------------------- Vérification des identifiants ----------------------- |
---|
44 | |
---|
45 | void cxios_domain_valid_id (bool * _ret, const char * _id, int _id_len) |
---|
46 | { |
---|
47 | std::string id; |
---|
48 | if (!cstr2string(_id, _id_len, id)) return; |
---|
49 | |
---|
50 | *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CDomain>(id); |
---|
51 | } |
---|
52 | |
---|
53 | void cxios_domaingroup_valid_id (bool * _ret, const char * _id, int _id_len) |
---|
54 | { |
---|
55 | std::string id; |
---|
56 | if (!cstr2string(_id, _id_len, id)) return; |
---|
57 | |
---|
58 | *_ret = xmlioserver::CObjectFactory::HasObject<xmlioserver::tree::CDomainGroup>(id); |
---|
59 | } |
---|
60 | } // extern "C" |
---|