Loading...
Searching...
No Matches
LibraryDeviceEnumerator.hpp
1#pragma once
2#include <Device/Protocol/ProtocolFactoryInterface.hpp>
3
4#include <score/tools/RecursiveWatch.hpp>
5
6#include <score_plugin_protocols_export.h>
7
8namespace Protocols
9{
10
11class SCORE_PLUGIN_PROTOCOLS_EXPORT LibraryDeviceEnumerator
13{
14public:
15 std::string m_pattern;
16 Device::ProtocolFactory::ConcreteKey m_key;
17 std::function<QVariant(QByteArray)> m_createDeviceSettings;
19
21 std::string pattern, QStringList extension, Device::ProtocolFactory::ConcreteKey k,
22 std::function<QVariant(QByteArray)> createDev, const score::DocumentContext& ctx);
23
24 void next(std::string_view path);
25
26 void enumerate(std::function<void(const QString&, const Device::DeviceSettings&)>
27 onDevice) const override;
28};
29
30class SCORE_PLUGIN_PROTOCOLS_EXPORT SubfolderDeviceEnumerator
32{
33public:
34 using ret_type = std::vector<std::pair<QString, QVariant>>;
35 using func_type = std::function<ret_type(QString)>;
36 Device::ProtocolFactory::ConcreteKey m_key;
37 func_type m_createDeviceSettings;
38
40 QStringList rootFolder, Device::ProtocolFactory::ConcreteKey k,
41 func_type createDev, const score::DocumentContext& ctx);
42
43 void next(std::string_view path);
44
45 void enumerate(std::function<void(const QString&, const Device::DeviceSettings&)>
46 onDevice) const override;
47
48 int m_finished = 0;
49};
50}
Definition ProtocolFactoryInterface.hpp:29
Definition LibraryDeviceEnumerator.hpp:13
Definition LibraryDeviceEnumerator.hpp:32
Definition RecursiveWatch.hpp:16
Definition DeviceSettings.hpp:20
Definition DocumentContext.hpp:18