X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdevices%2Fdevice.hpp;h=acc772ecc5eaab8aed2ccc746f0e9911cc42590b;hb=cc9a7898ee7afc32e03dbcc991ed7ba722ed8f1b;hp=529fdd5b33c42e0bc52fc42bb1e49a5f72559c38;hpb=da30ecb7e72bd2547e524258efa5ec642988b70b;p=pulseview.git diff --git a/pv/devices/device.hpp b/pv/devices/device.hpp index 529fdd5b..acc772ec 100644 --- a/pv/devices/device.hpp +++ b/pv/devices/device.hpp @@ -22,14 +22,18 @@ #define PULSEVIEW_PV_DEVICES_DEVICE_HPP #include - +#include namespace sigrok { +class ConfigKey; class Device; class Session; } // namespace sigrok namespace pv { + +class DeviceManager; + namespace devices { class Device @@ -44,7 +48,27 @@ public: std::shared_ptr device() const; - virtual void create() = 0; + template + T read_config(const sigrok::ConfigKey *key, const T default_value = 0); + + /** + * Builds the full name. It only contains all the fields. + */ + virtual std::string full_name() const = 0; + + /** + * Builds the display name. It only contains fields as required. + * @param device_manager a reference to the device manager is needed + * so that other similarly titled devices can be detected. + */ + virtual std::string display_name( + const DeviceManager &device_manager) const = 0; + + virtual void open() = 0; + + virtual void close() = 0; + + virtual void start(); virtual void run();