NEML2 2.0.0
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Option< T > Class Template Reference

Detailed Description

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

Concrete definition of an option value for a specified type

#include <Option.h>

Inheritance diagram for Option< T >:

Public Member Functions

 Option (const std::string &name)
 
bool operator== (const OptionBase &other) const override
 Test for option equality.
 
bool operator!= (const OptionBase &other) const override
 Test for option inequality.
 
const T & get () const
 
T & set ()
 
void print (std::ostream &) const override
 
std::unique_ptr< OptionBaseclone () const override
 
 Option (const std::string &name)
 
- Public Member Functions inherited from OptionBase
 OptionBase ()=default
 
 OptionBase (OptionBase &&)=delete
 
 OptionBase (const OptionBase &)=delete
 
OptionBaseoperator= (const OptionBase &)=delete
 
OptionBaseoperator= (OptionBase &&)=delete
 
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 FTypeftype () const
 A readonly reference to the option's ftype.
 
FTypeftype ()
 A writable reference to the option's ftype.
 
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 bool & suppressed () const
 A readonly reference to the option's suppression status.
 
bool & suppressed ()
 A writable reference to the option's suppression status.
 
const bool & user_specified () const
 A readonly reference to the option's user_specified status.
 
bool & user_specified ()
 A writable reference to the option's user_specified status.
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ Option() [1/2]

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

◆ Option() [2/2]

Option ( const std::string & name)

Member Function Documentation

◆ clone()

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

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

Implements 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 inequality.

Implements OptionBase.

◆ operator==()

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

Test for option equality.

Implements 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 OptionBase.

◆ set()

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