17 #ifdef MOOSE_UNIT_TEST 18 #include "gtest/gtest.h" 29 #define registerApp(name) AppFactory::instance().reg<name>(#name) 52 return std::make_shared<T>(params);
88 MPI_Comm comm_word = MPI_COMM_WORLD);
95 void reg(
const std::string &
name);
121 #ifdef MOOSE_UNIT_TEST 143 const std::string &
name,
145 MPI_Comm COMM_WORLD_IN);
206 #ifdef MOOSE_UNIT_TEST 208 FRIEND_TEST(::AppFactoryTest, appCopyConstructParams);
215 template <
typename T>
224 name,
true,
"MOOSE application " +
name +
" is available.");
bool isRegistered(const std::string &app_name) const
Returns a Boolean indicating whether an application type has been registered.
std::string name(const ElemQuality q)
MooseAppPtr createShared(const std::string &app_type, const std::string &name, InputParameters parameters, MPI_Comm COMM_WORLD_IN)
Build an application object (must be registered)
virtual MooseAppPtr build(const InputParameters ¶ms)=0
const InputParameters & storeAppParams(InputParameters ¶ms)
Stores the given parameters within _input_parameters for app construction.
const InputParameters & getAppParams(const InputParameters ¶ms) const
class GTEST_TEST_CLASS_NAME_(AppFactoryTest, manageAppParams)
Base class for MOOSE-based applications.
const InputParameters & parameters()
Get the parameters of the object.
virtual const std::string & name() const
Get the name of the class.
InputParameters validParams()
static InputParameters validParams()
std::shared_ptr< MooseApp > MooseAppPtr
alias to wrap shared pointer type
const auto & registeredObjects() const
Returns a reference to the map from names to AppFactoryBuildInfo pointers.
Generic AppFactory class for building Application objects.
void clearAppParams(const InputParameters ¶ms, const ClearAppParamsKey)
Clears the stored parameters for the given application parameteres.
AppFactoryBuildInfoMap _name_to_build_info
virtual InputParameters buildParameters()=0
ClearAppParamsKey(const ClearAppParamsKey &)
std::size_t createdAppCount(const std::string &app_type) const
FRIEND_TEST(::AppFactoryTest, manageAppParams)
std::size_t _app_creation_count
std::map< std::size_t, std::unique_ptr< InputParameters > > _input_parameters
Storage of input parameters used in applications (ID (from getAppParamsID()) -> params) ...
FRIEND_TEST(::AppFactoryTest, manageAppParams)
void reg(const std::string &name)
Register a new object.
static MooseAppPtr createAppShared(int argc, char **argv, std::unique_ptr< Parser > parser)
Helper function for creating a MooseApp from command-line arguments and a Parser. ...
static AppFactory & instance()
Get the instance of the AppFactory.
static Capabilities & getCapabilityRegistry()
std::size_t getAppParamsID(const InputParameters ¶ms) const
Get the ID for the InputParameters associated with an application, used in storing them in _input_par...
virtual InputParameters buildParameters() override
const AppFactoryBuildInfoMap & registeredObjectBuildInfos() const
Returns the map of object name to a function pointer for building said object's input parameters...
virtual MooseAppPtr build(const InputParameters ¶ms) override
Registry & operator=(AppFactory const &)=delete
Class that is used as a parameter to clearAppParams() that allows only MooseApp to call clearAppParam...
InputParameters getValidParams(const std::string &name)
Get valid parameters for the object.
std::map< std::string, std::unique_ptr< AppFactoryBuildInfoBase > > AppFactoryBuildInfoMap
The registry is used as a global singleton to collect information on all available MooseObject and Ac...
Polymorphic data structure with parameter and object build access.
void add(const std::string &capability, CapabilityUtils::Type value, const std::string &doc)
register a new capability
virtual ~AppFactoryBuildInfoBase()=default