#ifndef _atm_AMolecularSQLManager_h_
#define _atm_AMolecularSQLManager_h_

#include <utl/ErrorLogger.h>
#include <utl/config.h>

#ifdef AUGER_SQLITE_ENABLED
#include <det/VSQLManager_SQLite.h>
#else
#include <det/VSQLManager_MySQL.h>
#endif


namespace atm {

  /**
    \class AMolecularSQLManager
    \brief Manager for molecular portion of atmospheric monitoring database

    \author Luis Prado Jr
    \author Tom Paul
    \author Darko Veberic
    \version $Id: AMolecularSQLManager.h 18230 2011-01-03 17:15:30Z dembinski $
    \date 22 Mar 2004
    \date 12 Jan 2007 DV update
    \ingroup managers
  */

  class AMolecularSQLManager : public det::VSQLManager {

  public:
    VSQLMANAGER_GETDATA_GETDBDATA(double)
    VSQLMANAGER_GETDATA_GETDBDATA(int)
    VSQLMANAGER_GETDATA_GETDBDATA(std::string)
    VMANAGER_GETDATA_CALL(GetDBDataCheckTranspose, std::vector<double>)
    VSQLMANAGER_GETDATA_GETDBDATA(std::vector<int>)
    VSQLMANAGER_GETDATA_GETDBDATA(std::vector<std::string>)

    VMANAGER_GETDATA_DENIED(std::vector<bool>)
    VMANAGER_GETDATA_DENIED(utl::TabulatedFunction)
    VMANAGER_GETDATA_DENIED(utl::TabulatedFunctionComplexLgAmpPhase)
    VMANAGER_GETDATA_DENIED(std::list<double>)
    VMANAGER_GETDATA_DENIED(std::list<int>)
    VMANAGER_GETDATA_DENIED(std::list<std::string>)
    VMANAGER_GETDATA_DENIED(std::list<std::pair<int, int> >)
    VMANAGER_GETDATA_DENIED(std::map<int, utl::TabulatedFunction>)
    VMANAGER_GETDATA_DENIED(std::map<std::string, double>)


  private:
    // Helper methods that sends the DB query and retrieves a MYSQL_RES*.
    // This method is present mainly to separate the comparitively verbose
    // query code from the shorter bit of code which uses the templated type.

    // for fundamental types
    virtual Status GetDBResFundamental(const std::string& tableName,
                                       const std::string& columnName,
                                       const IndexMap& componentIndex) const;

    // for vector of fundamental types
    virtual Status GetDBResVector(const std::string& tableName,
                                  const std::string& columnName,
                                  const IndexMap& componentIndex) const;

    virtual Status GetDBDataCheckTranspose(std::vector<double>& returnData,
                                           const std::string& tableName,
                                           const std::string& columnName,
                                           const IndexMap& componentIndex) const;
  };

}


#endif

// Configure (x)emacs for this file ...
// Local Variables:
// mode: c++
// End: