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

◆ 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 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