FileWriterCDFISTP.hh 3.03 KB
/**
 * FileWriterCDFISTP.hh
 *
 *  Created on: 28 feb. 2022
 *      Author: AKKA
 */

#ifndef FILEWRITERCDFISTP_HH_
#define FILEWRITERCDFISTP_HH_

#include "FileWriterCDF.hh"
#include "ParamMgr.hh"
#include "DataSetMgr.hh"
#include "InstrumentMgr.hh"
#include "MissionMgr.hh"
#include "cdf.h"
#include <map>

#define NB_RECORDS_BUFFER 100000

namespace AMDA {
	namespace ParamOutputImpl {
		namespace Download {
			namespace FileWriter {

				using namespace AMDA::Info;

				/**
				 * @class FileWriterCDFISTP
				 * @brief Implementation of FileWriter for CDF file format compliant with ISTP.
				 * @details
				 */
				class FileWriterCDFISTP : public FileWriterCDF
				{
				public:

					/*
					* @brief Constructor
					*/
					FileWriterCDFISTP(AMDA::Parameters::ParameterManager& pParameterManager);

					/*
					* @brief Destructor
					*/
					virtual ~FileWriterCDFISTP(void);

					/*
					 * @overload FileWriter::addParameter - Add an output parameter in CDF file
					 */
					//virtual bool addParameter(ParamProperties *paramProp, AMDA::Common::ParameterIndexComponentList &indexList,
					//						  FileDataType type, bool isFirstParam, int dim1Size = 1, int dim2Size = 1);


					bool writeTableParamsInfo(std::vector<std::string> tableParams, int level){return true;}
					bool writeAMDAInfo(std::string version, std::string createdby, std::string acknowledgement){return true;}
					bool writeRequestInfo(std::string structure, std::string /* timeFormat */,
													 int timeResolution, std::string outputParams, std::string ttName)
													 {return true;}
					bool writeParamsInfo(ParamPropertiesList &paramPropertiesList, OutputStructure outputStructure,
													std::string currentParamId)
													{return true;}

					bool writeTimeData(std::string /* paramId */, double data, OutputFormatTime /* timeFormat */, bool isFirstParam);



					/*
					 * @overload FileWriter::getExtension - method to get file format extension
					 */
					virtual std::string getExtension(void);


				protected:

					//bool addCDFParameter(std::string outputId, AMDA::Common::ParameterIndexComponentList &indexList,
					//					 FileDataType type, int dim1Size, int dim2Size);
					
					//bool writeMissionInfo(MissionInfoSPtr missionInfo, long varNum);

					/*
					 * @brief Write instrument info attributes in the CDF file
					 */
					//bool writeInstrumentInfo(InstrumentInfoSPtr instrumentInfo, long varNum);

					/*
					 * @brief Write dataset info attributes in the CDF file
					 */
					//bool writeDatasetInfo(DataSetInfoSPtr datasetInfo, long varNum);

					/*
					 * @brief Write parameter info attributes in the CDF file
					 */
					//bool writeParameterInfo(ParamInfoSPtr parameterInfo, long varNum);

				private:
					/*
					 * @brief CDF identifier
					 */
					CDFid _cdfid;

					/*
					 * @brief Map of CDF var info
					 */
					std::map<std::string, ParamCDFVar> _cdfVarMap;
				};

			} /* namespace FileWriter */
		} /* namespace Download */
	} /* namespace ParamOutputImpl */
} /* namespace AMDA */

#endif /* FILEWRITERCDFISTP_HH_ */