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