source: XMLIO_V2/dev/common/src/xmlio/node/file.hpp @ 286

Last change on this file since 286 was 286, checked in by ymipsl, 13 years ago

reprise en main de la version de H. Ozdoba. Correction de différentes erreurs de conception et bug.
Version NEMO operationnel en client/server, interoperabilita avec OASIS, reconstition de fichiers via netcdf4/HDF5

YM

File size: 3.2 KB
Line 
1#ifndef __XMLIO_CFile__
2#define __XMLIO_CFile__
3
4/// xmlioserver headers ///
5#include "xmlioserver_spl.hpp"
6#include "field.hpp"
7#include "declare_group.hpp"
8
9#include "data_output.hpp"
10
11namespace xmlioserver {
12namespace tree {
13   
14   /// ////////////////////// Déclarations ////////////////////// ///
15
16   class CFileGroup;
17   class CFileAttributes;
18   class CFile;
19
20   ///--------------------------------------------------------------
21
22   // Declare/Define CFileAttribute
23   BEGIN_DECLARE_ATTRIBUTE_MAP(CFile)
24#  include "file_attribute.conf"
25   END_DECLARE_ATTRIBUTE_MAP(CFile)
26
27   ///--------------------------------------------------------------
28
29   class CFile
30      : public CObjectTemplate<CFile>
31      , public CFileAttributes
32   {
33         /// typedef ///
34         typedef CObjectTemplate<CFile>   SuperClass;
35         typedef CFileAttributes SuperClassAttribute;
36
37      public :
38
39         typedef CFileAttributes RelAttributes;
40         typedef CFileGroup      RelGroup;
41
42         /// Constructeurs ///
43         CFile(void);
44         explicit CFile(const StdString & id);
45         CFile(const CFile & file);       // Not implemented yet.
46         CFile(const CFile * const file); // Not implemented yet.
47
48         /// Accesseurs ///
49         boost::shared_ptr<io::CDataOutput> getDataOutput(void) const;
50         boost::shared_ptr<CFieldGroup> getVirtualFieldGroup(void) const;
51         std::vector<boost::shared_ptr<CField> > getAllFields(void) const;
52
53         std::vector<boost::shared_ptr<CField> >
54            getEnabledFields(int default_outputlevel = 5,
55                             int default_level = 1,
56                             bool default_enabled = true);
57
58      public :
59
60         /// Mutateurs ///
61         void setVirtualFieldGroup(boost::shared_ptr<CFieldGroup> newVFieldGroup);
62         void setVirtualFieldGroup(const StdString & newVFieldGroupId);
63
64         void initializeDataOutput(boost::shared_ptr<io::CDataOutput> dout);
65         void close(void) ;
66         
67         /// Traitements ///
68         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
69         void solveFieldRefInheritance(void);
70         void solveEFGridRef(void);
71         void solveEFOperation(void);
72
73         /// Destructeur ///
74         virtual ~CFile(void);
75
76         /// Autres ///
77         virtual void parse(xml::CXMLNode & node);
78         virtual StdString toString(void) const;
79         
80         virtual void toBinary  (StdOStream & os) const;
81         virtual void fromBinary(StdIStream & is);
82
83         /// Accesseurs statiques ///
84         static StdString GetName(void);
85         static StdString GetDefName(void);
86         
87         static ENodeType GetType(void);
88
89      private :
90
91         /// Propriétés privées ///
92         boost::shared_ptr<CFieldGroup> vFieldGroup;
93         boost::shared_ptr<io::CDataOutput> data_out;
94         std::vector<boost::shared_ptr<CField> > enabledFields;
95
96   }; // class CFile
97
98   ///--------------------------------------------------------------
99
100   // Declare/Define CFileGroup and CFileDefinition
101   DECLARE_GROUP(CFile);
102
103   ///--------------------------------------------------------------
104
105} // namespace tree
106} // namespace xmlioserver
107
108#endif // __XMLIO_CFile__
Note: See TracBrowser for help on using the repository browser.