Page MenuHomec4science

options_handler.hpp
No OneTemporary

File Metadata

Created
Sun, Aug 4, 20:06

options_handler.hpp

#ifndef SPECMICP_UTILS_OPTIONSHANDLER_HPP
#define SPECMICP_UTILS_OPTIONSHANDLER_HPP
//! \brief Class that handles the options
template <class OptionsClass>
class OptionsHandler
{
public:
//! \brief Initializa with the default options
OptionsHandler() {}
//! \brief Initialize with given options
OptionsHandler(const OptionsClass& options):
m_options(options)
{}
//! \brief Return a reference to the options
OptionsClass& get_options() {return m_options;}
//! \brief Return a const reference to the options
const OptionsClass& get_options() const {return m_options;}
//! \brief Set the options
void set_options(const OptionsClass& options) {m_options = options;}
//! \brief Swap the options with another set
//!
//! May be useful for temporary change
void swap(OptionsClass& options) {std::swap(m_options, options);}
private:
OptionsClass m_options; //!< The options
};
#endif // SPECMICP_UTILS_OPTIONSHANDLER_HPP

Event Timeline