source: XIOS/dev/branch_openmp/src/group_template.hpp @ 1545

Last change on this file since 1545 was 1545, checked in by yushan, 6 years ago

branch_openmp merged with trunk r1544

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
File size: 3.2 KB
RevLine 
[591]1#ifndef __XIOS_CGroupTemplate__
2#define __XIOS_CGroupTemplate__
[219]3
[591]4#include "xios_spl.hpp"
[219]5#include "declare_attribute.hpp"
[300]6#include "event_server.hpp"
7#include "object_template.hpp"
[1460]8#include "context_client.hpp"
[219]9
[335]10namespace xios
[219]11{
12
13   /// ////////////////////// Déclarations ////////////////////// ///
14   template <class U, class V, class W>
15      class CGroupTemplate
16         : public CObjectTemplate<V>, public virtual W
17   {
18         /// Friend ///
19         friend class CGroupFactory;
20
21         /// Typedef ///
22         typedef U Child;
23         typedef V Derived, Group;
24         typedef W SuperClassAttribute;
25         typedef CObjectTemplate<V> SuperClass;
26
27      public :
[300]28     
29         enum EEventId
30         {
31           EVENT_ID_CREATE_CHILD=200, EVENT_ID_CREATE_CHILD_GROUP
32         } ;
[219]33
34         /// Spécifique ///
35         DECLARE_ATTRIBUTE(StdString, group_ref)
36
37         /// Accesseurs ///
[347]38         const xios_map<StdString,Group*>& getGroupMap(void) const;
39         const vector<Child*>& getChildList(void) const;
[219]40
[347]41         void getAllChildren(vector<Child*> & allc) const;
42         vector<Child*> getAllChildren(void) const;
[219]43
44         /// Autres ///
45         virtual StdString toString(void) const;
46         virtual void fromString(const StdString & str);
47         
48
49         virtual void parse(xml::CXMLNode & node);
[274]50         virtual void parse(xml::CXMLNode & node, bool withAttr);
[472]51         virtual void parseChild(xml::CXMLNode & node);
52       
[219]53         /// Test ///
54         virtual bool hasChild(void) const;
55
56         /// Accesseurs statiques ///
[354]57         static StdString GetName(void);
58         static StdString GetDefName(void);
[219]59
60         /// Traitements ///
[445]61         virtual void solveDescInheritance(bool apply, const CAttributeMap * const parent = 0);
[219]62         void solveRefInheritance(void);
[1545]63
64
[347]65         U* createChild(const string& id="") ;
66         
67         void addChild(U* child) ; 
68         V* createChildGroup(const string& id="") ; 
69         void addChildGroup(V* childGroup) ; 
[300]70         static bool dispatchEvent(CEventServer& event) ;
71         void sendCreateChild(const string& id="") ;
[1460]72         void sendCreateChild(const string& id, CContextClient* client) ;
[300]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         
[219]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 ///
[347]94         xios_map<StdString, Child* > childMap;
95         vector<Child*> childList;
[219]96
[347]97         xios_map<StdString,Group* > groupMap;
98         vector<Group* > groupList;
[219]99
100   }; // class CGroupTemplate
[335]101} // namespace xios
[219]102
[300]103//#include "group_template_impl.hpp"
104
[591]105#endif // __XIOS_CGroupTemplate__
Note: See TracBrowser for help on using the repository browser.