Logo Pico-Framework A web-first embedded framework for C++
Loading...
Searching...
No Matches
Notification.h File Reference
#include <stdint.h>
#include "port/FreeRTOSConfig.h"
+ Include dependency graph for Notification.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Notification
 A tagged union representing either a system or user-defined notification. More...
 

Enumerations

enum class  NotificationKind : uint8_t { System , User }
 Identifies the source of a notification. More...
 
enum class  SystemNotification : uint8_t {
  None = 0 , NetworkReady , NetworkDown , TimeValid ,
  LocalTimeValid , TimeSync , TimeInvalid , WaitForTimeout ,
  HttpServerStarted , GpioChange , Count
}
 System-defined notification types reserved by the framework. More...
 

Functions

template<typename Enum >
constexpr uint32_t eventMask (Enum e)
 Helper function to create an event mask from an enum value.
 
template<typename Enum , typename... Rest>
constexpr uint32_t eventMask (Enum first, Rest... rest)
 

Enumeration Type Documentation

◆ NotificationKind

enum class NotificationKind : uint8_t
strong
Enumerator
System 
User 

Definition at line 10 of file Notification.h.

10 : uint8_t {
11 System,
12 User
13};

◆ SystemNotification

enum class SystemNotification : uint8_t
strong
Enumerator
None 
NetworkReady 
NetworkDown 
TimeValid 
LocalTimeValid 
TimeSync 
TimeInvalid 
WaitForTimeout 
HttpServerStarted 
GpioChange 
Count 

Definition at line 18 of file Notification.h.

Function Documentation

◆ eventMask() [1/2]

template<typename Enum >
constexpr uint32_t eventMask ( Enum  e)
inlineconstexpr

This is used to generate a bitmask for event handling.

Template Parameters
EnumThe enumeration type.
Parameters
eThe enum value to convert to a bitmask.
Returns
uint32_t The bitmask corresponding to the enum value.

Definition at line 89 of file Notification.h.

89 {
90 return 1u << static_cast<uint32_t>(static_cast<std::underlying_type_t<Enum>>(e));
91}

Referenced by TimeManager::applyFixedTimezoneOffset(), eventMask(), FrameworkManager::onStart(), App::onStart(), and EventManager::subscribeTo().

+ Here is the caller graph for this function:

◆ eventMask() [2/2]

template<typename Enum , typename... Rest>
constexpr uint32_t eventMask ( Enum  first,
Rest...  rest 
)
inlineconstexpr

Definition at line 96 of file Notification.h.

96 {
97 return eventMask(first) | eventMask(rest...);
98}
constexpr uint32_t eventMask(Enum e)
Helper function to create an event mask from an enum value.

References eventMask().

+ Here is the call graph for this function: