diff options
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(); + } +} |
