[591] | 1 | #ifndef __XIOS_DATA_OUTPUT__ |
---|
| 2 | #define __XIOS_DATA_OUTPUT__ |
---|
[219] | 3 | |
---|
[591] | 4 | /// XIOS headers /// |
---|
| 5 | #include "xios_spl.hpp" |
---|
[219] | 6 | #include "exception.hpp" |
---|
| 7 | #include "grid.hpp" |
---|
| 8 | #include "field.hpp" |
---|
| 9 | |
---|
| 10 | |
---|
[335] | 11 | namespace xios |
---|
[219] | 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 /// |
---|
[676] | 22 | void writeFile (CFile* file); |
---|
| 23 | void writeAttribute(CVariable* var); |
---|
| 24 | void syncFile (void); |
---|
[286] | 25 | void closeFile (void); |
---|
[347] | 26 | void writeField (CField* field); |
---|
[1158] | 27 | void writeFieldTimeAxis(CField* field) ; |
---|
[347] | 28 | void writeFieldGrid(CField* field); |
---|
[391] | 29 | void writeTimeDimension(void); |
---|
[347] | 30 | void writeFieldData(CField* field); |
---|
[219] | 31 | |
---|
| 32 | virtual void definition_start(void) = 0; |
---|
| 33 | virtual void definition_end(void) = 0; |
---|
| 34 | |
---|
[528] | 35 | //!< Test if the file was opened in append mode |
---|
| 36 | virtual bool IsInAppendMode() const { return appendMode; }; |
---|
| 37 | |
---|
[219] | 38 | virtual ~CDataOutput(void); |
---|
| 39 | |
---|
| 40 | protected: |
---|
| 41 | |
---|
| 42 | /// Ecriture /// |
---|
[676] | 43 | void writeGrid(CGrid* grid, bool allowCompressedOutput = false); |
---|
| 44 | void writeGrid(CDomain* domain, CAxis* axis); |
---|
[347] | 45 | void writeGrid(CDomain* domain); |
---|
[540] | 46 | void writeGrid(std::vector<CDomain*> domain, std::vector<CAxis*> axis); |
---|
[887] | 47 | void writeGrid(std::vector<CDomain*> domains, std::vector<CAxis*> axis, std::vector<CScalar*> scalars); |
---|
[219] | 48 | |
---|
[676] | 49 | virtual void writeFile_ (CFile* file) = 0; |
---|
| 50 | virtual void writeAttribute_(CVariable* var) = 0; |
---|
| 51 | virtual void closeFile_ (void) = 0; |
---|
| 52 | virtual void syncFile_ (void) = 0; |
---|
| 53 | virtual void writeField_ (CField* field) = 0; |
---|
| 54 | virtual void writeFieldData_(CField* field) = 0; |
---|
| 55 | virtual void writeDomain_ (CDomain* domain) = 0; |
---|
| 56 | virtual void writeAxis_ (CAxis* axis) = 0; |
---|
[887] | 57 | virtual void writeScalar_ (CScalar* scalar) = 0; |
---|
[676] | 58 | virtual void writeGridCompressed_(CGrid* grid) = 0; |
---|
| 59 | virtual void writeTimeDimension_(void) = 0; |
---|
| 60 | virtual void writeTimeAxis_ (CField* field, |
---|
[1542] | 61 | const std::shared_ptr<CCalendar> cal) = 0; |
---|
[219] | 62 | |
---|
| 63 | /// Propriétés protégées /// |
---|
| 64 | EDataOutputType type; |
---|
[528] | 65 | bool appendMode; //!< If true, we are appending data to an existing file |
---|
[219] | 66 | |
---|
| 67 | }; // class CDataOutput |
---|
| 68 | |
---|
[335] | 69 | } // namespace xios |
---|
[219] | 70 | |
---|
[591] | 71 | #endif //__XIOS_DATA_OUTPUT__ |
---|