source: XIOS/dev/dev_ym/XIOS_COUPLING/src/group_factory.hpp @ 2274

Last change on this file since 2274 was 2274, checked in by ymipsl, 2 years ago

Tracking memory leak : release memory statically alocated

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
File size: 2.5 KB
Line 
1#ifndef __XIOS_CGroupFactory__
2#define __XIOS_CGroupFactory__
3
4/// XIOS headers ///
5#include "xios_spl.hpp"
6#include "exception.hpp"
7#include "object_factory.hpp"
8#include "group_template.hpp"
9#include "xml_parser.hpp"
10
11namespace xios
12{
13   /// ////////////////////// Déclarations ////////////////////// ///
14   class CGroupFactory
15   {
16      public :
17
18         /// Mutateurs ///
19         static void SetCurrentContextId(const StdString & context);
20         static void clearCurrentContextId() {CurrContext.clear(); CurrContext.shrink_to_fit();} 
21
22         template <typename U>
23            static void AddGroup(std::shared_ptr<U> pgroup,
24                                        std::shared_ptr<U> cgroup);
25
26         template <typename U>
27            static void AddChild(std::shared_ptr<U> group,
28                                        std::shared_ptr<typename U::RelChild> child);
29
30         /// Accesseurs ///
31         static StdString & GetCurrentContextId(void);
32
33         template <typename U>
34            static std::shared_ptr<U>
35               GetGroup(std::shared_ptr<U> group, const StdString & id);
36
37         template <typename U>
38            static std::shared_ptr<typename U::RelChild>
39               GetChild(std::shared_ptr<U> group, const StdString & id);
40
41         template <typename U>
42            static int GetGroupNum(std::shared_ptr<U> group);
43         template <typename U>
44            static int GetGroupIdNum(std::shared_ptr<U> group);
45         template <typename U>
46            static int GetChildNum(std::shared_ptr<U> group);
47         template <typename U>
48            static int GetChildIdNum(std::shared_ptr<U> group);
49
50         /// Tests ///
51         template <typename U>
52            static bool HasGroup(std::shared_ptr<U> group, const StdString & id);
53
54         template <typename U>
55            static bool HasChild(std::shared_ptr<U> group, const StdString & id);
56
57         /// Instanciateur ///
58         template <typename U>
59            static std::shared_ptr<U>
60               CreateGroup(std::shared_ptr<U> group, const StdString & id = StdString(""));
61
62         template <typename U>
63            static std::shared_ptr<typename U::RelChild>
64               CreateChild(std::shared_ptr<U> group, const StdString & id = StdString(""));
65
66      private :
67
68         /// Propriétés statiques ///
69         static StdString CurrContext;
70
71   }; // class CGroupFactory
72} // namespace xios
73
74//#include "group_factory_impl.hpp"
75//#include "group_parser.hpp"
76
77#endif // __XIOS_CGroupFactory__
Note: See TracBrowser for help on using the repository browser.