[152] | 1 | #ifndef __XMLIO_CGroupTemplate__ |
---|
| 2 | #define __XMLIO_CGroupTemplate__ |
---|
| 3 | |
---|
| 4 | #include "declare_attribute.hpp" |
---|
| 5 | |
---|
| 6 | namespace 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 xios_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); |
---|
[172] | 40 | |
---|
| 41 | virtual void toBinary (StdOStream & os) const; |
---|
| 42 | virtual void fromBinary(StdIStream & is); |
---|
[152] | 43 | |
---|
| 44 | virtual void parse(xml::CXMLNode & node); |
---|
| 45 | inline void parse(xml::CXMLNode & node, bool withAttr); |
---|
[168] | 46 | |
---|
[152] | 47 | /// Test /// |
---|
| 48 | virtual bool hasChild(void) const; |
---|
| 49 | |
---|
| 50 | /// Accesseurs statiques /// |
---|
| 51 | static inline StdString GetName(void); |
---|
| 52 | static inline StdString GetDefName(void); |
---|
| 53 | |
---|
| 54 | /// Traitements /// |
---|
| 55 | virtual void solveDescInheritance(const CAttributeMap * const parent = 0); |
---|
| 56 | void solveRefInheritance(void); |
---|
| 57 | |
---|
| 58 | /// Destructeur /// |
---|
| 59 | virtual ~CGroupTemplate(void); |
---|
| 60 | |
---|
| 61 | protected : |
---|
| 62 | |
---|
| 63 | /// Constructeurs /// |
---|
| 64 | CGroupTemplate(void); |
---|
| 65 | CGroupTemplate(const StdString & id); |
---|
| 66 | CGroupTemplate(const CGroupTemplate<U, V, W> & group, |
---|
| 67 | bool withAttrList = true, bool withId = true); // Not implemented yet. |
---|
| 68 | CGroupTemplate(const CGroupTemplate<U, V, W> * const group); // Not implemented yet. |
---|
| 69 | |
---|
| 70 | private : |
---|
| 71 | |
---|
| 72 | /// Propriétés /// |
---|
| 73 | xios_map<StdString, |
---|
| 74 | boost::shared_ptr<Child> > childMap; |
---|
| 75 | std::vector<boost::shared_ptr<Child> > childList; |
---|
| 76 | |
---|
| 77 | xios_map<StdString, |
---|
| 78 | boost::shared_ptr<Group> > groupMap; |
---|
| 79 | std::vector<boost::shared_ptr<Group> > groupList; |
---|
| 80 | |
---|
| 81 | }; // class CGroupTemplate |
---|
| 82 | } // namespace xmlioserver |
---|
| 83 | |
---|
| 84 | #endif // __XMLIO_CGroupTemplate__ |
---|