Module - smartel99/NilaiTFO GitHub Wiki
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 = "";
};