Registry class for material property IDs and names. More...
#include <MaterialPropertyRegistry.h>
Classes | |
class | WriteKey |
Key that restricts writing data to the registry. More... | |
Public Member Functions | |
bool | hasProperty (const std::string &name) const |
bool | hasProperty (const unsigned int id) const |
unsigned int | addOrGetID (const std::string &name, const WriteKey) |
unsigned int | getID (const std::string &name) const |
std::optional< unsigned int > | queryID (const std::string &name) const |
const std::string & | getName (const unsigned int id) const |
auto | idsToNamesBegin () const |
auto | idsToNamesEnd () const |
auto | idsToNamesRange () const |
std::size_t | size () const |
Private Attributes | |
std::unordered_map< std::string, unsigned int > | _name_to_id |
Map of material property name -> material property id. More... | |
std::vector< std::string > | _id_to_name |
Map of material property id -> material property name. More... | |
Registry class for material property IDs and names.
Not thread safe.
Definition at line 26 of file MaterialPropertyRegistry.h.
Protected with the MaterialPropertyRegistry::WriteKey.
Definition at line 15 of file MaterialPropertyRegistry.C.
Referenced by MaterialPropertyStorage::addProperty().
unsigned int MaterialPropertyRegistry::getID | ( | const std::string & | name | ) | const |
name
Will not create an ID if one does not exist, unlike addOrGetPropertyId
Definition at line 29 of file MaterialPropertyRegistry.C.
Referenced by MaterialData::getPropertyId(), and MaterialPropertyStorage::isRestoredProperty().
const std::string & MaterialPropertyRegistry::getName | ( | const unsigned int | id | ) | const |
id
Definition at line 47 of file MaterialPropertyRegistry.C.
Referenced by MaterialBase::checkStatefulSanity(), MaterialPropertyStorage::initStatefulProps(), and MaterialPropertyStorage::queryStatefulPropName().
|
inline |
name
Definition at line 32 of file MaterialPropertyRegistry.h.
Referenced by getName(), and MaterialPropertyStorage::hasProperty().
|
inline |
id
Definition at line 37 of file MaterialPropertyRegistry.h.
|
inline |
Definition at line 78 of file MaterialPropertyRegistry.h.
Referenced by idsToNamesRange().
|
inline |
Definition at line 82 of file MaterialPropertyRegistry.h.
Referenced by idsToNamesRange().
|
inline |
Definition at line 86 of file MaterialPropertyRegistry.h.
std::optional< unsigned int > MaterialPropertyRegistry::queryID | ( | const std::string & | name | ) | const |
name
if a propery exists with the name, otherwise an empty optional Definition at line 38 of file MaterialPropertyRegistry.C.
Referenced by getID().
|
inline |
Definition at line 91 of file MaterialPropertyRegistry.h.
Referenced by MaterialPropertyStorage::addProperty().
|
private |
Map of material property id -> material property name.
Definition at line 97 of file MaterialPropertyRegistry.h.
Referenced by addOrGetID(), getName(), hasProperty(), idsToNamesBegin(), idsToNamesEnd(), and size().
|
private |
Map of material property name -> material property id.
Definition at line 95 of file MaterialPropertyRegistry.h.
Referenced by addOrGetID(), hasProperty(), and queryID().