The registry is used as a global singleton to collect information on all available MooseObject and Action classes for use in a moose app/simulation. More...
#include <Registry.h>
Public Member Functions | |
Registry (Registry const &)=delete | |
Don't allow creation through copy/move construction or assignment. More... | |
Registry & | operator= (Registry const &)=delete |
Registry (Registry &&)=delete | |
Registry & | operator= (Registry &&)=delete |
Static Public Member Functions | |
static Registry & | getRegistry () |
Get the global Registry singleton. More... | |
template<typename T > | |
static char | add (const RegistryEntryData &base_info) |
Adds information on a MooseObject to the registry. More... | |
template<typename T > | |
static char | addAction (const RegistryEntryData &base_info) |
Adds information on an Action object to the registry. More... | |
template<typename T > | |
static std::string | getClassName () |
static void | registerObjectsTo (Factory &f, const std::set< std::string > &labels) |
This registers all MooseObjects known to the registry that have the given label(s) with the factory f. More... | |
static void | registerActionsTo (ActionFactory &f, const std::set< std::string > &labels) |
This registers all Actions known to the registry that have the given label(s) with the factory f. More... | |
static char | addKnownLabel (const std::string &label) |
addKnownLabel whitelists a label as valid for purposes of the checkLabels function. More... | |
static void | addDataFilePath (const std::string &path) |
register search paths for built-in data files More... | |
static void | addRepository (const std::string &repo_name, const std::string &repo_url) |
register a repository More... | |
static const std::map< std::string, std::vector< std::shared_ptr< RegistryEntryBase > > > & | allObjects () |
Returns a per-label keyed map of all MooseObjects in the registry. More... | |
static const std::map< std::string, std::vector< std::shared_ptr< RegistryEntryBase > > > & | allActions () |
Returns a per-label keyed map of all Actions in the registry. More... | |
static const RegistryEntryBase & | objData (const std::string &name) |
static bool | isRegisteredObj (const std::string &name) |
static const std::vector< std::string > & | getDataFilePaths () |
Returns a vector of all registered data file paths. More... | |
static const std::string & | getRepositoryURL (const std::string &repo_name) |
Returns the repository URL associated with repo_name . More... | |
template<typename T > | |
static std::string | getRegisteredName () |
returns the name() for a registered class More... | |
Private Member Functions | |
Registry () | |
Private Attributes | |
std::map< std::string, std::shared_ptr< RegistryEntryBase > > | _name_to_entry |
std::map< std::string, std::vector< std::shared_ptr< RegistryEntryBase > > > | _per_label_objects |
std::map< std::string, std::vector< std::shared_ptr< RegistryEntryBase > > > | _per_label_actions |
std::set< std::string > | _known_labels |
std::vector< std::string > | _data_file_paths |
std::map< std::string, std::string > | _repos |
Repository name -> repository URL; used for mooseDocumentedError. More... | |
std::map< std::string, std::string > | _type_to_classname |
The registry is used as a global singleton to collect information on all available MooseObject and Action classes for use in a moose app/simulation.
It must be global because we want+need to be able to register objects in global scope during static initialization time before other parts of the moose app execution have started running. This allows us to distribute registration across all the files that define the actual classes being registered so we don't have to have any central location with a bajillion includes that makes (especially incremental) compiles slow. The registry collects the app, name, and other information for each objects and makes it available to the moose object and action factories and others for general use. All public functions in this class modify and return data from the global singleton.
Definition at line 153 of file Registry.h.
|
delete |
Don't allow creation through copy/move construction or assignment.
|
delete |
|
inlineprivate |
|
inlinestatic |
Adds information on a MooseObject to the registry.
The _build_ptr, _build_action_ptr, and _params_ptr objects of the info object should all be nullptr - these are set automatically by the add function itself using the templated type T.
Definition at line 165 of file Registry.h.
|
inlinestatic |
Adds information on an Action object to the registry.
The _build_ptr, _build_action_ptr, and _params_ptr objects of the info object should all be nullptr - these are set automatically by the addAction function itself using the templated type T.
Definition at line 177 of file Registry.h.
|
static |
register search paths for built-in data files
Definition at line 89 of file Registry.C.
|
static |
addKnownLabel whitelists a label as valid for purposes of the checkLabels function.
Definition at line 82 of file Registry.C.
Referenced by MooseApp::MooseApp().
|
static |
register a repository
Definition at line 107 of file Registry.C.
|
inlinestatic |
Returns a per-label keyed map of all Actions in the registry.
Definition at line 214 of file Registry.h.
Referenced by JsonSyntaxTree::JsonSyntaxTree(), and MooseApp::setupOptions().
|
inlinestatic |
Returns a per-label keyed map of all MooseObjects in the registry.
Definition at line 209 of file Registry.h.
Referenced by JsonSyntaxTree::JsonSyntaxTree(), and MooseApp::setupOptions().
|
inlinestatic |
Definition at line 186 of file Registry.h.
|
inlinestatic |
Returns a vector of all registered data file paths.
Definition at line 230 of file Registry.h.
|
static |
returns the name() for a registered class
Definition at line 265 of file Registry.h.
|
static |
Get the global Registry singleton.
Definition at line 21 of file Registry.C.
Referenced by add(), addAction(), addDataFilePath(), addKnownLabel(), addRepository(), allActions(), allObjects(), getClassName(), DataFileInterface< Action >::getDataFileNameByName(), getDataFilePaths(), getRepositoryURL(), isRegisteredObj(), objData(), registerActionsTo(), and registerObjectsTo().
|
static |
Returns the repository URL associated with repo_name
.
Definition at line 120 of file Registry.C.
Referenced by moose::internal::formatMooseDocumentedError().
|
inlinestatic |
Definition at line 224 of file Registry.h.
Referenced by MooseObject::MooseObject().
|
static |
Definition at line 55 of file Registry.C.
|
static |
This registers all Actions known to the registry that have the given label(s) with the factory f.
Definition at line 66 of file Registry.C.
Referenced by Moose::registerActions().
This registers all MooseObjects known to the registry that have the given label(s) with the factory f.
Definition at line 32 of file Registry.C.
Referenced by Moose::registerObjects().
|
private |
Definition at line 257 of file Registry.h.
Referenced by addDataFilePath(), and getDataFilePaths().
|
private |
Definition at line 256 of file Registry.h.
Referenced by addKnownLabel().
|
private |
Definition at line 251 of file Registry.h.
Referenced by isRegisteredObj().
|
private |
Definition at line 255 of file Registry.h.
Referenced by addAction(), and allActions().
|
private |
Definition at line 254 of file Registry.h.
Referenced by add(), and allObjects().
|
private |
Repository name -> repository URL; used for mooseDocumentedError.
Definition at line 259 of file Registry.h.
Referenced by addRepository(), and getRepositoryURL().
|
private |
Definition at line 260 of file Registry.h.
Referenced by add(), addAction(), and getClassName().