/*
    Copyright (C) 2012 Bartosz Broda, Jacek Bochenek, Łukasz Biłeńkij, 
    Damian Jaworski, Wojciech Mazur, Dominik Piasecki, Maciej Piasecki, 
    Radosław Ramocki
    
    This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.

    This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. 

    See the LICENSE and COPYING files for more details.
*/

#ifndef WBST_OPTIONS_H
#define WBST_OPTIONS_H

#include "wbst_headers.h"
#include "question.h"


class WBSTOptions
{
				public:
	/**
	  * Constructor loading options from input arguments
	  * \param ac Input argument count
	  * \param av Input arguments
	  */
	WBSTOptions(int argc, char* argv[]);

	/**
	  * Functions getter
	  * \returns Vector with functions
	  */
	std::vector< std::string > & GetFunctions();

	/**
	  * Matrices paths getter
	  * \returns Vector with matrices paths
	  */
	std::vector< std::pair<std::string, std::string> >& GetPathToMatrixVector();
	/**
	  * WBST files getter
	  * \returns Vector with WBST files
	  */
	std::vector<std::string>  GetWBSTFiles();

	/**
	  * Output path getter
	  * \returns Ouput path
	  */
	std::string GetOutDir() const;

	/**
	  * Flex class getter
	  * \returns Flex class
	  */
	const std::string & GetFlexClass() const;

	/**
	  * Function getting ccs attribute value
	  * \returns Information whether matrices should be load using CCS files or not
	  */

	bool GetLoadCCS() const;

	/**
	  * \returns Information, whether program should compute each test for only 1 function (1 to 1 in configuration file)
	  *								or make a bruteforce test - all functions with all tests
	  */
	bool GetNoLoop() const;
	/**
	  * \returns Information, whether slave nodes should save results of each test to .txt file in XML format, or not
	  */
	bool GetNoXML() const;

	bool GetSortResults() const;

				private:
	std::vector<std::string> m_vWBSTFiles;
	std::vector<std::string> m_vMatricesPaths;
	std::vector<std::string> m_vFunctions;
	std::vector< std::pair<std::string, std::string> > m_vPathToMatrix;
	std::string m_sOutDir;
	std::string m_sConfigFile;
	std::string m_sFlexClass;
	bool m_bLoadCCS;
	bool noLoop;
	bool noXML;
	bool sortResults;

	/**
	  *  Function initializing options based on input parameters
	  * \param ac Input argument count
	  * \param av Input arguments
	  */
	void InitalizeOptions(int argc, char*argv[]);
	/**
	  * Function parsing options
	  */
	void ParseOptions();
	/**
	  * Function checking if specified matrices exist
	  */
	void CheckMatrices();

	/**
	  * Function checking if specified functions are correct
	  */
	void CheckFunctions();

	boost::program_options::options_description m_Options;
	boost::program_options::variables_map m_VarMap;
};


#endif //WBST_OPTIONS_H

