New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
group_template.hpp in vendors/XIOS/current/src – NEMO

source: vendors/XIOS/current/src/group_template.hpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1#ifndef __XMLIO_CGroupTemplate__
2#define __XMLIO_CGroupTemplate__
3
4#include "xmlioserver_spl.hpp"
5#include "declare_attribute.hpp"
6#include "event_server.hpp"
7#include "object_template.hpp"
8
9namespace xios
10{
11
12   /// ////////////////////// Déclarations ////////////////////// ///
13   template <class U, class V, class W>
14      class CGroupTemplate
15         : public CObjectTemplate<V>, public virtual W
16   {
17         /// Friend ///
18         friend class CGroupFactory;
19
20         /// Typedef ///
21         typedef U Child;
22         typedef V Derived, Group;
23         typedef W SuperClassAttribute;
24         typedef CObjectTemplate<V> SuperClass;
25
26      public :
27     
28         enum EEventId
29         {
30           EVENT_ID_CREATE_CHILD=200, EVENT_ID_CREATE_CHILD_GROUP
31         } ;
32
33         /// Spécifique ///
34         DECLARE_ATTRIBUTE(StdString, group_ref)
35
36         /// Accesseurs ///
37         const xios_map<StdString,Group*>& getGroupMap(void) const;
38         const vector<Child*>& getChildList(void) const;
39
40         void getAllChildren(vector<Child*> & allc) const;
41         vector<Child*> getAllChildren(void) const;
42
43         /// Autres ///
44         virtual StdString toString(void) const;
45         virtual void fromString(const StdString & str);
46         
47         virtual void toBinary  (StdOStream & os) const;
48         virtual void fromBinary(StdIStream & is);
49
50         virtual void parse(xml::CXMLNode & node);
51         virtual void parse(xml::CXMLNode & node, bool withAttr);
52         
53         /// Test ///
54         virtual bool hasChild(void) const;
55
56         /// Accesseurs statiques ///
57         static inline StdString GetName(void);
58         static inline StdString GetDefName(void);
59
60         /// Traitements ///
61         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
62         void solveRefInheritance(void);
63//         static bool has(const string & id);
64//         static boost::shared_ptr<V> get(const string& id) ;
65//         static boost::shared_ptr<V> create(const string& id=string("")) ;
66         U* createChild(const string& id="") ;
67         
68         void addChild(U* child) ; 
69         V* createChildGroup(const string& id="") ; 
70         void addChildGroup(V* childGroup) ; 
71         static bool dispatchEvent(CEventServer& event) ;
72         void sendCreateChild(const string& id="") ;
73         void sendCreateChildGroup(const string& id="") ;
74         static void recvCreateChild(CEventServer& event) ;
75         void recvCreateChild(CBufferIn& buffer) ;
76         static void recvCreateChildGroup(CEventServer& event) ;
77         void recvCreateChildGroup(CBufferIn& buffer) ;
78         
79         /// Destructeur ///
80         virtual ~CGroupTemplate(void);
81
82      protected :
83
84         /// Constructeurs ///
85         CGroupTemplate(void);
86         CGroupTemplate(const StdString & id);
87         CGroupTemplate(const CGroupTemplate<U, V, W> & group,
88                        bool withAttrList = true, bool withId = true); // Not implemented yet.
89         CGroupTemplate(const CGroupTemplate<U, V, W> * const group);  // Not implemented yet.
90
91      private :
92
93         /// Propriétés ///
94         xios_map<StdString, Child* > childMap;
95         vector<Child*> childList;
96
97         xios_map<StdString,Group* > groupMap;
98         vector<Group* > groupList;
99
100   }; // class CGroupTemplate
101} // namespace xios
102
103//#include "group_template_impl.hpp"
104
105#endif // __XMLIO_CGroupTemplate__
Note: See TracBrowser for help on using the repository browser.