From: Martin Ling Date: Sat, 29 Dec 2018 21:01:09 +0000 (+0100) Subject: Initial class hierarchy. X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=f7363af19dd8d9a0e07d1b315fe3a8392d7acf25;hp=a2afbaed5c597771435f14b68e812a73baa3a7c6;p=libsigrokflow.git Initial class hierarchy. --- diff --git a/include/libsigrokflow/libsigrokflow.hpp b/include/libsigrokflow/libsigrokflow.hpp index 381c46b..a5fc253 100644 --- a/include/libsigrokflow/libsigrokflow.hpp +++ b/include/libsigrokflow/libsigrokflow.hpp @@ -20,11 +20,54 @@ #ifndef LIBSIGROKFLOW_LIBSIGROKFLOW_HPP #define LIBSIGROKFLOW_LIBSIGROKFLOW_HPP +#include +#include + 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); + + /* Retrieve libsigrok device object */ + shared_ptr libsigrok_device(); +private: + shared_ptr _device; +}; + + +} #endif diff --git a/src/main.cpp b/src/main.cpp index 96d720e..7f0c8ab 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,11 +20,25 @@ #include #include +#include + namespace Srf { +using namespace std; + void init() { } +LegacyCaptureDevice::LegacyCaptureDevice(shared_ptr device) : + _device(device) +{ +} + +shared_ptr LegacyCaptureDevice::libsigrok_device() +{ + return _device; +} + }