ABLATE Source Documentation  0.12.34
ablate::parameters::MapParameters Class Reference
+ Inheritance diagram for ablate::parameters::MapParameters:

Classes

struct  Parameter
 

Public Member Functions

 MapParameters (std::initializer_list< Parameter >)
 
 MapParameters (std::map< std::string, std::string > values={})
 
std::optional< std::string > GetString (std::string paramName) const override
 
std::unordered_set< std::string > GetKeys () const override
 
const std::map< std::string, std::string > & GetMap () const
 
template<class T >
void Insert (std::string key, T value)
 
- Public Member Functions inherited from ablate::parameters::Parameters
template<typename T >
std::optional< T > Get (std::string paramName) const
 
template<typename T >
Get (std::string paramName, T defaultValue) const
 
template<typename T >
GetExpect (std::string paramName) const
 
template<typename T >
std::map< std::string, T > ToMap () const
 
void Fill (PetscOptions options) const
 
template<typename T >
void Fill (int numberValues, const char *const *valueNames, T *constantArray) const
 
template<typename T >
void Fill (int numberValues, const char *const *valueNames, T *constantArray, std::map< std::string, T > defaultValues) const
 

Static Public Member Functions

static std::shared_ptr< MapParametersCreate (std::initializer_list< Parameter >)
 
static std::shared_ptr< MapParametersCreate (const std::map< std::string, std::string > &values)
 

Protected Attributes

std::map< std::string, std::string > values
 

Constructor & Destructor Documentation

◆ MapParameters()

ablate::parameters::MapParameters::MapParameters ( std::initializer_list< Parameter list)

Takes a list of parameters

Member Function Documentation

◆ Create() [1/2]

std::shared_ptr< ablate::parameters::MapParameters > ablate::parameters::MapParameters::Create ( const std::map< std::string, std::string > &  values)
static

static helper function to create a new MapParameters shared pointer from a map of <string, string>

Returns

◆ Create() [2/2]

std::shared_ptr< ablate::parameters::MapParameters > ablate::parameters::MapParameters::Create ( std::initializer_list< Parameter values)
static

static helper function to create a new MapParameters shared pointer from a list of parameters ablate::parameters::MapParameters::Create({{"item1", "value1"}, {"item2", "value2"}, {"item3", 234}});

Returns

◆ GetKeys()

std::unordered_set< std::string > ablate::parameters::MapParameters::GetKeys ( ) const
overridevirtual

List all keys in the domain

Returns

Implements ablate::parameters::Parameters.

◆ GetMap()

const std::map<std::string, std::string>& ablate::parameters::MapParameters::GetMap ( ) const
inline

Provides raw access to the map

Returns

◆ GetString()

std::optional< std::string > ablate::parameters::MapParameters::GetString ( std::string  paramName) const
overridevirtual

Gets string version of parameter

Parameters
paramName
Returns

Implements ablate::parameters::Parameters.

◆ Insert()

template<class T >
void ablate::parameters::MapParameters::Insert ( std::string  key,
value 
)
inline

Allow inserting additional items into a map

Template Parameters
T
Parameters
key
value

The documentation for this class was generated from the following files: