paramtranslator.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU 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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_core_paramtranslator_hh
#define mia_core_paramtranslator_hh
#include <map>
#include <set>
#include <string>
#include <ostream>
#include <mia/core/defines.hh>
#include <mia/core/optparam.hh>
NS_MIA_BEGIN
class EXPORT_CORE CParamTranslator
{
public:
CParamTranslator(const char *name);
virtual ~CParamTranslator();
void add_parameter(const std::string& name, CParameter *param);
void set_parameters(const CParsedOptions& options);
void check_parameters();
void get_short_help(std::ostream& os) const;
void get_help(std::ostream& os) const;
void get_help_xml(CXMLElement& root) const;
virtual void do_get_help_xml(CXMLElement& root) const;
const char *get_name() const;
const std::string get_descr() const;
protected:
CParamList& get_parameters();
private:
virtual const std::string do_get_descr() const = 0;
CParamList m_parameters;
// plugin name
const char *m_name;
};
NS_MIA_END
#endif
CParamList
A class to hold a list of named parameters.
Definition optparam.hh:43
CParamTranslator::CParamTranslator
CParamTranslator(const char *name)
CParamTranslator::add_parameter
void add_parameter(const std::string &name, CParameter *param)
CParamTranslator::get_descr
const std::string get_descr() const
CParamTranslator::get_parameters
CParamList & get_parameters()
CParamTranslator::set_parameters
void set_parameters(const CParsedOptions &options)
CParamTranslator::get_name
const char * get_name() const
CParamTranslator::check_parameters
void check_parameters()
CParamTranslator::do_get_help_xml
virtual void do_get_help_xml(CXMLElement &root) const
CParamTranslator::~CParamTranslator
virtual ~CParamTranslator()
CParamTranslator::get_short_help
void get_short_help(std::ostream &os) const
CParamTranslator::get_help
void get_help(std::ostream &os) const
CParamTranslator::get_help_xml
void get_help_xml(CXMLElement &root) const
CParameter
The base class for parameters used in complex options.
Definition parameter.hh:49
CXMLElement
This class implements a facade for the xml Element.
Definition xmlinterface.hh:50
defines.hh
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
EXPORT_CORE
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
CParsedOptions
std::map< std::string, std::string > CParsedOptions
Definition optionparser.hh:38
optparam.hh