source: XMLIO_V2/dev/common/src/xmlio/group_factory.hpp @ 219

Last change on this file since 219 was 219, checked in by hozdoba, 13 years ago

Préparation nouvelle arborescence

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