https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Attributes | List of all members
VectorPostprocessorReporterName Class Reference

A ReporterName that represents a VectorPostprocessor. More...

#include <ReporterName.h>

Inheritance diagram for VectorPostprocessorReporterName:
[legend]

Public Member Functions

 VectorPostprocessorReporterName (const VectorPostprocessorName &name, const std::string &vector_name)
 
const std::string & getObjectName () const
 Return the object name that produces the Reporter value.
 
const std::string & getValueName () const
 Return the data name for the Reporter value.
 
const std::string getCombinedName () const
 Return the name of the object and data as object_name/data_name.
 
std::string getRestartableName () const
 Return the name used for registration of this Reporter in the restartable data system.
 
 operator std::string () const
 std::string operator allows this object to behave as a std::sting object
 
bool operator== (const ReporterName &rhs) const
 Compare with another object or string.
 
bool operator== (const std::string &combined_name) const
 
bool operator< (const ReporterName &rhs) const
 Less than operator.
 
std::string specialTypeToName () const
 Converts the special type to a usable name for error reporting.
 
bool isPostprocessor () const
 
bool isVectorPostprocessor () const
 
void setIsPostprocessor ()
 Sets the special type to a Postprocessor.
 
void setIsVectorPostprocessor ()
 Sets the special type to a VectorPostprocessor.
 
bool empty () const
 Whether or not the ReporterName is empty, similar to std::string::empty()
 

Static Public Member Functions

static bool isValidName (const std::string &object_and_value_name)
 Determines if the inputted string is convertible to a ReporterName.
 

Static Public Attributes

static const std::string REPORTER_RESTARTABLE_DATA_PREFIX = "ReporterData"
 The prefix for reporter data in the restartable system.
 

Private Types

enum class  SpecialType { ANY = 0 , POSTPROCESSOR = 1 , VECTORPOSTPROCESSOR = 2 }
 Enum for storing a "special" type for this Reporter. More...
 

Private Attributes

ReporterName::SpecialType _special_type = ReporterName::SpecialType::ANY
 The "special" type for this Reporter, used for identifying Postprocesors and VectorPostprocessors.
 
std::string _object_name
 The object name.
 
std::string _value_name
 The value name.
 

Detailed Description

A ReporterName that represents a VectorPostprocessor.

Definition at line 152 of file ReporterName.h.

Member Enumeration Documentation

◆ SpecialType

enum class ReporterName::SpecialType
strongprivateinherited

Enum for storing a "special" type for this Reporter.

This is used to designate Reporters that represent Postprocessors and VectorPostprocessors in output and error handling.

Enumerator
ANY 
POSTPROCESSOR 
VECTORPOSTPROCESSOR 

Definition at line 124 of file ReporterName.h.

Constructor & Destructor Documentation

◆ VectorPostprocessorReporterName()

VectorPostprocessorReporterName::VectorPostprocessorReporterName ( const VectorPostprocessorName &  name,
const std::string &  vector_name 
)

Definition at line 111 of file ReporterName.C.

113 : ReporterName(name, vector_name)
114{
116}
void setIsVectorPostprocessor()
Sets the special type to a VectorPostprocessor.

Member Function Documentation

◆ empty()

bool ReporterName::empty ( ) const
inlineinherited

Whether or not the ReporterName is empty, similar to std::string::empty()

Definition at line 116 of file ReporterName.h.

116{ return _object_name.empty() || _value_name.empty(); }
std::string _object_name
The object name.
std::string _value_name
The value name.

◆ getCombinedName()

const std::string ReporterName::getCombinedName ( ) const
inherited

◆ getObjectName()

const std::string & ReporterName::getObjectName ( ) const
inherited

◆ getRestartableName()

std::string ReporterName::getRestartableName ( ) const
inherited

Return the name used for registration of this Reporter in the restartable data system.

Definition at line 59 of file ReporterName.C.

60{
62}
const std::string getCombinedName() const
Return the name of the object and data as object_name/data_name.
static const std::string REPORTER_RESTARTABLE_DATA_PREFIX
The prefix for reporter data in the restartable system.

◆ getValueName()

const std::string & ReporterName::getValueName ( ) const
inherited

Return the data name for the Reporter value.

Definition at line 47 of file ReporterName.C.

48{
49 return _value_name;
50}

Referenced by AccumulateReporter::declareAccumulateHelper(), ReporterData::getReporterStateHelper(), and Exodus::outputReporters().

◆ isPostprocessor()

bool ReporterName::isPostprocessor ( ) const
inlineinherited
Returns
True if this ReporterName represents a Postprocessor

Definition at line 94 of file ReporterName.h.

ReporterName::SpecialType _special_type
The "special" type for this Reporter, used for identifying Postprocesors and VectorPostprocessors.

Referenced by ReporterData::declareReporterValue(), ReporterData::getReporterStateHelper(), and ReporterName::specialTypeToName().

◆ isValidName()

bool ReporterName::isValidName ( const std::string &  object_and_value_name)
staticinherited

Determines if the inputted string is convertible to a ReporterName.

Parameters
object_and_value_nameThe string to determine convertibility
Returns
true Inputted string has a "/"
false Inputted string does not have a "/"

Definition at line 35 of file ReporterName.C.

36{
37 return combined_name.rfind("/") != std::string::npos;
38}

Referenced by WebServerControl::addServerActionsInternal().

◆ isVectorPostprocessor()

bool ReporterName::isVectorPostprocessor ( ) const
inlineinherited

◆ operator std::string()

ReporterName::operator std::string ( ) const
inherited

std::string operator allows this object to behave as a std::sting object

Definition at line 64 of file ReporterName.C.

64{ return getCombinedName(); }

◆ operator<()

bool ReporterName::operator< ( const ReporterName rhs) const
inherited

Less than operator.

Definition at line 80 of file ReporterName.C.

82{
83 // Note here that we do not sort by _special_type. This is because
84 // we want to store reporter names as a single name regardless of the type
85 return getCombinedName() < rhs.getCombinedName();
86}

◆ operator==() [1/2]

bool ReporterName::operator== ( const ReporterName rhs) const
inherited

Compare with another object or string.

Definition at line 67 of file ReporterName.C.

68{
69 // Note here that we do not check if _special_type is the same. This is because
70 // we want to store reporter names as a single name regardless of the type
71 return _object_name == rhs._object_name && _value_name == rhs._value_name;
72}

◆ operator==() [2/2]

bool ReporterName::operator== ( const std::string &  combined_name) const
inherited

Definition at line 75 of file ReporterName.C.

76{
77 return getCombinedName() == combined_name;
78}

◆ setIsPostprocessor()

void ReporterName::setIsPostprocessor ( )
inlineinherited

◆ setIsVectorPostprocessor()

void ReporterName::setIsVectorPostprocessor ( )
inlineinherited

◆ specialTypeToName()

std::string ReporterName::specialTypeToName ( ) const
inherited

Converts the special type to a usable name for error reporting.

Definition at line 89 of file ReporterName.C.

90{
91 if (isPostprocessor())
92 return "Postprocessor";
94 return "VectorPostprocessor";
95 return "Reporter";
96}
bool isPostprocessor() const
bool isVectorPostprocessor() const

Referenced by ReporterData::getReporterStateHelper().

Member Data Documentation

◆ _object_name

std::string ReporterName::_object_name
privateinherited

◆ _special_type

ReporterName::SpecialType ReporterName::_special_type = ReporterName::SpecialType::ANY
privateinherited

The "special" type for this Reporter, used for identifying Postprocesors and VectorPostprocessors.

Definition at line 132 of file ReporterName.h.

Referenced by ReporterName::isPostprocessor(), ReporterName::isVectorPostprocessor(), ReporterName::setIsPostprocessor(), and ReporterName::setIsVectorPostprocessor().

◆ _value_name

std::string ReporterName::_value_name
privateinherited

◆ REPORTER_RESTARTABLE_DATA_PREFIX

const std::string ReporterName::REPORTER_RESTARTABLE_DATA_PREFIX = "ReporterData"
staticinherited

The prefix for reporter data in the restartable system.

Definition at line 63 of file ReporterName.h.

Referenced by RestartableDataReporter::execute(), and ReporterName::getRestartableName().


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