NEML2 1.4.0
Loading...
Searching...
No Matches
OptionSet::OptionBase Class Referenceabstract

Detailed Description

Abstract definition of an option.

#include <OptionSet.h>

Inheritance diagram for OptionSet::OptionBase:

Classes

struct  Metadata
 

Public Member Functions

virtual ~OptionBase ()=default
 
virtual bool operator== (const OptionBase &other) const =0
 Test for option equality.
 
virtual bool operator!= (const OptionBase &other) const =0
 Test for option inequality.
 
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 boolsuppressed () const
 A readonly reference to the option's suppression status.
 
boolsuppressed ()
 A writable reference to the option's suppression status.
 
virtual void print (std::ostream &) const =0
 
virtual std::unique_ptr< OptionBaseclone () const =0
 

Protected Attributes

struct neml2::OptionSet::OptionBase::Metadata _metadata
 

Constructor & Destructor Documentation

◆ ~OptionBase()

virtual ~OptionBase ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr< OptionBase > clone ( ) const
pure virtual

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

Implemented in OptionSet::Option< T >.

◆ doc() [1/2]

std::string & doc ( )
inline

A writable reference to the option's docstring.

◆ doc() [2/2]

const std::string & doc ( ) const
inline

A readonly reference to the option's docstring.

◆ ftype() [1/2]

FType & ftype ( )
inline

A writable reference to the option's ftype.

◆ ftype() [2/2]

const FType & ftype ( ) const
inline

A readonly reference to the option's ftype.

◆ name()

const std::string & name ( ) const
inline

A readonly reference to the option's name.

◆ operator!=()

virtual bool operator!= ( const OptionBase & other) const
pure virtual

Test for option inequality.

Implemented in OptionSet::Option< T >.

◆ operator==()

virtual bool operator== ( const OptionBase & other) const
pure virtual

Test for option equality.

Implemented in OptionSet::Option< T >.

◆ print()

virtual void print ( std::ostream & ) const
pure virtual

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

Implemented in OptionSet::Option< T >.

◆ suppressed() [1/2]

bool & suppressed ( )
inline

A writable reference to the option's suppression status.

◆ suppressed() [2/2]

const bool & suppressed ( ) const
inline

A readonly reference to the option's suppression status.

◆ type()

const std::string & type ( ) const
inline

A readonly reference to the option's type.

Member Data Documentation

◆ _metadata