]> sigrok.org Git - pulseview.git/blobdiff - pv/devices/device.hpp
Use the "default" keyword.
[pulseview.git] / pv / devices / device.hpp
index 7e0b58ad065600bdc993751f343ff8eb348d4de1..b4518fbee97091f1365c5589603f7ae6f251cf3f 100644 (file)
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * 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 <http://www.gnu.org/licenses/>.
  */
 
 #ifndef PULSEVIEW_PV_DEVICES_DEVICE_HPP
  */
 
 #ifndef PULSEVIEW_PV_DEVICES_DEVICE_HPP
@@ -25,6 +24,7 @@
 #include <string>
 
 namespace sigrok {
 #include <string>
 
 namespace sigrok {
+class ConfigKey;
 class Device;
 class Session;
 } // namespace sigrok
 class Device;
 class Session;
 } // namespace sigrok
@@ -38,7 +38,7 @@ namespace devices {
 class Device
 {
 protected:
 class Device
 {
 protected:
-       Device();
+       Device() = default;
 
 public:
        virtual ~Device();
 
 public:
        virtual ~Device();
@@ -47,6 +47,9 @@ public:
 
        std::shared_ptr<sigrok::Device> device() const;
 
 
        std::shared_ptr<sigrok::Device> device() const;
 
+       template<typename T>
+       T read_config(const sigrok::ConfigKey *key, const T default_value = 0);
+
        /**
         * Builds the full name. It only contains all the fields.
         */
        /**
         * Builds the full name. It only contains all the fields.
         */
@@ -60,7 +63,11 @@ public:
        virtual std::string display_name(
                const DeviceManager &device_manager) const = 0;
 
        virtual std::string display_name(
                const DeviceManager &device_manager) const = 0;
 
-       virtual void create() = 0;
+       virtual void open() = 0;
+
+       virtual void close() = 0;
+
+       virtual void start();
 
        virtual void run();
 
 
        virtual void run();