-
Notifications
You must be signed in to change notification settings - Fork 3
Module
Samuel Martel edited this page Sep 8, 2020
·
1 revision
Modules are what the Application uses in its run loop. They can be seen as widgets, layers, or simply as independent modules.
A module at its core contains two functions: Run
, called by the application each frames, and GetLabel
, which simply gets the label (identifier) of the module.
Example:
class MyModule : public cep::Module
{
MyModule(const std::string& label)
: m_label(label)
{}
virtual ~MyModule() override = default;
virtual void Run()
{
DoStuff();
}
virtual const std::string& GetLabel() const
{
return m_label;
}
void DoStuff()
{
// Do stuff in here.
// We could also be doing stuff in Run if we want.
}
private:
std::string m_label = "";
};
RtD STM32 API - Copyright 2022 Samuel Martel