Loading...
Searching...
No Matches
FlagManager.h
Go to the documentation of this file.
1//
2// Created by Dave R. Smith on 3/4/25.
3//
4
5#ifndef FLAGGABLE_H
6#define FLAGGABLE_H
7
8#pragma once
9
10#include <map>
11#include <iostream>
14
15namespace ml
16{
53 template<typename StateEnum>
59 {
60 public:
62 using State = StateEnum;
63
64 private:
65 std::map<State, bool> _states;
66
67 public:
69 FlagManager(const FlagManager& stateful);
70
79 bool checkFlag(State state) const;
80
86 void enableFlag(State state);
87
93 void disableFlag(State state);
94
100 void toggleFlag(State state);
101
108 void setFlag(State state, bool status);
109 };
110
111} // namespace ml
112
113#include "../../../src/Resources/FlagManager.tpp"
114#endif // FLAGGABLE_H
FlagManager(const FlagManager &stateful)
StateEnum State
The enum type this manager stores flags for.
Definition FlagManager.h:62
void toggleFlag(State state)
Flip a flag between true and false.
void disableFlag(State state)
Set a flag to false.
void setFlag(State state, bool status)
Set a flag to an explicit value.
bool checkFlag(State state) const
Return the current value of a flag.
void enableFlag(State state)
Set a flag to true.
Definition Component.h:18