|
MeshX 0.4
This repository provides an implementation for Bluetooth Low Energy (BLE) Mesh network nodes. The project allows you to create BLE mesh nodes that can communicate with each other, enabling the development of smart home solutions or other IoT-based applications.
|
Singleton registry for MeshX elements. More...
#include <meshx_element_registry.hpp>
Public Member Functions | |
| void | register_element (meshXElementIF *element) |
| Register an element instance. | |
| void | unregister_element (uint16_t element_idx) |
| Unregister an element instance. | |
| meshXElementIF * | find_element (uint16_t element_idx) |
| Find an element instance by its index. | |
| template<typename T> | |
| T * | find_and_cast (uint16_t element_idx, meshx_element_type_t expected_variant) |
| Find and cast an element instance. | |
| std::map< uint16_t, meshXElementIF * > | get_all_elements () |
| Get all registered elements. | |
| meshXElementRegistry (const meshXElementRegistry &)=delete | |
| meshXElementRegistry & | operator= (const meshXElementRegistry &)=delete |
Static Public Member Functions | |
| static meshXElementRegistry & | get_instance () |
Private Member Functions | |
| meshXElementRegistry ()=default | |
Private Attributes | |
| std::map< uint16_t, meshXElementIF * > | element_map |
| std::mutex | registry_mutex |
Singleton registry for MeshX elements.
|
privatedefault |
|
delete |
|
inline |
Find and cast an element instance.
| T | The target element type. |
| element_idx | Index of the element. |
| expected_variant | The expected variant type discriminator. |
|
inline |
Find an element instance by its index.
| element_idx | Index of the element. |
|
inline |
Get all registered elements.
|
inlinestatic |
|
delete |
|
inline |
Register an element instance.
| element | Pointer to the element interface. |
|
inline |
Unregister an element instance.
| element_idx | Index of the element to unregister. |
|
private |
|
private |