source: XMLIO_V2/dev/dev_rv/src4/xmlio/group_template.hpp @ 261

Last change on this file since 261 was 261, checked in by hozdoba, 12 years ago

Ajout de classes pour la version 4

File size: 3.2 KB
Line 
1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
3 * ************************************************************************** */
4
5#ifndef __GROUP_TEMPLATE_HPP__
6#define __GROUP_TEMPLATE_HPP__
7
8#ifndef __XIOS_NO_EXTERN
9
10// C++ standard headers
11#include <string>
12#include <iostream>
13#include <vector>
14
15// Boost headers
16#include <boost/shared_ptr.hpp>
17
18#endif // __XIOS_NO_EXTERN
19
20// XMLIOServer headers
21#include "xmlioserver_spl.hpp"
22#include "declare_attribute.hpp"
23#include "xml_node.hpp"
24
25// ////////////////////////////// Déclarations ///////////////////////////// //
26
27namespace xmlioserver
28{
29  template <class U, class V, class W>
30      class CGroupTemplate
31         : public CObjectTemplate<V>, public virtual W
32   {
33      public : // Classe amie
34
35         friend class CGroupFactory;
36
37      public : // // Définition de types
38
39         typedef U Child;
40         typedef V Derived, Group;
41         typedef W SuperClassAttribute;
42         typedef CObjectTemplate<V> SuperClass;
43
44      public : // Attribut spécifique des groupes
45
46         DECLARE_ATTRIBUTE(std::string, group_ref)
47
48      public : // Accesseurs
49
50         const xios_map<std::string,
51                           boost::shared_ptr<Group> > & getGroupMap(void) const;
52         const std::vector<boost::shared_ptr<Child> > & getChildList(void) const;
53
54         void getAllChildren(std::vector<boost::shared_ptr<Child> > & _allc) const;
55         std::vector<boost::shared_ptr<Child> > getAllChildren(void) const;
56
57      public : // Autres
58
59         virtual std::string toString(void) const;
60         virtual void fromString(const std::string & _str);
61         
62         virtual void toBinary  (std::ostream & _os) const;
63         virtual void fromBinary(std::istream & _is);
64
65         virtual void parse(xml::CXMLNode & _node);
66         inline  void parse(xml::CXMLNode & _node, bool _withAttr);
67         
68      public : // Test
69
70         virtual bool hasChild(void) const;
71
72      public : // Accesseurs statiques
73
74         static inline std::string GetName(void);
75         static inline std::string GetDefName(void);
76
77      public : // Traitements
78
79         virtual void solveDescInheritance(const CAttributeMap * const _parent = 0);
80         void solveRefInheritance(void);
81
82      public : // Destructeur
83
84         virtual ~CGroupTemplate(void);
85
86      protected : // Constructeurs
87
88         CGroupTemplate(void);
89         CGroupTemplate(const std::string & _id);
90         CGroupTemplate(const CGroupTemplate<U, V, W> & _group_ref,
91                        bool _withAttrList = true, bool _withId = true);    // Not implemented yet.
92         CGroupTemplate(const CGroupTemplate<U, V, W> * const _group_ptr);  // Not implemented yet.
93
94      private : // Propriétés
95
96         xios_map<std::string,
97                     boost::shared_ptr<Child> > childMap;
98         std::vector<boost::shared_ptr<Child> > childList;
99
100         xios_map<std::string,
101                     boost::shared_ptr<Group> > groupMap;
102         std::vector<boost::shared_ptr<Group> > groupList;
103
104   }; // class CGroupTemplate
105} // namespace xmlioserver
106
107#endif  // __GROUP_TEMPLATE_HPP__
Note: See TracBrowser for help on using the repository browser.