X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevices%2Fdevice.hpp;h=fd78960c153f50917eb08fca0745e54186c104f2;hp=ceca0777118b106a105ae00b499eb6e60b9c380a;hb=6e2a5b1d677a26a637465cd4d304e2bc52e14f36;hpb=efdec55aec1a137460fa362a381ed1904182bfed diff --git a/pv/devices/device.hpp b/pv/devices/device.hpp index ceca0777..fd78960c 100644 --- a/pv/devices/device.hpp +++ b/pv/devices/device.hpp @@ -23,6 +23,9 @@ #include #include +using std::shared_ptr; +using std::string; + namespace sigrok { class ConfigKey; class Device; @@ -38,14 +41,14 @@ namespace devices { class Device { protected: - Device(); + Device() = default; public: virtual ~Device(); - std::shared_ptr session() const; + shared_ptr session() const; - std::shared_ptr device() const; + shared_ptr device() const; template T read_config(const sigrok::ConfigKey *key, const T default_value = 0); @@ -53,14 +56,14 @@ public: /** * Builds the full name. It only contains all the fields. */ - virtual std::string full_name() const = 0; + virtual 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( + virtual string display_name( const DeviceManager &device_manager) const = 0; virtual void open() = 0; @@ -74,8 +77,8 @@ public: virtual void stop(); protected: - std::shared_ptr session_; - std::shared_ptr device_; + shared_ptr session_; + shared_ptr device_; }; } // namespace devices