X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fcxx%2Finclude%2Flibsigrok%2Flibsigrok.hpp;h=1936d4d5d2820c3de60e395d199e64442890199f;hb=73a1eb017be9369597f404e61ed8b79767a58383;hp=0bf19015b22bee0d0068983d7fcfacd0d9b86504;hpb=ca4e307a934ba395bdc3e2a48b83835d05a047c2;p=libsigrok.git diff --git a/bindings/cxx/include/libsigrok/libsigrok.hpp b/bindings/cxx/include/libsigrok/libsigrok.hpp index 0bf19015..1936d4d5 100644 --- a/bindings/cxx/include/libsigrok/libsigrok.hpp +++ b/bindings/cxx/include/libsigrok/libsigrok.hpp @@ -149,6 +149,12 @@ protected: weak_ptr _weak_this; public: + /* Get parent object that owns this object. */ + shared_ptr parent() + { + return _parent; + } + /* Note, this implementation will create a new smart_ptr if none exists. */ shared_ptr shared_from_this() { @@ -347,7 +353,7 @@ class SR_API Device : public Configurable { public: /** Description identifying this device. */ - string description(); + virtual string description(); /** Vendor name for this device. */ string vendor(); /** Model name for this device. */ @@ -609,6 +615,8 @@ class SR_API SessionDevice : public ParentOwned, public Device { + /** Description identifying this device. */ + string description(); protected: SessionDevice(struct sr_dev_inst *sdi); ~SessionDevice(); @@ -674,6 +682,7 @@ protected: map > _other_devices; vector _datafeed_callbacks; map, SourceCallbackData *> _source_callbacks; + string _filename; bool _saving; bool _save_initialized; string _save_filename; @@ -682,6 +691,7 @@ protected: friend class Deleter; friend class Context; friend class DatafeedCallbackData; + friend class SessionDevice; }; /** A packet on the session datafeed */ @@ -851,6 +861,9 @@ class SR_API InputDevice : public ParentOwned, public Device { +public: + /** Description identifying this device. */ + string description(); protected: InputDevice(shared_ptr input, struct sr_dev_inst *sdi); ~InputDevice();