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
25
namespace
FuncDoodle
{
34
class
PopupRegistry
{
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
FuncDoodle::PopupRegistry::PopupRegistry
PopupRegistry()=default
FuncDoodle::PopupRegistry::Open
void Open(std::string_view id)
Marks a popup as open.
Definition
PopupRegistry.cc:8
FuncDoodle::PopupRegistry::CloseAllExcept
void CloseAllExcept(std::string_view exception)
Closes every popup except one.
Definition
PopupRegistry.cc:34
FuncDoodle::PopupRegistry::m_Popups
std::map< std::string_view, bool, std::less<> > m_Popups
Definition
PopupRegistry.h:92
FuncDoodle::PopupRegistry::~PopupRegistry
~PopupRegistry()=default
FuncDoodle::PopupRegistry::Get
bool * Get(std::string_view id)
Returns direct access to a popup open-state flag.
Definition
PopupRegistry.cc:24
FuncDoodle::PopupRegistry::Register
void Register(std::string_view id)
Registers a popup identifier in the registry.
Definition
PopupRegistry.cc:4
FuncDoodle::PopupRegistry::Close
void Close(std::string_view id)
Marks a popup as closed.
Definition
PopupRegistry.cc:12
FuncDoodle::PopupRegistry::CloseAll
void CloseAll()
Closes every registered popup.
Definition
PopupRegistry.cc:28
FuncDoodle::PopupRegistry::IsOpen
bool IsOpen(std::string_view id) const
Returns whether a popup is currently open.
Definition
PopupRegistry.cc:16
FuncDoodle
The FuncDoodle C++ namespace.
Definition
Common.h:12
src
Registries
PopupRegistry.h
Generated by
1.16.1