lxgui
Public Member Functions | List of all members
lxgui::gui::registry Class Reference

Keeps track of created UI objects and records their names for lookup. More...

#include <gui_registry.hpp>

Inheritance diagram for lxgui::gui::registry:
lxgui::gui::virtual_registry

Public Member Functions

 registry ()=default
 
virtual ~registry ()=default
 
 registry (const registry &)=default
 
 registry (registry &&)=default
 
registryoperator= (const registry &)=default
 
registryoperator= (registry &&)=default
 
bool check_region_name (std::string_view name) const
 Checks the provided string is suitable for naming a region. More...
 
bool add_region (utils::observer_ptr< region > obj)
 Adds a region to be handled by this registry. More...
 
void remove_region (const region &obj)
 Removes a region from this registry. More...
 
utils::observer_ptr< const regionget_region_by_name (std::string_view name) const
 Returns the region associated with the given name. More...
 
utils::observer_ptr< regionget_region_by_name (std::string_view name)
 Returns the region associated with the given name. More...
 

Detailed Description

Keeps track of created UI objects and records their names for lookup.

Definition at line 16 of file gui_registry.hpp.

Constructor & Destructor Documentation

◆ registry() [1/3]

lxgui::gui::registry::registry ( )
default

◆ ~registry()

virtual lxgui::gui::registry::~registry ( )
virtualdefault

◆ registry() [2/3]

lxgui::gui::registry::registry ( const registry )
default

◆ registry() [3/3]

lxgui::gui::registry::registry ( registry &&  )
default

Member Function Documentation

◆ add_region()

bool lxgui::gui::registry::add_region ( utils::observer_ptr< region obj)

Adds a region to be handled by this registry.

Parameters
objThe object to add
Returns
'false' if the name of the region was already taken

Definition at line 43 of file gui_registry.cpp.

◆ check_region_name()

bool lxgui::gui::registry::check_region_name ( std::string_view  name) const

Checks the provided string is suitable for naming a region.

Parameters
nameThe string to test
Returns
'true' if the provided string can be the name of a region

Definition at line 9 of file gui_registry.cpp.

◆ get_region_by_name() [1/2]

utils::observer_ptr<region> lxgui::gui::registry::get_region_by_name ( std::string_view  name)
inline

Returns the region associated with the given name.

Parameters
nameThe name of the region you're after
Returns
The region associated with the given name, or nullptr if not found

Definition at line 58 of file gui_registry.hpp.

◆ get_region_by_name() [2/2]

utils::observer_ptr< const region > lxgui::gui::registry::get_region_by_name ( std::string_view  name) const

Returns the region associated with the given name.

Parameters
nameThe name of the region you're after
Returns
The region associated with the given name, or nullptr if not found

Definition at line 66 of file gui_registry.cpp.

◆ operator=() [1/2]

registry& lxgui::gui::registry::operator= ( const registry )
default

◆ operator=() [2/2]

registry& lxgui::gui::registry::operator= ( registry &&  )
default

◆ remove_region()

void lxgui::gui::registry::remove_region ( const region obj)

Removes a region from this registry.

Parameters
objThe object to remove

Definition at line 62 of file gui_registry.cpp.


The documentation for this class was generated from the following files: