https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ExecFlagEnum.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 "MultiMooseEnum.h"
14
22{
23public:
25 ExecFlagEnum(const ExecFlagEnum & other);
26 ExecFlagEnum(const MultiMooseEnum & other);
27 ExecFlagEnum & operator=(const ExecFlagEnum & other) = default;
28
30
38 template <typename... Args>
39 void addAvailableFlags(const ExecFlagType & flag, Args... flags);
40 const ExecFlagType & addAvailableFlags(const ExecFlagType & flag);
42
44
47 using MultiMooseEnum::operator=; // use parent methods
48 ExecFlagEnum & operator=(const std::initializer_list<ExecFlagType> & flags);
49 ExecFlagEnum & operator=(const ExecFlagType & flags);
50 ExecFlagEnum & operator+=(const std::initializer_list<ExecFlagType> & flags);
51 ExecFlagEnum & operator+=(const ExecFlagType & flags);
53
55
58 template <typename... Args>
59 void removeAvailableFlags(const ExecFlagType & flag, Args... flags);
60 void removeAvailableFlags(const ExecFlagType & flag);
62
66 std::string getDocString() const;
67
71 const std::set<ExecFlagType> & items() const { return _items; }
72
73protected:
77 void appendCurrent(const ExecFlagType & item);
78};
79
80template <typename... Args>
81void
83{
85 addAvailableFlags(flags...);
86}
87
88template <typename... Args>
89void
91{
93 removeAvailableFlags(flags...);
94}
A MultiMooseEnum object to hold "execute_on" flags.
const std::set< ExecFlagType > & items() const
Reference the all the available items.
void appendCurrent(const ExecFlagType &item)
Append the list of current flags.
std::string getDocString() const
Generate a documentation string for the "execute_on" parameter.
ExecFlagEnum & operator=(const ExecFlagEnum &other)=default
ExecFlagEnum & operator+=(const std::initializer_list< ExecFlagType > &flags)
void addAvailableFlags(const ExecFlagType &flag, Args... flags)
Add additional execute_on flags to the list of possible flags.
void removeAvailableFlags(const ExecFlagType &flag, Args... flags)
Remove flags from being available.
std::set< MooseEnumItem > _items
Storage for the assigned items.
Class for containing MooseEnum item information.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.