Logo Pico-Framework A web-first embedded framework for C++
Loading...
Searching...
No Matches
Notification Struct Reference

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

#include <Notification.h>

+ Collaboration diagram for Notification:

Public Member Functions

 Notification ()
 Default constructor initializes to a system notification of None.
 
 Notification (SystemNotification s)
 Construct a Notification with a specific system notification type.
 
 Notification (uint8_t userCode)
 Construct a Notification with a user-defined code.
 
uint8_t code () const
 Get the notification code.
 

Public Attributes

NotificationKind kind
 
union { 
 
   SystemNotification   system 
 
   uint8_t   user_code 
 
};  
 

Detailed Description

Definition at line 38 of file Notification.h.

Constructor & Destructor Documentation

◆ Notification() [1/3]

Notification::Notification ( )
inline

Use the other constructors to specify a system or user notification.

Definition at line 50 of file Notification.h.

◆ Notification() [2/3]

Notification::Notification ( SystemNotification  s)
inline
Parameters
sThe system notification type.

Definition at line 57 of file Notification.h.

◆ Notification() [3/3]

Notification::Notification ( uint8_t  userCode)
inline
Parameters
userCodeThe user-defined notification code.

Definition at line 64 of file Notification.h.

Member Function Documentation

◆ code()

uint8_t Notification::code ( ) const
inline

If it's a system notification, returns the system code. If it's a user notification, returns the user-defined code.

Returns
uint8_t The notification code.

Definition at line 73 of file Notification.h.

73 {
75 ? static_cast<uint8_t>(system)
76 : user_code;
77 }

References kind, System, system, and user_code.

Referenced by FrameworkTask::notify(), FrameworkTask::notifyFromISR(), EventManager::postNotification(), TimerService::scheduleDailyAt(), TimerService::scheduleDuration(), TimerService::scheduleEvery(), and FrameworkTask::waitFor().

+ Here is the caller graph for this function:

Member Data Documentation

◆ [union]

union { ... } Notification

◆ kind

◆ system

◆ user_code

uint8_t Notification::user_code

Definition at line 43 of file Notification.h.

Referenced by code(), App::onEvent(), and Event::userCode().


The documentation for this struct was generated from the following file: