X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=bindings%2Fcxx%2Finclude%2Flibsigrok%2Flibsigrok.hpp;h=1936d4d5d2820c3de60e395d199e64442890199f;hb=73a1eb017be9369597f404e61ed8b79767a58383;hp=e30fd4d396a360dbca2df87de75eda0ff17c8b57;hpb=d1075e5acf811d6e6a0d5a87df1ff8f5ce6bf901;p=libsigrok.git diff --git a/bindings/cxx/include/libsigrok/libsigrok.hpp b/bindings/cxx/include/libsigrok/libsigrok.hpp index e30fd4d3..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(); @@ -668,10 +676,13 @@ protected: Session(shared_ptr context); Session(shared_ptr context, string filename); ~Session(); + shared_ptr get_device(const struct sr_dev_inst *sdi); const shared_ptr _context; - map > _devices; + map _owned_devices; + map > _other_devices; vector _datafeed_callbacks; map, SourceCallbackData *> _source_callbacks; + string _filename; bool _saving; bool _save_initialized; string _save_filename; @@ -680,6 +691,7 @@ protected: friend class Deleter; friend class Context; friend class DatafeedCallbackData; + friend class SessionDevice; }; /** A packet on the session datafeed */ @@ -849,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();