https://mooseframework.inl.gov
Public Member Functions | Private Attributes | List of all members
ReporterStateBase Class Referenceabstract

The base class for storing a Reporter's state. More...

#include <ReporterState.h>

Inheritance diagram for ReporterStateBase:
[legend]

Public Member Functions

 ReporterStateBase (const ReporterName &name)
 
virtual ~ReporterStateBase ()=default
 
const ReporterNamegetReporterName () const
 Return the ReporterName that this state is associated with. More...
 
void addConsumer (ReporterMode mode, const MooseObject &moose_object)
 Add a consumer for this ReporterState. More...
 
const std::set< std::pair< ReporterMode, const MooseObject * > > & getConsumers () const
 Returns the consumers for this state; a pair that consists of the mode that the state is being consumed by, and the object consuming it. More...
 
virtual std::string valueType () const =0
 
void setIsPostprocessor ()
 Sets the special Reporter type to a Postprocessor. More...
 
void setIsVectorPostprocessor ()
 Sets the special Reporter type to a VectorPostprocessor. More...
 

Private Attributes

ReporterName _reporter_name
 Name of data that state is associated. More...
 
std::set< std::pair< ReporterMode, const MooseObject * > > _consumers
 The consumers for this state; we store the MooseObject for detailed error reporting. More...
 

Detailed Description

The base class for storing a Reporter's state.

The base class is needed in order to store the states without a template parameter so that they can be iterated through to observe the producers and consumers.

Definition at line 32 of file ReporterState.h.

Constructor & Destructor Documentation

◆ ReporterStateBase()

ReporterStateBase::ReporterStateBase ( const ReporterName name)

Definition at line 14 of file ReporterState.C.

14 : _reporter_name(name) {}
ReporterName _reporter_name
Name of data that state is associated.
Definition: ReporterState.h:81

◆ ~ReporterStateBase()

virtual ReporterStateBase::~ReporterStateBase ( )
virtualdefault

Member Function Documentation

◆ addConsumer()

void ReporterStateBase::addConsumer ( ReporterMode  mode,
const MooseObject moose_object 
)

Add a consumer for this ReporterState.

Parameters
modeThe mode that the object will consume the Reporter value
moose_objectThe MooseObject doing the consuming (for error reporting)
See also
ReporterData

Definition at line 17 of file ReporterState.C.

Referenced by ReporterTransferInterface::addReporterTransferMode().

18 {
19  _consumers.emplace(mode, &moose_object);
20 }
std::set< std::pair< ReporterMode, const MooseObject * > > _consumers
The consumers for this state; we store the MooseObject for detailed error reporting.
Definition: ReporterState.h:84

◆ getConsumers()

const std::set<std::pair<ReporterMode, const MooseObject *> >& ReporterStateBase::getConsumers ( ) const
inline

Returns the consumers for this state; a pair that consists of the mode that the state is being consumed by, and the object consuming it.

See also
ReporterContext

Definition at line 56 of file ReporterState.h.

Referenced by ReporterData::getReporterInfo(), and ReporterContextBase::requiresConsumerModes().

57  {
58  return _consumers;
59  }
std::set< std::pair< ReporterMode, const MooseObject * > > _consumers
The consumers for this state; we store the MooseObject for detailed error reporting.
Definition: ReporterState.h:84

◆ getReporterName()

const ReporterName& ReporterStateBase::getReporterName ( ) const
inline

Return the ReporterName that this state is associated with.

Definition at line 41 of file ReporterState.h.

Referenced by ReporterData::getReporterInfo().

41 { return _reporter_name; }
ReporterName _reporter_name
Name of data that state is associated.
Definition: ReporterState.h:81

◆ setIsPostprocessor()

void ReporterStateBase::setIsPostprocessor ( )
inline

Sets the special Reporter type to a Postprocessor.

See ReporterData::declareReporterValue.

Definition at line 71 of file ReporterState.h.

void setIsPostprocessor()
Sets the special type to a Postprocessor.
Definition: ReporterName.h:96
ReporterName _reporter_name
Name of data that state is associated.
Definition: ReporterState.h:81

◆ setIsVectorPostprocessor()

void ReporterStateBase::setIsVectorPostprocessor ( )
inline

Sets the special Reporter type to a VectorPostprocessor.

See ReporterData::declareReporterValue.

Definition at line 77 of file ReporterState.h.

ReporterName _reporter_name
Name of data that state is associated.
Definition: ReporterState.h:81
void setIsVectorPostprocessor()
Sets the special type to a VectorPostprocessor.
Definition: ReporterName.h:102

◆ valueType()

virtual std::string ReporterStateBase::valueType ( ) const
pure virtual
Returns
The type associated with this state

Implemented in ReporterState< T >, and ReporterState< std::vector< T > >.

Referenced by ReporterData::getReporterInfo().

Member Data Documentation

◆ _consumers

std::set<std::pair<ReporterMode, const MooseObject *> > ReporterStateBase::_consumers
private

The consumers for this state; we store the MooseObject for detailed error reporting.

Definition at line 84 of file ReporterState.h.

Referenced by addConsumer(), and getConsumers().

◆ _reporter_name

ReporterName ReporterStateBase::_reporter_name
private

Name of data that state is associated.

Definition at line 81 of file ReporterState.h.

Referenced by getReporterName(), setIsPostprocessor(), and setIsVectorPostprocessor().


The documentation for this class was generated from the following files: