www.mooseframework.org
MooseObjectAction.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "MooseObjectAction.h"
16 #include "MooseUtils.h"
17 #include "Factory.h"
18 
19 template <>
22 {
24  params.addRequiredParam<std::string>(
25  "type", "A string representing the Moose Object that will be built by this Action");
26  params.addParam<bool>("isObjectAction", true, "Indicates that this is a MooseObjectAction.");
27  return params;
28 }
29 
31  : Action(params),
32  _type(getParam<std::string>("type")),
33  // We will create a second parameters object from the main factory unless instructed otherwise
34  _moose_object_pars(!params.have_parameter<bool>("skip_param_construction") ||
35  (params.have_parameter<bool>("skip_param_construction") &&
36  !params.get<bool>("skip_param_construction"))
37  ? _factory.getValidParams(_type)
39 {
40  if (params.have_parameter<std::string>("parser_syntax"))
41  _moose_object_pars.addPrivateParam<std::string>("parser_syntax",
42  params.get<std::string>("parser_syntax"));
43 }
InputParameters validParams< MooseObjectAction >()
void addPrivateParam(const std::string &name, const T &value)
These method add a parameter to the InputParameters object which can be retrieved like any other para...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for actions.
Definition: Action.h:39
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
InputParameters validParams()
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:36
MooseObjectAction(InputParameters params)
InputParameters _moose_object_pars
The parameters for the object to be created.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
InputParameters validParams< Action >()
Definition: Action.C:23