https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ReporterMode.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#pragma once
10
11#include "MooseEnum.h"
12
34class ReporterMode;
39
46{
47public:
48 ReporterMode(const std::string & key);
49
50private:
51 // Automatically incremented in construction
52 static int ID_COUNTER;
53};
54
63{
64public:
66
68 void clear();
69
72 template <typename... Args>
73 void insert(const ReporterMode & mode, Args... modes);
74 void insert(const ReporterMode & mode);
76};
77
78inline bool
79operator==(const ReporterProducerEnum & producer_mode, const ReporterMode & mode)
80{
81 return static_cast<int>(producer_mode) == static_cast<int>(mode);
82}
83
84inline bool
85operator==(const ReporterMode & mode, const ReporterProducerEnum & producer_mode)
86{
87 return producer_mode == mode;
88}
89
90inline bool
91operator!=(const ReporterProducerEnum & producer_mode, const ReporterMode & mode)
92{
93 return !(producer_mode == mode);
94}
95
96inline bool
97operator!=(const ReporterMode & mode, const ReporterProducerEnum & producer_mode)
98{
99 return !(mode == producer_mode);
100}
101
102template <typename... Args>
103void
104ReporterProducerEnum::insert(const ReporterMode & mode, Args... modes)
105{
106 insert(mode);
107 insert(modes...);
108}
const ReporterMode REPORTER_MODE_REPLICATED
bool operator==(const ReporterProducerEnum &producer_mode, const ReporterMode &mode)
bool operator!=(const ReporterProducerEnum &producer_mode, const ReporterMode &mode)
const ReporterMode REPORTER_MODE_DISTRIBUTED
const ReporterMode REPORTER_MODE_UNSET
const ReporterMode REPORTER_MODE_ROOT
Class for containing MooseEnum item information.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
MooseEnumItem that automatically creates the ID and doesn't allow the ID to be assigned.
static int ID_COUNTER
MooseEnum designed for the ReporterContext objects to define how a ReporterValue can and is being pro...
void insert(const ReporterMode &mode, Args... modes)
void clear()
Clear all available items (i.e., create an empty MooseEnum)