|
CTRE Phoenix 6 C++ 26.70.0-alpha-2
|
Collection of objects that can report alerts. More...
#include <ctre/phoenix6/Alertable.hpp>
Public Member Functions | |
| AlertableCollection (std::string group) | |
| Constructs a new collection of alertable objects. | |
| AlertableCollection (AlertableCollection &&)=default | |
| AlertableCollection & | operator= (AlertableCollection &&)=default |
| void | Report () const |
| Reports all alerts in this collection. | |
| AlertableCollection & | WithAlertable (PhoenixAlertable &alertable) & |
| Adds a PhoenixAlertable to this collection. | |
| AlertableCollection && | WithAlertable (PhoenixAlertable &alertable) && |
| Adds a PhoenixAlertable to this collection. | |
| template<std::invocable< AlertableCollection & > F> | |
| AlertableCollection & | WithAlertable (F const &alertable) & |
| Adds an alertable to this collection. | |
| template<std::invocable< AlertableCollection & > F> | |
| AlertableCollection && | WithAlertable (F const &alertable) && |
| Adds an alertable to this collection. | |
| template<std::invocable F> requires std::convertible_to<std::invoke_result_t<F>, std::optional<AlertInfo>> | |
| AlertableCollection & | WithAlert (std::string id, PhoenixAlert::Level level, F &&infoGetter, std::string const &text="", wpi::units::second_t debounce=-1_s) & |
| Adds a PhoenixAlert to this collection. | |
| template<std::invocable F> requires std::convertible_to<std::invoke_result_t<F>, std::optional<AlertInfo>> | |
| AlertableCollection && | WithAlert (std::string id, PhoenixAlert::Level level, F &&infoGetter, std::string const &text="", wpi::units::second_t debounce=-1_s) && |
| Adds a PhoenixAlert to this collection. | |
| template<std::invocable F> requires std::convertible_to<std::invoke_result_t<F>, std::optional<MultiAlertInfo>> | |
| AlertableCollection & | WithMultiAlert (std::string id, uint32_t levelFlags, F &&infoGetter, std::string const &text="", wpi::units::second_t debounce=-1_s) & |
| Adds a PhoenixMultiAlert to this collection. | |
| template<std::invocable F> requires std::convertible_to<std::invoke_result_t<F>, std::optional<MultiAlertInfo>> | |
| AlertableCollection && | WithMultiAlert (std::string id, uint32_t levelFlags, F &&infoGetter, std::string const &text="", wpi::units::second_t debounce=-1_s) && |
| Adds a PhoenixMultiAlert to this collection. | |
| template<std::invocable F> | |
| AlertableCollection & | WithBeforeAlerts (F &&func) & |
| Adds a function to run before updating any alerts. | |
| template<std::invocable F> | |
| AlertableCollection && | WithBeforeAlerts (F &&func) && |
| Adds a function to run before updating any alerts. | |
Collection of objects that can report alerts.
This collection must outlive any PhoenixAlertable objects and lambda captures registered to the collection.
|
inline |
Constructs a new collection of alertable objects.
| group | Alert group identifier |
|
default |
|
default |
|
inline |
Reports all alerts in this collection.
|
inline |
Adds a PhoenixAlert to this collection.
| F | Type of the function returning live information to report in the alert |
| id | Alert identifier, unique within the group |
| level | Alert urgency level |
| infoGetter | Function returning the AlertInfo to report |
| text | Default alert text to display when the alert is active |
| debounce | Debounce time of the alert, or negative to use the default debounce time (1 second) |
|
inline |
Adds a PhoenixAlert to this collection.
| F | Type of the function returning live information to report in the alert |
| id | Alert identifier, unique within the group |
| level | Alert urgency level |
| infoGetter | Function returning the AlertInfo to report |
| text | Default alert text to display when the alert is active |
| debounce | Debounce time of the alert, or negative to use the default debounce time (1 second) |
|
inline |
Adds an alertable to this collection.
| F | Type of the function registering the alerts |
| alertable | Function that registers the alerts |
|
inline |
Adds an alertable to this collection.
| F | Type of the function registering the alerts |
| alertable | Function that registers the alerts |
|
inline |
Adds a PhoenixAlertable to this collection.
| alertable | PhoenixAlertable to register |
|
inline |
Adds a PhoenixAlertable to this collection.
| alertable | PhoenixAlertable to register |
|
inline |
Adds a function to run before updating any alerts.
This can be used to perform actions such as a bulk signal refresh so individual alerts do not have to perform refreshes.
| F | Type of the function to register |
| func | Function to run before any alerts |
|
inline |
Adds a function to run before updating any alerts.
This can be used to perform actions such as a bulk signal refresh so individual alerts do not have to perform refreshes.
| F | Type of the function to register |
| func | Function to run before any alerts |
|
inline |
Adds a PhoenixMultiAlert to this collection.
| F | Type of the function returning live information to report in the alert |
| id | Alert identifier, unique within the group |
| levelFlags | Alert urgency levels to include |
| infoGetter | Function returning the MultiAlertInfo to report |
| text | Default alert text to display when the alert is active |
| debounce | Debounce time of the alert, or negative to use the default debounce time (1 second) |
|
inline |
Adds a PhoenixMultiAlert to this collection.
| F | Type of the function returning live information to report in the alert |
| id | Alert identifier, unique within the group |
| levelFlags | Alert urgency levels to include |
| infoGetter | Function returning the MultiAlertInfo to report |
| text | Default alert text to display when the alert is active |
| debounce | Debounce time of the alert, or negative to use the default debounce time (1 second) |