www.mooseframework.org
MooseObject.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // MOOSE includes
13 #include "MooseBase.h"
16 #include "InputParameters.h"
17 #include "ConsoleStreamInterface.h"
18 #include "Registry.h"
19 #include "MooseUtils.h"
20 #include "DataFileInterface.h"
22 
23 #include "libmesh/parallel_object.h"
24 
25 #define usingMooseObjectMembers \
26  usingMooseBaseMembers; \
27  usingMooseBaseParameterInterfaceMembers; \
28  using MooseObject::enabled
29 
33 class MooseObject : public MooseBase,
37  public DataFileInterface<MooseObject>
38 {
39 public:
41 
43 
44  virtual ~MooseObject() = default;
45 
49  virtual bool enabled() const { return _enabled; }
50 
51 protected:
53  const bool & _enabled;
54 
55  // Base classes have the same name for that attribute, pick one
56  using MooseBase::_app;
57 };
Every object that can be built by the factory should be derived from this class.
Interface for objects that need to resolve data file paths (MooseObject and Action) ...
Base class for everything in MOOSE with a name and a type.
Definition: MooseBase.h:31
virtual ~MooseObject()=default
Interface that provides APIs to output errors/warnings/info messages.
MooseObject(const InputParameters &parameters)
Definition: MooseObject.C:47
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:33
const bool & _enabled
Reference to the "enable" InputParameters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:53
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:69
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
Definition: MooseObject.C:24
virtual bool enabled() const
Return the enabled status of the object.
Definition: MooseObject.h:49