idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::receivable_event_data Concept Reference

Concept for types that can be received as event data. More...

Concept definition

template<typename T>
concept idfxx::receivable_event_data = std::is_trivially_copyable_v<T> || requires(const void* data) {
{ T::from_opaque(data) } -> std::same_as<T>;
}
Concept for types that can be received as event data.
Definition event.hpp:146

Detailed Description

Concept for types that can be received as event data.

A type satisfies receivable_event_data if it is trivially copyable (allowing automatic reconstruction via static cast) or provides a static from_opaque(const void*) method for custom reconstruction.

Trivially copyable types satisfy this concept automatically without needing to provide from_opaque. Types that require custom reconstruction (e.g., wrapping C structs into richer C++ types) can provide a static from_opaque method instead.

Template Parameters
TThe type to check.

Definition at line 146 of file event.hpp.