Loading...
Searching...
No Matches
DeviceModelProvider.hpp
1#pragma once
2#include <score/plugins/Interface.hpp>
3#include <score/plugins/InterfaceList.hpp>
4
5#include <score_lib_device_export.h>
6
7#include <memory>
8namespace score
9{
10struct DocumentContext;
11}
12namespace Device
13{
14class DeviceInterface;
15class NodeBasedItemModel;
16
17class SCORE_LIB_DEVICE_EXPORT DeviceModelProvider : public score::InterfaceBase
18{
19 SCORE_INTERFACE(DeviceModelProvider, "2f641f1d-46f8-4c88-9038-7e84957e4a03")
20
21public:
22 ~DeviceModelProvider() override;
24 getNodeModel(const score::DocumentContext& ctx) const noexcept = 0;
25
28 findDevice(const QString& name, const score::DocumentContext& ctx) const noexcept
29 {
30 return nullptr;
31 }
32
42 virtual std::shared_ptr<void>
44 {
45 return {};
46 }
47};
48
49class SCORE_LIB_DEVICE_EXPORT DeviceModelProviderList final
50 : public score::InterfaceList<DeviceModelProvider>
51{
52public:
53 ~DeviceModelProviderList() override;
54 DeviceModelProvider* getBestProvider(const score::DocumentContext& ctx) const noexcept;
55};
56}
Definition DeviceInterface.hpp:107
Definition DeviceModelProvider.hpp:18
virtual std::shared_ptr< void > listenToAllAddresses(const score::DocumentContext &ctx) const noexcept
Listens to every address of every device of the document.
Definition DeviceModelProvider.hpp:43
virtual Device::DeviceInterface * findDevice(const QString &name, const score::DocumentContext &ctx) const noexcept
Finds a device of the document by name, even if the explorer does not show it.
Definition DeviceModelProvider.hpp:28
Definition DeviceModelProvider.hpp:51
Definition NodeBasedItemModel.hpp:23
Base class for plug-in interfaces.
Definition Interface.hpp:52
InterfaceList Default implementation of InterfaceListBase.
Definition InterfaceList.hpp:97
Manipulation of Devices from Qt.
Definition AddressSettings.cpp:14
Base toolkit upon which the software is built.
Definition Application.cpp:83
Definition DocumentContext.hpp:18