https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ReporterState.C
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#include "ReporterState.h"
11
12#include "MooseObject.h"
13
14ReporterStateBase::ReporterStateBase(const ReporterName & name) : _reporter_name(name) {}
15
16void
18{
19 _consumers.emplace(mode, &moose_object);
20}
21
22bool
23operator<(const std::pair<ReporterMode, const MooseObject *> & a,
24 const std::pair<ReporterMode, const MooseObject *> & b)
25{
26 // Sort by object type, object name, and then mode
27 return a.second->type() < b.second->type() ||
28 (a.second->type() == b.second->type() && a.second->name() < b.second->name()) ||
29 (a.second->type() == b.second->type() && a.second->name() == b.second->name() &&
30 a.first < b.first);
31}
bool operator<(const std::pair< ReporterMode, const MooseObject * > &a, const std::pair< ReporterMode, const MooseObject * > &b)
Custom sort for ReporterState::_consumers so that they are sorted by object type, object name,...
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
MooseEnumItem that automatically creates the ID and doesn't allow the ID to be assigned.
The Reporter system is comprised of objects that can contain any number of data values.
void addConsumer(ReporterMode mode, const MooseObject &moose_object)
Add a consumer for this ReporterState.
std::set< std::pair< ReporterMode, const MooseObject * > > _consumers
The consumers for this state; we store the MooseObject for detailed error reporting.
ReporterStateBase(const ReporterName &name)