source: XIOS/trunk/src/data_output.hpp @ 539

Last change on this file since 539 was 528, checked in by rlacroix, 9 years ago

Add the ability to append data to existing output file(s).

By default existing file(s) will still be overwritten. Set the new file attribute "append" to true if you wish to append data to existing NetCDF file(s).

Note that the append mode is currently not supported when file splitting is used and that the structure of the output file cannot be changed.

  • 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: 2.3 KB
Line 
1#ifndef __XMLIO_DATA_OUTPUT__
2#define __XMLIO_DATA_OUTPUT__
3
4/// xios headers ///
5#include "xmlioserver_spl.hpp"
6#include "exception.hpp"
7#include "grid.hpp"
8#include "field.hpp"
9
10
11namespace xios
12{
13      /// ////////////////////// Déclarations ////////////////////// ///
14      class CDataOutput
15      {
16         public :
17
18            /// Définition de type ///
19            typedef enum { ONE_FILE = 0, MULTI_GROUP, MULTI_FILE } EDataOutputType;
20
21            /// Ecriture ///
22            void writeFile     (CFile*  file);
23            void writeAttribute(CVariable*  var);
24            void syncFile     (void);
25            void closeFile     (void);
26            void writeField    (CField* field);
27            void writeFieldGrid(CField* field);
28            void writeTimeDimension(void);
29            void writeFieldData(CField* field);
30
31            virtual void definition_start(void) = 0;
32            virtual void definition_end(void)   = 0;
33
34            //!< Test if the file was opened in append mode
35            virtual bool IsInAppendMode() const { return appendMode; };
36
37            virtual ~CDataOutput(void);
38
39         protected:
40
41            /// Ecriture ///
42            void writeGrid(CGrid* grid);
43            void writeGrid(CDomain* domain,
44                           CAxis*   axis);
45            void writeGrid(CDomain* domain);
46
47            virtual void writeFile_       (CFile*     file)   = 0;
48            virtual void writeAttribute_(CVariable*  var) = 0 ;
49            virtual void closeFile_       (void)                                            = 0;
50            virtual void syncFile_       (void)                                            = 0;
51            virtual void writeField_      (CField*    field)  = 0;
52            virtual void writeFieldData_  (CField*    field)  = 0;
53            virtual void writeDomain_     (CDomain*   domain) = 0;
54            virtual void writeTimeDimension_ (void) = 0;
55            virtual void writeAxis_       (CAxis*     axis)   = 0;
56            virtual void writeTimeAxis_   (CField*    field,
57                                           const shared_ptr<CCalendar> cal)    = 0;
58
59            /// Propriétés protégées ///
60            EDataOutputType type;
61            bool appendMode; //!< If true, we are appending data to an existing file
62
63      }; // class CDataOutput
64
65} // namespace xios
66
67#endif //__XMLIO_DATA_OUTPUT__
Note: See TracBrowser for help on using the repository browser.