#pragma once

/*!***********************************************
* @file
* @brief API declaration of the Iif2fitsKw class.
*/

/*
* MPIA - GEIRS project
*
* $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/src/iif/Interface/Ltcs/Iif/Iif2fitsKw.h 374 2018-01-11 11:43:51Z depa $
*
*/

#include <string>
#include <ostream>
#include <Basda/Vino/FitsCard.h>

using namespace std ;

namespace Ltcs 
{

	/*!*************************************
	* @brief A single item to be requested by the Ice interface to the IIF.
	* @since 2016-10-11
	* @author Richard J. Mathar
	*/
	class Iif2fitsKw {
	
	public:
		/** Name as known in the DD
		*/
		string ddName ;
	
		/** physical unit
		*/
		string unit ;
	
		/** FITS type
		*/
		string type ;
	
		/** FITS comment
		*/
		string comment ;
	
		/** FITS keyword in LN
		*/
		string keyw ;
	
		/** FITS keyword value in LN
		*/
		string val ;
	
		/** Time stamp of most recent update of the keyword
		*/
		time_t updt ;
	
		/* there is no indication/parameter here whether this keyword is in use, because
		* that is already filtered in the ctors in Ltcs2fits; keywords not in use are not constructed.
		*/
	
		/** @brief Type of usage flags. 
		* LSW=1 set means the keyword becomes a FITS COMMENT, not a 
		* standard FITS header card.
		*/
		short flags ;
		
		Iif2fitsKw(const string dd, const string typ, const string key, const string un = "", const string comm="", short bits=0) ;
		string toString() const ;
		string toKVPairString() const ;
		Basda::VinoFitsCard getFits() const ;
	
	protected:
		string tstamp() const ;
	private:
	
	} ; /* Iif2fitsKw */
	
	ostream & operator<<(ostream &os , const Iif2fitsKw & k) ;
}
