source: XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.hpp @ 188

Last change on this file since 188 was 188, checked in by hozdoba, 13 years ago
File size: 3.5 KB
Line 
1#ifndef __XMLIO_NC4_DATA_OUTPUT__
2#define __XMLIO_NC4_DATA_OUTPUT__
3
4/// xmlioserver headers ///
5#include "xmlioserver_spl.hpp"
6#include "onetcdf4.hpp"
7#include "data_output.hpp"
8
9namespace xmlioserver
10{
11   namespace io
12   {
13      /// ////////////////////// Déclarations ////////////////////// ///
14
15      class CNc4DataOutput
16         : protected CONetCDF4
17         , public virtual CDataOutput
18      {
19         public :
20
21            /// Définition de type ///
22            typedef CONetCDF4   SuperClassWriter;
23            typedef CDataOutput SuperClass;
24
25            /// Constructeurs ///
26            CNc4DataOutput
27               (const StdString & filename, bool exist);
28            CNc4DataOutput
29               (const StdString & filename, bool exist, bool multigroup, MPI_Comm comm_server);
30            CNc4DataOutput
31               (const StdString & filename, bool exist, bool multigroup, comm::MPIComm comm_server, bool);
32
33            CNc4DataOutput(const CNc4DataOutput & dataoutput);       // Not implemented.
34            CNc4DataOutput(const CNc4DataOutput * const dataoutput); // Not implemented.
35
36            /// Accesseur ///
37            const StdString & getFileName(void) const;
38
39            /// Destructeur ///
40            virtual ~CNc4DataOutput(void);
41
42         protected :
43
44            /// Ecriture ///
45            virtual void writeDomain_(const boost::shared_ptr<tree::CDomain> domain);
46            virtual void writeAxis_  (const boost::shared_ptr<tree::CAxis>   axis);
47            virtual void writeField_ (const boost::shared_ptr<tree::CField>  field);
48            virtual void writeFile_  (const boost::shared_ptr<tree::CFile>   file);
49
50
51         protected :
52         
53            void writeLocalAttributes(int ibegin, int iend, int jbegin, int jend, StdString domid);
54
55            void writeFileAttributes(const StdString & name,
56                                     const StdString & description,
57                                     const StdString & conventions,
58                                     const StdString & production,
59                                     const StdString & timeStamp);
60
61            void writeMaskAttributes(const StdString & mask_name,
62                                     int data_dim,
63                                     int data_ni     = 0,
64                                     int data_nj     = 0,
65                                     int data_ibegin = 0,
66                                     int data_jbegin = 0);
67
68            void writeAxisAttributes(const StdString & axis_name,
69                                     const StdString & axis,
70                                     const StdString & standard_name,
71                                     const StdString & long_name,
72                                     const StdString & units,
73                                     const StdString & nav_model);
74            template <class T>
75               void writeAxisData(const StdString & axis_name,
76                                  const ARRAY(T, 1) data,
77                                  bool collective, StdSize record,
78                                  const std::vector<StdSize> * start = NULL,
79                                  const std::vector<StdSize> * count = NULL);
80
81         private :
82
83            /// Traitement ///
84            StdString getTimeStamp(void) const;
85
86            /// Propriétés privées ///
87            MPI_Comm comm_server;
88            const StdString filename;
89
90      }; // class CNc4DataOutput
91
92   } // namespace io
93} // namespace xmlioserver
94
95#endif //__XMLIO_NC4_DATA_OUTPUT__
Note: See TracBrowser for help on using the repository browser.