From 0fdae0386e2e55f489853561dc15055a168e5df1 Mon Sep 17 00:00:00 2001 From: Nikita Kostovsky Date: Mon, 17 Nov 2025 16:28:45 +0100 Subject: introduce Scanner --- src/scanner.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/scanner.cpp') diff --git a/src/scanner.cpp b/src/scanner.cpp index 1f14ca0..07d3c0f 100644 --- a/src/scanner.cpp +++ b/src/scanner.cpp @@ -1,8 +1,30 @@ #include "scanner.h" +#include "protocols/iprotocol.h" + Scanner::Scanner(std::shared_ptr camera, std::vector> protocols) : IScanner{camera, protocols} { // m_protocols.push_back() } + +bool Scanner::startAllProtocols() +{ + for (const auto& protocol : m_protocols) { + if (!protocol->start()) { + stopAllProtocols(); + + return false; + } + } + + return true; +} + +void Scanner::stopAllProtocols() +{ + for (const auto& protocol : m_protocols) { + protocol->stop(); + } +} -- cgit v1.2.3-70-g09d2