parent
d194d9e18d
commit
f3a82ab88b
6 changed files with 167 additions and 24 deletions
|
|
@ -5,12 +5,22 @@
|
|||
#include "ring_buffer.h"
|
||||
#include "analysis_model.h"
|
||||
|
||||
/**
|
||||
* Hauptklasse des Sensornetzwerks
|
||||
* @tparam N Größe des Ringpuffers
|
||||
*
|
||||
* Verwaltet alle Komponenten:
|
||||
* - Ringpuffer für Sensordaten
|
||||
* - Analysemodell
|
||||
* - Threads für Sensoren, Analyse und Controller
|
||||
*/
|
||||
template <size_t N>
|
||||
class SensorNetwork {
|
||||
RingBuffer<N> buffer;
|
||||
AnalysisModel model;
|
||||
std::atomic<bool> running{false};
|
||||
RingBuffer<N> buffer; // Gemeinsamer Datenpuffer
|
||||
AnalysisModel model; // Geteiltes Analysemodell
|
||||
std::atomic<bool> running{false}; // Steuerflag für Threads
|
||||
|
||||
// Thread-Container
|
||||
std::vector<std::thread> sensors;
|
||||
std::vector<std::thread> analysers;
|
||||
std::thread controller;
|
||||
|
|
@ -24,7 +34,8 @@ public:
|
|||
void stop();
|
||||
|
||||
private:
|
||||
// Thread-Funktionen
|
||||
void sensor_thread(int id);
|
||||
void analyser_thread(int id);
|
||||
void controller_thread();
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue