summaryrefslogtreecommitdiff
path: root/src/scanner.cpp
blob: 07d3c0fff0a98af8874ded1cbf09e3ec4a93bb13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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();
    }
}