26 #define usingMooseBaseMembers \ 27 using MooseBase::getMooseApp; \ 28 using MooseBase::type; \ 29 using MooseBase::name; \ 30 using MooseBase::typeAndName; \ 31 using MooseBase::uniqueName; \ 32 using MooseBase::parameters; \ 33 using MooseBase::isParamValid; \ 34 using MooseBase::isParamSetByUser; \ 35 using MooseBase::paramError; \ 36 using MooseBase::paramWarning; \ 37 using MooseBase::paramInfo; \ 38 using MooseBase::_app; \ 39 using MooseBase::_type; \ 40 using MooseBase::_name; \ 41 using MooseBase::_pars 89 const std::string &
type()
const 91 mooseAssert(
_type.size(),
"Empty type");
99 const std::string &
name()
const 101 mooseAssert(
_name.size(),
"Empty name");
150 template <
typename T>
161 template <
typename T>
171 template <
typename T>
172 const T &
getRenamedParam(
const std::string & old_name,
const std::string & new_name)
const;
180 template <
typename T1,
typename T2>
181 std::vector<std::pair<T1, T2>>
getParam(
const std::string & param1,
182 const std::string & param2)
const;
188 template <
typename T>
215 const std::string & object_type,
216 const std::string & object_name,
217 const std::string & object_parameter)
const;
225 template <
typename... Args>
226 [[noreturn]]
void paramError(
const std::string & param, Args... args)
const;
234 template <
typename... Args>
235 void paramWarning(
const std::string & param, Args... args)
const;
244 template <
typename... Args>
245 void paramInfo(
const std::string & param, Args... args)
const;
266 template <
typename... Args>
269 callMooseError(argumentsToString(std::forward<Args>(args)...),
true);
272 template <
typename... Args>
274 const unsigned int issue_num,
275 Args &&... args)
const 278 repo_name, issue_num, argumentsToString(std::forward<Args>(args)...)),
285 template <
typename... Args>
288 callMooseError(argumentsToString(std::forward<Args>(args)...),
false);
294 template <
typename... Args>
303 template <
typename... Args>
309 template <
typename... Args>
316 template <
typename... Args>
330 callMooseError(std::string msg,
const bool with_prefix,
const hit::Node * node =
nullptr)
const;
348 const bool with_prefix,
349 const hit::Node * node);
382 template <
typename T>
386 return InputParameters::getParamHelper<T>(
name,
_pars);
389 template <
typename T>
396 template <
typename T>
402 return getParam<T>(new_name);
405 return getParam<T>(old_name);
408 return getParam<T>(new_name);
412 "' is being retrieved without being set.\nDid you misspell it?");
415 mooseError(
"Parameter '" + new_name +
"' may not be provided alongside former parameter '" +
419 template <
typename T1,
typename T2>
420 std::vector<std::pair<T1, T2>>
423 return _pars.
get<T1, T2>(param1, param2);
426 template <
typename T>
433 template <
typename... Args>
440 template <
typename... Args>
447 template <
typename... Args>
void mooseInfo(Args &&... args) const
static const std::string name_param
The name of the parameter that contains the object name.
static const std::string app_param
The name of the parameter that contains the MooseApp.
const InputParameters & _pars
The object's parameters.
void callMooseError(std::string msg, const bool with_prefix, const hit::Node *node=nullptr) const
External method for calling moose error with added object context.
const std::string & _name
The name of this class.
Base class for everything in MOOSE with a name and a type.
static const std::string type_param
The name of the parameter that contains the object type.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
const InputParameters & parameters() const
Get the parameters of the object.
Base class for MOOSE-based applications.
void mooseDocumentedError(const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
MooseObjectName uniqueName() const
MooseObjectParameterName uniqueParameterName(const std::string ¶meter_name) const
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
static const std::string unique_name_param
The name of the parameter that contains the unique object name.
void mooseInfoStream(S &oss, Args &&... args)
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
void mooseErrorNonPrefixed(Args &&... args) const
Emits an error without the prefixing included in mooseError().
const std::string & name() const
Get the name of the class.
static const std::string moose_base_param
The name of the parameter that contains the moose system base.
void mooseDeprecated(Args &&... args) const
void mooseWarningNonPrefixed(Args &&... args) const
Emits a warning without the prefixing included in mooseWarning().
An inteface for the _console for outputting to the Console object.
void mooseWarningStream(S &oss, Args &&... args)
const std::string & type() const
Get the type of this class.
std::string typeAndName() const
Get the class's combined type and name; useful in error handling.
MooseApp & _app
The MOOSE application this is associated with.
void mooseDeprecatedStream(S &oss, const bool expired, const bool print_title, Args &&... args)
const T * queryParam(const std::string &name) const
Query a parameter for the object.
void mooseWarning(Args &&... args) const
Emits a warning prefixed with object name and type.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
virtual ~MooseBase()=default
std::string errorPrefix(const std::string &) const
Deprecated message prefix; the error type is no longer used.
A class for storing an input parameter name.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
const std::string & getBase() const
void paramWarning(const std::string ¶m, Args... args) const
Emits a warning prefixed with the file and line number of the given param (from the input file) along...
const hit::Node * getHitNode() const
A class for storing the names of MooseObject by tag and object name.
bool isParamSetByUser(const std::string &name) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.
const std::string & _type
The type of this class.
std::string formatMooseDocumentedError(const std::string &repo_name, const unsigned int issue_num, const std::string &msg)
Formats a documented error.
static InputParameters validParams()
void connectControllableParams(const std::string ¶meter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
Connect controllable parameter of this action with the controllable parameters of the objects added b...
MooseBase(const InputParameters ¶ms)
Primary constructor for general objects.
const T & getRenamedParam(const std::string &old_name, const std::string &new_name) const
Retrieve a renamed parameter for the object.
std::string messagePrefix(const bool hit_prefix=true) const
void paramInfo(const std::string ¶m, Args... args) const
Emits an informational message prefixed with the file and line number of the given param (from the in...