NEML2 1.4.0
Loading...
Searching...
No Matches
OptionSet::Option< T > Class Template Reference

Detailed Description

template<typename T>
class neml2::OptionSet::Option< T >

Concrete definition of an option value for a specified type

#include <OptionSet.h>

Inheritance diagram for OptionSet::Option< T >:

Public Member Functions

 Option (const std::string &name)
 
virtual bool operator== (const OptionBase &other) const override
 Test for option equality.
 
const T & get () const
 
T & set ()
 
virtual void print (std::ostream &) const override
 
virtual std::unique_ptr< OptionBaseclone () const override
 
- Public Member Functions inherited from OptionSet::OptionBase
virtual ~OptionBase ()=default
 
const std::string & name () const
 A readonly reference to the option's name.
 
const std::string & type () const
 A readonly reference to the option's type.
 
const std::string & doc () const
 A readonly reference to the option's docstring.
 
std::string & doc ()
 A writable reference to the option's docstring.
 
const boolsuppressed () const
 A readonly reference to the option's suppression status.
 
boolsuppressed ()
 A writable reference to the option's suppression status.
 

Additional Inherited Members

- Protected Attributes inherited from OptionSet::OptionBase
struct neml2::OptionSet::OptionBase::Metadata _metadata
 

Constructor & Destructor Documentation

◆ Option()

template<typename T >
Option ( const std::string & name)
inline

Member Function Documentation

◆ clone()

template<typename T >
std::unique_ptr< OptionSet::OptionBase > clone ( ) const
overridevirtual

Clone this value. Useful in copy-construction. Must be reimplemented in derived classes.

Implements OptionSet::OptionBase.

◆ get()

template<typename T >
const T & get ( ) const
inline
Returns
A read-only reference to the option value

◆ operator==()

template<typename T >
bool operator== ( const OptionBase & other) const
overridevirtual

Test for option equality.

Implements OptionSet::OptionBase.

◆ print()

template<typename T >
void print ( std::ostream & ) const
overridevirtual

Prints the option value to the specified stream. Must be reimplemented in derived classes.

Implements OptionSet::OptionBase.

◆ set()

template<typename T >
T & set ( )
inline
Returns
A writable reference to the option value