X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdevices%2Fdevice.hpp;h=fd78960c153f50917eb08fca0745e54186c104f2;hb=93cc1067d3b87a5f5dda6a5ee7dcf83d179c9b6b;hp=0a8f2438decc86fd9f592c2b92cdf89ba3f25236;hpb=5237f0c50352b523c6a0c3d7f931081ecdbdecaa;p=pulseview.git
diff --git a/pv/devices/device.hpp b/pv/devices/device.hpp
index 0a8f243..fd78960 100644
--- a/pv/devices/device.hpp
+++ b/pv/devices/device.hpp
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
#ifndef PULSEVIEW_PV_DEVICES_DEVICE_HPP
@@ -24,6 +23,9 @@
#include
#include
+using std::shared_ptr;
+using std::string;
+
namespace sigrok {
class ConfigKey;
class Device;
@@ -39,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);
@@ -54,17 +56,19 @@ 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 create() = 0;
+ virtual void open() = 0;
+
+ virtual void close() = 0;
virtual void start();
@@ -73,8 +77,8 @@ public:
virtual void stop();
protected:
- std::shared_ptr session_;
- std::shared_ptr device_;
+ shared_ptr session_;
+ shared_ptr device_;
};
} // namespace devices