]> sigrok.org Git - pulseview.git/commitdiff
Added SigSession::get_data()
authorJoel Holdsworth <redacted>
Wed, 8 Jan 2014 20:31:50 +0000 (20:31 +0000)
committerJoel Holdsworth <redacted>
Sat, 11 Jan 2014 09:23:34 +0000 (09:23 +0000)
pv/sigsession.cpp
pv/sigsession.h

index a582122c15d3cdb353551c209c2c388835d397de..82fa877065254cd05c38f82aa64c19c54063732e 100644 (file)
@@ -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<data::SignalData> > SigSession::get_data() const
+{
+       lock_guard<mutex> lock(_signals_mutex);
+       set< shared_ptr<data::SignalData> > data;
+       BOOST_FOREACH(const shared_ptr<view::Signal> sig, _signals) {
+               assert(sig);
+               data.insert(sig->data());
+       }
+
+       return data;
+}
+
 vector< shared_ptr<view::Signal> > SigSession::get_signals() const
 {
        lock_guard<mutex> lock(_signals_mutex);
index 748b81ffae3f193ba17363c6c640dc22e2ed3d50..5b4144a7cbb9f026378fef3427a0de96d895c585 100644 (file)
@@ -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<data::SignalData> > get_data() const;
+
        std::vector< boost::shared_ptr<view::Signal> >
                get_signals() const;