SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
activeModule.hpp
1#pragma once
2
3#include "mainModule.hpp"
4
5namespace Module {
6
7static const int DEFAULT_STACK_SIZE = 4096;
8
10private:
11 std::mutex vMux;
12 int threadID = -1;
13 const int stackSize = 0;
14
15 void start();
16 void stop();
17
18 static void _runner(ActiveModule_t *m);
19
20 friend Manager_t;
21
22protected:
23 virtual void run();
24
25public:
26 static const int classID = 1;
27
28 virtual int getClassID() const { return classID; }
29
30 template <typename... T>
31 ActiveModule_t(const int stackSize) : stackSize(stackSize), Module_t(){};
32 template <typename... T>
33 ActiveModule_t(const int stackSize, T *...mods) : stackSize(stackSize), Module_t(mods...){};
34 // ActiveModule_t(int stackSize, T *...mods) : stackSize(stackSize), count(sizeof...(mods)), dependents{static_cast<Module_t *>(mods)...}, id(1 << s_id++) { };
35};
36
37} // namespace Module
Module_t should be used for major components of a framework, it is used to isolate,...