]> sigrok.org Git - libsigrokflow.git/commitdiff
Initial class hierarchy.
authorMartin Ling <redacted>
Sat, 29 Dec 2018 21:01:09 +0000 (22:01 +0100)
committerUwe Hermann <redacted>
Tue, 8 Jan 2019 15:04:16 +0000 (16:04 +0100)
include/libsigrokflow/libsigrokflow.hpp
src/main.cpp

index 381c46bbbf4783aefa64efa290eb1c5c31776fe1..a5fc25314c57c3d518852a3fa6d40f55793ff254 100644 (file)
 #ifndef LIBSIGROKFLOW_LIBSIGROKFLOW_HPP
 #define LIBSIGROKFLOW_LIBSIGROKFLOW_HPP
 
+#include <gstreamermm.h>
+#include <libsigrokcxx/libsigrokcxx.hpp>
+
 namespace Srf
 {
 
+using namespace std;
+
 void init();
 
-}
+class Block
+{
+        /* Config API etc goes here */
+};
+
+class GstBlock :
+        public Gst::Element
+{
+        /* Operations specific to sigrok GStreamer blocks go here. */
+};
+
+class Device :
+        public GstBlock
+{
+        /* Operations specific to hardware devices go here */
+};
 
+class CaptureDevice :
+        public Device
+{
+        /* Operations specific to capture (source) devices go here */
+protected :
+        CaptureDevice();
+};
+
+class LegacyCaptureDevice :
+        public CaptureDevice
+{
+public:
+        /* Construct from libsigrok device object */
+        LegacyCaptureDevice(shared_ptr<sigrok::Device>);
+
+        /* Retrieve libsigrok device object */
+        shared_ptr<sigrok::Device> libsigrok_device();
+private:
+        shared_ptr<sigrok::Device> _device;
+};
+
+
+}
 #endif
index 96d720e235a9d62228e50d7c620cfada076dd8b5..7f0c8ab4ba1b3a0fbb2f825f742e5a56529f599f 100644 (file)
 #include <config.h>
 #include <libsigrokflow/libsigrokflow.hpp>
 
+#include <iostream>
+
 namespace Srf
 {
 
+using namespace std;
+
 void init()
 {
 }
 
+LegacyCaptureDevice::LegacyCaptureDevice(shared_ptr<sigrok::Device> device) :
+       _device(device)
+{
+}
+
+shared_ptr<sigrok::Device> LegacyCaptureDevice::libsigrok_device()
+{
+       return _device;
+}
+
 }