Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92819719
options_handler.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 23, 23:10
Size
1 KB
Mime Type
text/x-c++
Expires
Mon, Nov 25, 23:10 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22522353
Attached To
rSPECMICP SpecMiCP / ReactMiCP
options_handler.hpp
View Options
#ifndef SPECMICP_UTILS_OPTIONSHANDLER_HPP
#define SPECMICP_UTILS_OPTIONSHANDLER_HPP
namespace specmicp {
//! \brief Class that handles the options
template <class OptionsClass>
class OptionsHandler
{
public:
//! \brief Initializa with the default options
OptionsHandler() {}
//! \brief Initialise the options class using the arguments provided
template <typename... Args>
OptionsHandler(Args... args):
m_options(args...)
{}
//! \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);}
//! \brief Reset to default options
void reset_to_default() {m_options = OptionsClass();}
private:
OptionsClass m_options; //!< The options
};
} // end namespace specmicp
#endif // SPECMICP_UTILS_OPTIONSHANDLER_HPP
Event Timeline
Log In to Comment