optparam.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 ph_optparam_hh
#define ph_optparam_hh
#include <ostream>
#include <memory>
#include <mia/core/parameter.hh>
#include <mia/core/optionparser.hh>
NS_MIA_BEGIN
class CXMLElement;
class EXPORT_CORE CParamList
{
public:
typedef std::shared_ptr<CParameter > PParameter;
bool has_key(const std::string& key) const;
PParameter& operator [] (const std::string& key);
void set(const CParsedOptions& options);
void check_required() const;
void print_help(std::ostream& os)const;
void get_help_xml(CXMLElement& root)const;
void add_dependend_handlers(HandlerHelpMap& handler_map)const;
private:
std::map<std::string, PParameter> m_params;
};
NS_MIA_END
#endif
CParamList
A class to hold a list of named parameters.
Definition optparam.hh:43
CParamList::set
void set(const CParsedOptions &options)
CParamList::has_key
bool has_key(const std::string &key) const
CParamList::PParameter
std::shared_ptr< CParameter > PParameter
a shared pointer to a parameter to make handling easier
Definition optparam.hh:48
CParamList::print_help
void print_help(std::ostream &os) const
CParamList::add_dependend_handlers
void add_dependend_handlers(HandlerHelpMap &handler_map) const
CParamList::check_required
void check_required() const
CParamList::get_help_xml
void get_help_xml(CXMLElement &root) const
CXMLElement
This class implements a facade for the xml Element.
Definition xmlinterface.hh:50
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
HandlerHelpMap
std::map< std::string, const CPluginHandlerBase * > HandlerHelpMap
A map that is used to collect the plug-in handlers used in a program.
Definition handlerbase.hh:45
optionparser.hh
parameter.hh