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

 OptionBase ()=default
 
 OptionBase (OptionBase &&)=delete
 
 OptionBase (const OptionBase &)=delete
 
OptionBaseoperator= (const OptionBase &)=delete
 
OptionBaseoperator= (OptionBase &&)=delete
 
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.
 
const booluser_specified () const
 A readonly reference to the option's user_specified status.
 
booluser_specified ()
 A writable reference to the option's user_specified 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() [1/3]

OptionBase ( )
default

◆ OptionBase() [2/3]

OptionBase ( OptionBase && )
delete

◆ OptionBase() [3/3]

OptionBase ( const OptionBase & )
delete

◆ ~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=() [1/2]

◆ operator=() [2/2]

OptionBase & operator= ( OptionBase && )
delete

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

◆ user_specified() [1/2]

bool & user_specified ( )
inline

A writable reference to the option's user_specified status.

◆ user_specified() [2/2]

const bool & user_specified ( ) const
inline

A readonly reference to the option's user_specified status.

Member Data Documentation

◆ _metadata