]> sigrok.org Git - pulseview.git/commitdiff
Replaced snapshots queue with a deque
authorJoel Holdsworth <redacted>
Thu, 6 Sep 2012 12:45:55 +0000 (13:45 +0100)
committerJoel Holdsworth <redacted>
Thu, 6 Sep 2012 12:47:43 +0000 (13:47 +0100)
logicdata.cpp
logicdata.h
logicsignal.cpp

index 1b7f5426ad8a7e01040f151372f3615c0a90300d..4e398d8cf3e5091f7c99bddceae128355cf027fe 100644 (file)
@@ -38,10 +38,10 @@ int LogicData::get_num_probes() const
 void LogicData::push_snapshot(
        boost::shared_ptr<LogicDataSnapshot> &snapshot)
 {
-       _snapshots.push(snapshot);
+       _snapshots.push_front(snapshot);
 }
 
-queue< shared_ptr<LogicDataSnapshot> >& LogicData::get_snapshots()
+deque< shared_ptr<LogicDataSnapshot> >& LogicData::get_snapshots()
 {
        return _snapshots;
 }
index 9c7e4b9782d3cd3d7092a84426304d858f8a9b38..1bf7fd300bfe574c3341f14e01efa08bb6ec0294 100644 (file)
@@ -21,7 +21,7 @@
 #include "signaldata.h"
 
 #include <boost/shared_ptr.hpp>
-#include <queue>
+#include <deque>
 
 extern "C" {
 #include <libsigrok/libsigrok.h>
@@ -39,11 +39,11 @@ public:
        void push_snapshot(
                boost::shared_ptr<LogicDataSnapshot> &snapshot);
 
-       std::queue< boost::shared_ptr<LogicDataSnapshot> >&
+       std::deque< boost::shared_ptr<LogicDataSnapshot> >&
                get_snapshots();
 
 private:
        const int _num_probes;
-       std::queue< boost::shared_ptr<LogicDataSnapshot> >
+       std::deque< boost::shared_ptr<LogicDataSnapshot> >
                _snapshots;
 };
index 69d58cb1cbc70abf9f540911ab8aefe202ba72e1..7580138fe24e87af7c164c595392968a36a08133 100644 (file)
@@ -74,7 +74,7 @@ void LogicSignal::paint(QGLWidget &widget, const QRect &rect,
        const float high_offset = rect.top() + Margin;
        const float low_offset = rect.bottom() - Margin;
 
-       const queue< shared_ptr<LogicDataSnapshot> > &snapshots =
+       const deque< shared_ptr<LogicDataSnapshot> > &snapshots =
                _data->get_snapshots();
        if(snapshots.empty())
                return;