Logo Pico-Framework A web-first embedded framework for C++
Loading...
Searching...
No Matches
app.h
Go to the documentation of this file.
1
16#ifndef APP_H
17#define APP_H
18
20#include "PicoModel.h"
21
22class App : public FrameworkApp
23{
24public:
25 App(int port); // Constructor to initialize the application with a port number
26
27 // standard functions
28 void initRoutes() override; // called by onStart() to initialize routes
29 void onStart() override; // called by the framework when the app is started
30 void poll() override; // called by the framework to poll the app
31 void onEvent(const Event &e) override; // called by the framework when an event occurs
32
33 enum class UserNotification : uint8_t { // user-defined notifications
34 Heartbeat = 0
35 };
36
37private:
39
40};
41
42#endif
Base class for applications using the PicoFramework.
Definition app.h:23
void initRoutes() override
Define the application's HTTP routes.
Definition app.cpp:33
void onEvent(const Event &e) override
Called when an event is dispatched to this controller.
Definition app.cpp:108
UserNotification
Definition app.h:33
void onStart() override
Called once at task start before entering the main loop.
Definition app.cpp:53
PicoModel pico
Definition app.h:38
void poll() override
Called during every loop iteration for non-blocking background logic.
Definition app.cpp:188
Base class for applications using the framework.
Represents a framework event, optionally carrying payload data.
Definition Event.h:24