diff options
| author | Nikita Kostovsky <nikita@kostovsky.me> | 2025-11-17 16:28:45 +0100 |
|---|---|---|
| committer | Nikita Kostovsky <nikita@kostovsky.me> | 2025-11-17 16:28:45 +0100 |
| commit | 0fdae0386e2e55f489853561dc15055a168e5df1 (patch) | |
| tree | b91087c4696a3281fee528fc838b5447272432e0 /src/scanner.cpp | |
| parent | 99b78ccb9cdb82d64aa3da32dd47b052d3f51732 (diff) | |
introduce Scanner
Diffstat (limited to 'src/scanner.cpp')
| -rw-r--r-- | src/scanner.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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<ICamera> camera, std::vector<std::shared_ptr<IProtocol>> 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(); + } +} |
