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