X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fcxx%2Finclude%2Flibsigrok%2Flibsigrok.hpp;h=0fcc59d0f682c3f0150cd0de4071170ee3efd640;hb=ae431bc8d607ee381052eed1727f644fbc1fd89d;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..0fcc59d0 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() { @@ -346,8 +352,6 @@ protected: class SR_API Device : public Configurable { public: - /** Description identifying this device. */ - string description(); /** Vendor name for this device. */ string vendor(); /** Model name for this device. */ @@ -664,14 +668,19 @@ public: /** Set trigger setting. * @param trigger Trigger object to use. */ void set_trigger(shared_ptr trigger); + /** Get filename this session was loaded from. */ + string filename(); 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 +689,7 @@ protected: friend class Deleter; friend class Context; friend class DatafeedCallbackData; + friend class SessionDevice; }; /** A packet on the session datafeed */