https://mooseframework.inl.gov
MooseObject.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 "MooseUtils.h"
14 #include "ParallelParamObject.h"
15 #include "InputParameters.h"
16 #include "ConsoleStreamInterface.h"
17 #include "Registry.h"
19 
20 #define usingMooseObjectMembers \
21  usingMooseBaseMembers; \
22  usingMooseBaseParameterInterfaceMembers; \
23  using MooseObject::enabled
24 
28 class MooseObject : public ParallelParamObject, public std::enable_shared_from_this<MooseObject>
29 {
30 public:
32 
34 
35  virtual ~MooseObject() = default;
36 
40  virtual bool enabled() const { return _enabled; }
41 
46  std::shared_ptr<MooseObject> getSharedPtr();
47  std::shared_ptr<const MooseObject> getSharedPtr() const;
48 
49 protected:
51  const bool & _enabled;
52 
53  // Base classes have the same name for that attribute, pick one
54  using MooseBase::_app;
55 };
virtual ~MooseObject()=default
MooseObject(const InputParameters &parameters)
Definition: MooseObject.C:48
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::shared_ptr< MooseObject > getSharedPtr()
Get another shared pointer to this object that has the same ownership group.
Definition: MooseObject.C:68
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
const bool & _enabled
Reference to the "enable" InputParameters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:51
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:84
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
Definition: MooseObject.C:25
Base class shared by both Action and MooseObject.
virtual bool enabled() const
Return the enabled status of the object.
Definition: MooseObject.h:40