Specialized factory for generic Action System objects. More...
#include <ActionFactory.h>
Classes | |
struct | BuildInfo |
Public Types | |
typedef std::multimap< std::string, BuildInfo >::iterator | iterator |
Typedef for registered Action iterator. More... | |
typedef std::multimap< std::string, BuildInfo >::const_iterator | const_iterator |
Public Member Functions | |
ActionFactory (MooseApp &app) | |
virtual | ~ActionFactory () |
MooseApp & | app () |
void | reg (std::shared_ptr< RegistryEntryBase > obj) |
FileLineInfo | getLineInfo (const std::string &name, const std::string &task) const |
Gets file and line information where an action was registered. More... | |
std::string | getTaskName (const std::string &action) |
std::shared_ptr< Action > | create (const std::string &action, const std::string &action_name, InputParameters ¶meters) |
InputParameters | getValidParams (const std::string &name) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
std::pair< std::multimap< std::string, std::string >::const_iterator, std::multimap< std::string, std::string >::const_iterator > | getActionsByTask (const std::string &task) const |
std::set< std::string > | getTasksByAction (const std::string &action) const |
bool | isRegisteredTask (const std::string &task) const |
Whether or not a task with the name task is registered. More... | |
const InputParameters * | currentlyConstructing () const |
Static Private Member Functions | |
template<class T > | |
static std::shared_ptr< Action > | buildAction (const InputParameters ¶meters) |
Private Attributes | |
MooseApp & | _app |
std::multimap< std::string, BuildInfo > | _name_to_build_info |
FileLineInfoMap | _name_to_line |
std::multimap< std::string, std::string > | _task_to_action_map |
std::set< std::pair< std::string, std::string > > | _current_objs |
set<objectname, task> used to track if an object previously added is being added again More... | |
std::set< std::string > | _tasks |
The registered tasks. More... | |
std::vector< const InputParameters * > | _currently_constructing |
The object's parameters that are currently being constructed (if any). More... | |
Specialized factory for generic Action System objects.
Definition at line 50 of file ActionFactory.h.
typedef std::multimap<std::string, BuildInfo>::const_iterator ActionFactory::const_iterator |
Definition at line 84 of file ActionFactory.h.
typedef std::multimap<std::string, BuildInfo>::iterator ActionFactory::iterator |
Typedef for registered Action iterator.
Definition at line 83 of file ActionFactory.h.
ActionFactory::ActionFactory | ( | MooseApp & | app | ) |
Definition at line 16 of file ActionFactory.C.
|
virtual |
Definition at line 18 of file ActionFactory.C.
|
inline |
Definition at line 57 of file ActionFactory.h.
ActionFactory::iterator ActionFactory::begin | ( | ) |
Definition at line 124 of file ActionFactory.C.
ActionFactory::const_iterator ActionFactory::begin | ( | ) | const |
Definition at line 130 of file ActionFactory.C.
|
inlinestaticprivate |
Definition at line 113 of file ActionFactory.h.
std::shared_ptr< Action > ActionFactory::create | ( | const std::string & | action, |
const std::string & | action_name, | ||
InputParameters & | parameters | ||
) |
Definition at line 39 of file ActionFactory.C.
Referenced by ActionWarehouse::buildBuildableActions(), CommonOutputAction::create(), AddVariableAction::createInitialConditionAction(), MooseApp::createMinimalApp(), CreateExecutionerAction::setupAutoPreconditioning(), ReadExecutorParamsAction::setupAutoPreconditioning(), and Moose::Builder::walkRaw().
const InputParameters * ActionFactory::currentlyConstructing | ( | ) | const |
Can be used to ensure that all Actions are created using the ActionFactory
Definition at line 171 of file ActionFactory.C.
Referenced by Action::Action().
ActionFactory::iterator ActionFactory::end | ( | ) |
Definition at line 136 of file ActionFactory.C.
ActionFactory::const_iterator ActionFactory::end | ( | ) | const |
Definition at line 142 of file ActionFactory.C.
std::pair< std::multimap< std::string, std::string >::const_iterator, std::multimap< std::string, std::string >::const_iterator > ActionFactory::getActionsByTask | ( | const std::string & | task | ) | const |
Definition at line 149 of file ActionFactory.C.
Referenced by ActionWarehouse::buildBuildableActions().
FileLineInfo ActionFactory::getLineInfo | ( | const std::string & | name, |
const std::string & | task | ||
) | const |
Gets file and line information where an action was registered.
name | Action name |
task | task name |
Definition at line 177 of file ActionFactory.C.
Referenced by Moose::Builder::buildJsonSyntaxTree().
std::string ActionFactory::getTaskName | ( | const std::string & | action | ) |
Definition at line 112 of file ActionFactory.C.
Referenced by Moose::Builder::buildFullTree(), and Moose::Builder::buildJsonSyntaxTree().
std::set< std::string > ActionFactory::getTasksByAction | ( | const std::string & | action | ) | const |
Definition at line 155 of file ActionFactory.C.
Referenced by ActionWarehouse::addActionBlock(), Moose::Builder::buildJsonSyntaxTree(), PhysicsBase::checkRequiredTasks(), and MooseServer::getActionParameters().
InputParameters ActionFactory::getValidParams | ( | const std::string & | name | ) |
If an Action is registered more than once, it'll appear in the _name_to_build_info data structure multiple times. The actual parameters function remains the same however so we can safely use the first instance
Definition at line 92 of file ActionFactory.C.
Referenced by ActionWarehouse::buildBuildableActions(), Moose::Builder::buildFullTree(), Moose::Builder::buildJsonSyntaxTree(), AddVariableAction::createInitialConditionAction(), MooseApp::createMinimalApp(), MooseServer::getActionParameters(), Moose::Builder::listValidParams(), ReadExecutorParamsAction::setupAutoPreconditioning(), CreateExecutionerAction::setupAutoPreconditioning(), and Moose::Builder::walkRaw().
|
inline |
Whether or not a task with the name task
is registered.
Definition at line 101 of file ActionFactory.h.
Referenced by ActionWarehouse::hasTask().
void ActionFactory::reg | ( | std::shared_ptr< RegistryEntryBase > | obj | ) |
Definition at line 21 of file ActionFactory.C.
Referenced by Registry::registerActionsTo().
|
private |
Definition at line 118 of file ActionFactory.h.
Referenced by app(), create(), and getValidParams().
|
private |
set<objectname, task> used to track if an object previously added is being added again
Definition at line 126 of file ActionFactory.h.
Referenced by reg().
|
private |
The object's parameters that are currently being constructed (if any).
This is a vector because we create within create, thus the last entry is the one that is being constructed at the moment
Definition at line 134 of file ActionFactory.h.
Referenced by create(), and currentlyConstructing().
|
private |
Definition at line 120 of file ActionFactory.h.
Referenced by begin(), create(), end(), getTaskName(), getTasksByAction(), getValidParams(), and reg().
|
private |
Definition at line 122 of file ActionFactory.h.
Referenced by getLineInfo(), and reg().
|
private |
Definition at line 123 of file ActionFactory.h.
Referenced by getActionsByTask(), and reg().
|
private |
The registered tasks.
Definition at line 129 of file ActionFactory.h.
Referenced by isRegisteredTask(), and reg().