FuncDoodle
Loading...
Searching...
No Matches
PopupRegistry.h
Go to the documentation of this file.
1
19
20#pragma once
21
22#include <map>
23#include <string_view>
24
25namespace FuncDoodle {
35 public:
36 PopupRegistry() = default;
37 ~PopupRegistry() = default;
38
45 void Register(std::string_view id);
52 void Open(std::string_view id);
59 void Close(std::string_view id);
60
68 [[nodiscard]] bool IsOpen(std::string_view id) const;
69
77 bool* Get(std::string_view id);
82 void CloseAll();
89 void CloseAllExcept(std::string_view exception);
90
91 private:
92 std::map<std::string_view, bool, std::less<>> m_Popups;
93 };
94} // namespace FuncDoodle
void Open(std::string_view id)
Marks a popup as open.
Definition PopupRegistry.cc:8
void CloseAllExcept(std::string_view exception)
Closes every popup except one.
Definition PopupRegistry.cc:34
std::map< std::string_view, bool, std::less<> > m_Popups
Definition PopupRegistry.h:92
bool * Get(std::string_view id)
Returns direct access to a popup open-state flag.
Definition PopupRegistry.cc:24
void Register(std::string_view id)
Registers a popup identifier in the registry.
Definition PopupRegistry.cc:4
void Close(std::string_view id)
Marks a popup as closed.
Definition PopupRegistry.cc:12
void CloseAll()
Closes every registered popup.
Definition PopupRegistry.cc:28
bool IsOpen(std::string_view id) const
Returns whether a popup is currently open.
Definition PopupRegistry.cc:16
The FuncDoodle C++ namespace.
Definition Common.h:12