BS_Praktikum4/sensor_network.h

20 lines
416 B
C
Raw Normal View History

2025-06-03 00:50:08 +02:00
#pragma once
#include <thread>
#include <atomic>
#include <vector>
#include "ring_buffer.h"
#include "analysis_model.h"
template <size_t N>
class SensorNetwork {
2025-06-03 01:25:44 +02:00
RingBuffer<N> buffer;
AnalysisModel model;
std::atomic<bool> running = false;
std::vector<std::thread> threads;
2025-06-03 00:50:08 +02:00
public:
2025-06-03 01:25:44 +02:00
~SensorNetwork() { if (running) stop(); }
void start(size_t sensors, size_t analysers);
2025-06-03 00:50:08 +02:00
void stop();
2025-06-03 01:25:44 +02:00
};