NEML2 1.4.0
Loading...
Searching...
No Matches
OptionCollection Class Reference

A data structure that holds options of multiple objects. More...

Detailed Description

A data structure that holds options of multiple objects.

The OptionCollection is a two layer map, where the first layer key is the section name, e.g. Models, Tensors, Drivers, etc., and the second layer key is the object name.

#include <OptionCollection.h>

Public Member Functions

 OptionCollection ()=default
 
OptionSetsettings ()
 Get global settings.
 
const OptionSetsettings () const
 Get global settings.
 
 operator std::map< std::string, std::map< std::string, OptionSet > > () const
 Implicit conversion to an STL map.
 
std::map< std::string, OptionSet > & operator[] (const std::string &section)
 Get all the object options under a specific section.
 
const std::map< std::string, OptionSet > & operator[] (const std::string &section) const
 Get all the object options under a specific section.
 
const std::map< std::string, std::map< std::string, OptionSet > > & data () const
 Get a read-only reference to the underlying data structure.
 

Constructor & Destructor Documentation

◆ OptionCollection()

OptionCollection ( )
default

Member Function Documentation

◆ data()

const std::map< std::string, std::map< std::string, OptionSet > > & data ( ) const
inline

Get a read-only reference to the underlying data structure.

◆ operator std::map< std::string, std::map< std::string, OptionSet > >()

operator std::map< std::string, std::map< std::string, OptionSet > > ( ) const
inline

Implicit conversion to an STL map.

◆ operator[]() [1/2]

std::map< std::string, OptionSet > & operator[] ( const std::string & section)

Get all the object options under a specific section.

◆ operator[]() [2/2]

const std::map< std::string, OptionSet > & operator[] ( const std::string & section) const

Get all the object options under a specific section.

◆ settings() [1/2]

OptionSet & settings ( )
inline

Get global settings.

◆ settings() [2/2]

const OptionSet & settings ( ) const
inline

Get global settings.