[591] | 1 | #ifndef __XIOS_CGroupFactory__ |
---|
| 2 | #define __XIOS_CGroupFactory__ |
---|
[219] | 3 | |
---|
| 4 | /// boost headers /// |
---|
| 5 | #include <boost/shared_ptr.hpp> |
---|
| 6 | |
---|
[591] | 7 | /// XIOS headers /// |
---|
| 8 | #include "xios_spl.hpp" |
---|
[219] | 9 | #include "exception.hpp" |
---|
| 10 | #include "object_factory.hpp" |
---|
| 11 | #include "group_template.hpp" |
---|
[278] | 12 | #include "xml_parser.hpp" |
---|
[219] | 13 | |
---|
[335] | 14 | namespace xios |
---|
[219] | 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> |
---|
[354] | 25 | static void AddGroup(boost::shared_ptr<U> pgroup, |
---|
[219] | 26 | boost::shared_ptr<U> cgroup); |
---|
| 27 | |
---|
| 28 | template <typename U> |
---|
[354] | 29 | static void AddChild(boost::shared_ptr<U> group, |
---|
[219] | 30 | boost::shared_ptr<typename U::RelChild> child); |
---|
| 31 | |
---|
| 32 | /// Accesseurs /// |
---|
| 33 | static StdString & GetCurrentContextId(void); |
---|
| 34 | |
---|
| 35 | template <typename U> |
---|
[354] | 36 | static boost::shared_ptr<U> |
---|
[219] | 37 | GetGroup(boost::shared_ptr<U> group, const StdString & id); |
---|
| 38 | |
---|
| 39 | template <typename U> |
---|
[354] | 40 | static boost::shared_ptr<typename U::RelChild> |
---|
[219] | 41 | GetChild(boost::shared_ptr<U> group, const StdString & id); |
---|
| 42 | |
---|
| 43 | template <typename U> |
---|
[354] | 44 | static int GetGroupNum(boost::shared_ptr<U> group); |
---|
[219] | 45 | template <typename U> |
---|
[354] | 46 | static int GetGroupIdNum(boost::shared_ptr<U> group); |
---|
[219] | 47 | template <typename U> |
---|
[354] | 48 | static int GetChildNum(boost::shared_ptr<U> group); |
---|
[219] | 49 | template <typename U> |
---|
[354] | 50 | static int GetChildIdNum(boost::shared_ptr<U> group); |
---|
[219] | 51 | |
---|
| 52 | /// Tests /// |
---|
| 53 | template <typename U> |
---|
[354] | 54 | static bool HasGroup(boost::shared_ptr<U> group, const StdString & id); |
---|
[219] | 55 | |
---|
| 56 | template <typename U> |
---|
[354] | 57 | static bool HasChild(boost::shared_ptr<U> group, const StdString & id); |
---|
[219] | 58 | |
---|
| 59 | /// Instanciateur /// |
---|
| 60 | template <typename U> |
---|
[354] | 61 | static boost::shared_ptr<U> |
---|
[219] | 62 | CreateGroup(boost::shared_ptr<U> group, const StdString & id = StdString("")); |
---|
| 63 | |
---|
| 64 | template <typename U> |
---|
[354] | 65 | static boost::shared_ptr<typename U::RelChild> |
---|
[219] | 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 |
---|
[335] | 74 | } // namespace xios |
---|
[219] | 75 | |
---|
[352] | 76 | //#include "group_factory_impl.hpp" |
---|
| 77 | //#include "group_parser.hpp" |
---|
[219] | 78 | |
---|
[591] | 79 | #endif // __XIOS_CGroupFactory__ |
---|