source: XMLIO_V2/dev/dev_rv/src/group_template.hpp @ 141

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

Mise à jour depuis un autre dépôt

File size: 2.5 KB
Line 
1#ifndef __XMLIO_CGroupTemplate__
2#define __XMLIO_CGroupTemplate__
3
4#include "declare_attribute.hpp"
5
6namespace xmlioserver
7{
8   using namespace tree;
9
10   /// ////////////////////// Déclarations ////////////////////// ///
11   template <class U, class V, class W>
12      class CGroupTemplate
13         : public CObjectTemplate<V>, public virtual W
14   {
15         /// Friend ///
16         friend class CGroupFactory;
17
18         /// Typedef ///
19         typedef U Child;
20         typedef V Derived, Group;
21         typedef W SuperClassAttribute;
22         typedef CObjectTemplate<V> SuperClass;
23
24      public :
25
26         /// Spécifique ///
27         DECLARE_ATTRIBUTE(StdString, group_ref)
28
29         /// Accesseurs ///
30         const boost::unordered_map<StdString,
31                           boost::shared_ptr<Group> >& getGroupMap(void) const;
32         const std::vector<boost::shared_ptr<Child> >& getChildList(void) const;
33
34         void getAllChildren(std::vector<boost::shared_ptr<Child> > & allc) const;
35         std::vector<boost::shared_ptr<Child> > getAllChildren(void) const;
36
37         /// Autres ///
38         virtual StdString toString(void) const;
39         virtual void fromString(const StdString & str);
40
41         virtual void parse(xml::CXMLNode & node);
42         inline void parse(xml::CXMLNode & node, bool withAttr);
43
44         /// Test ///
45         virtual bool hasChild(void) const;
46
47         /// Accesseurs statiques ///
48         static inline StdString GetName(void);
49         static inline StdString GetDefName(void);
50
51         /// Traitements ///
52         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
53         void solveRefInheritance(void);
54
55         /// Destructeur ///
56         virtual ~CGroupTemplate(void);
57
58      protected :
59
60         /// Constructeurs ///
61         CGroupTemplate(void);
62         CGroupTemplate(const StdString & id);
63         CGroupTemplate(const CGroupTemplate<U, V, W> & group,
64                        bool withAttrList = true, bool withId = true); // Not implemented yet.
65         CGroupTemplate(const CGroupTemplate<U, V, W> * const group);  // Not implemented yet.
66
67      private :
68
69         /// Propriétés ///
70         boost::unordered_map<StdString,
71                     boost::shared_ptr<Child> > childMap;
72         std::vector<boost::shared_ptr<Child> > childList;
73
74         boost::unordered_map<StdString,
75                     boost::shared_ptr<Group> > groupMap;
76         std::vector<boost::shared_ptr<Group> > groupList;
77
78   }; // class CGroupTemplate
79} // namespace xmlioserver
80
81#endif // __XMLIO_CGroupTemplate__
Note: See TracBrowser for help on using the repository browser.