From: Joel Holdsworth Date: Wed, 8 Jan 2014 20:31:50 +0000 (+0000) Subject: Added SigSession::get_data() X-Git-Tag: pulseview-0.2.0~157 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=02412f0b16cb5ad92654c92b472a84268e79bb54;p=pulseview.git Added SigSession::get_data() --- diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index a582122c..82fa8770 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -53,6 +53,7 @@ using boost::lock_guard; using boost::mutex; using boost::shared_ptr; using std::map; +using std::set; using std::string; using std::vector; @@ -202,6 +203,18 @@ void SigSession::stop_capture() _sampling_thread.join(); } +set< shared_ptr > SigSession::get_data() const +{ + lock_guard lock(_signals_mutex); + set< shared_ptr > data; + BOOST_FOREACH(const shared_ptr sig, _signals) { + assert(sig); + data.insert(sig->data()); + } + + return data; +} + vector< shared_ptr > SigSession::get_signals() const { lock_guard lock(_signals_mutex); diff --git a/pv/sigsession.h b/pv/sigsession.h index 748b81ff..5b4144a7 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -46,6 +46,7 @@ class Analog; class AnalogSnapshot; class Logic; class LogicSnapshot; +class SignalData; } namespace view { @@ -89,6 +90,8 @@ public: void stop_capture(); + std::set< boost::shared_ptr > get_data() const; + std::vector< boost::shared_ptr > get_signals() const;