1 #ifndef LXGUI_GUI_REGISTRY_HPP
2 #define LXGUI_GUI_REGISTRY_HPP
4 #include "lxgui/lxgui.hpp"
5 #include "lxgui/utils_observer.hpp"
9 #include <unordered_map>
38 bool add_region(utils::observer_ptr<region> obj);
59 return utils::const_pointer_cast<region>(
65 using string_map = std::unordered_map<std::string, T>;
67 string_map<utils::observer_ptr<region>> named_object_list_;
The base class of all elements in the GUI.
Keeps track of created UI objects and records their names for lookup.
registry & operator=(const registry &)=default
registry(const registry &)=default
utils::observer_ptr< region > get_region_by_name(std::string_view name)
Returns the region associated with the given name.
virtual ~registry()=default
registry & operator=(registry &&)=default
void remove_region(const region &obj)
Removes a region from this registry.
registry(registry &&)=default
bool add_region(utils::observer_ptr< region > obj)
Adds a region to be handled by this registry.
bool check_region_name(std::string_view name) const
Checks the provided string is suitable for naming a region.
utils::observer_ptr< const region > get_region_by_name(std::string_view name) const
Returns the region associated with the given name.