Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80833726
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
Mon, Sep 2, 20:11
Size
1 KB
Mime Type
text/x-c++
Expires
Wed, Sep 4, 20:11 (2 d)
Engine
blob
Format
Raw Data
Handle
20461122
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 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