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.
file.hpp in vendors/XIOS/current/src/node – NEMO

source: vendors/XIOS/current/src/node/file.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: 4.0 KB
Line 
1#ifndef __XMLIO_CFile__
2#define __XMLIO_CFile__
3
4/// xios headers ///
5#include "xmlioserver_spl.hpp"
6#include "field.hpp"
7#include "data_output.hpp"
8#include "declare_group.hpp"
9#include "date.hpp"
10
11
12
13namespace xios {
14   
15   /// ////////////////////// Déclarations ////////////////////// ///
16
17   class CFileGroup;
18   class CFileAttributes;
19   class CFile;
20
21   ///--------------------------------------------------------------
22
23   // Declare/Define CFileAttribute
24   BEGIN_DECLARE_ATTRIBUTE_MAP(CFile)
25#  include "file_attribute.conf"
26   END_DECLARE_ATTRIBUTE_MAP(CFile)
27
28   ///--------------------------------------------------------------
29
30   class CFile
31      : public CObjectTemplate<CFile>
32      , public CFileAttributes
33   {
34         /// typedef ///
35         typedef CObjectTemplate<CFile>   SuperClass;
36         typedef CFileAttributes SuperClassAttribute;
37     
38      public :
39         enum EEventId
40         {
41           EVENT_ID_ADD_FIELD=0,EVENT_ID_ADD_FIELD_GROUP
42         } ;
43         
44         typedef CFileAttributes RelAttributes;
45         typedef CFileGroup      RelGroup;
46
47         /// Constructeurs ///
48         CFile(void);
49         explicit CFile(const StdString & id);
50         CFile(const CFile & file);       // Not implemented yet.
51         CFile(const CFile * const file); // Not implemented yet.
52
53         /// Accesseurs ///
54         boost::shared_ptr<CDataOutput> getDataOutput(void) const;
55         CFieldGroup* getVirtualFieldGroup(void) const;
56         std::vector<CField*> getAllFields(void) const;
57
58         std::vector<CField* > getEnabledFields(int default_outputlevel = 5,
59                                                int default_level = 1,
60                                                bool default_enabled = true);
61
62      public :
63
64         /// Mutateurs ///
65         void setVirtualFieldGroup(CFieldGroup* newVFieldGroup);
66         void setVirtualFieldGroup(void);
67
68         void createHeader(void);
69         void close(void) ;
70         
71         /// Traitements ///
72         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
73         void solveFieldRefInheritance(void);
74         void solveEFGridRef(void);
75         void solveEFOperation(void);
76
77         /// Destructeur ///
78         virtual ~CFile(void);
79
80         /// Autres ///
81         virtual void parse(xml::CXMLNode & node);
82         virtual StdString toString(void) const;
83         
84         virtual void toBinary  (StdOStream & os) const;
85         virtual void fromBinary(StdIStream & is);
86
87         /// Accesseurs statiques ///
88         static StdString GetName(void);
89         static StdString GetDefName(void);
90         
91         static ENodeType GetType(void);
92         
93         bool AllDomainEmpty ;
94         CField* addField(const string& id="") ;
95         CFieldGroup* addFieldGroup(const string& id="") ;
96         void sendAddField(const string& id="") ;
97         void sendAddFieldGroup(const string& id="") ;
98         static void recvAddField(CEventServer& event) ;
99         void recvAddField(CBufferIn& buffer) ;
100         static void recvAddFieldGroup(CEventServer& event) ;
101         void recvAddFieldGroup(CBufferIn& buffer) ;
102         static bool dispatchEvent(CEventServer& event) ;
103         bool isSyncTime(void) ;
104         bool checkSplit(void) ;
105         bool checkSync(void) ;
106         void checkFile(void) ;
107         void initFile(void) ;
108         CDate* lastSync ;
109         CDate* lastSplit ;
110         CDuration syncFreq ;
111         CDuration splitFreq ;
112         CDuration outputFreq ;
113         int nbDomain ;
114         bool isOpen ;
115      private :
116
117         /// Propriétés privées ///
118         CFieldGroup* vFieldGroup;
119         boost::shared_ptr<CDataOutput> data_out;
120         std::vector<CField*> enabledFields;
121
122   }; // class CFile
123
124   ///--------------------------------------------------------------
125
126   // Declare/Define CFileGroup and CFileDefinition
127   DECLARE_GROUP(CFile);
128
129   ///--------------------------------------------------------------
130
131} // namespace xios
132
133#endif // __XMLIO_CFile__
Note: See TracBrowser for help on using the repository browser.