/** @file FitsGenerator.h
 *
 *  @brief ippToPsps
 *
 *  @ingroup ippToPsps
 *
 *  @author IfA
 *  Copyright 2011 Institute for Astronomy, University of Hawaii
 */

#ifndef IPPTOPSPS_FITSGENERATOR_H
#define IPPTOPSPS_FITSGENERATOR_H

#include <psmodules.h>

#include "Logger.h"

// column class
typedef struct Column {

    int ippColNum;
    char ippName[100];
    int ippType;
    long ippRepeat;
    char pspsName[100]; // TODO change to 'name'
    int pspsType;
    bool usingDefault;
    char defaultValue[100];
    char comment[300];

} Column;

// table class
typedef struct Table {

    char name[32];
    Column* columns;
    int numOfColumns;

} Table;

/**

  Class used for generating FITS files.

  - Uses XML table definitions to create table shapes
  - Uses XML map files to populate tables from another FITS files
  - Uses XML data files to populate tables with set values

*/
typedef struct FitsGenerator {

    // fields
    psString configsPath;
    Table* tables;
    int numOfTables;
    Logger* logger;

    // methods
    bool (*createAndPopulateTable)();
    bool (*populateFromFile)();

    // destructor
    void (*destroy)();

} FitsGenerator; 

// constructor
FitsGenerator* new_FitsGenerator(Logger* logger, const char* path);

#endif // IPPTOPSPS_FITSGENERATOR_H

