From: Joel Holdsworth Date: Thu, 6 Sep 2012 12:45:55 +0000 (+0100) Subject: Replaced snapshots queue with a deque X-Git-Tag: pulseview-0.1.0~312 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1e669074475e36ae5f7e1fbdc9ad5809beaccdf3;p=pulseview.git Replaced snapshots queue with a deque --- diff --git a/logicdata.cpp b/logicdata.cpp index 1b7f5426..4e398d8c 100644 --- a/logicdata.cpp +++ b/logicdata.cpp @@ -38,10 +38,10 @@ int LogicData::get_num_probes() const void LogicData::push_snapshot( boost::shared_ptr &snapshot) { - _snapshots.push(snapshot); + _snapshots.push_front(snapshot); } -queue< shared_ptr >& LogicData::get_snapshots() +deque< shared_ptr >& LogicData::get_snapshots() { return _snapshots; } diff --git a/logicdata.h b/logicdata.h index 9c7e4b97..1bf7fd30 100644 --- a/logicdata.h +++ b/logicdata.h @@ -21,7 +21,7 @@ #include "signaldata.h" #include -#include +#include extern "C" { #include @@ -39,11 +39,11 @@ public: void push_snapshot( boost::shared_ptr &snapshot); - std::queue< boost::shared_ptr >& + std::deque< boost::shared_ptr >& get_snapshots(); private: const int _num_probes; - std::queue< boost::shared_ptr > + std::deque< boost::shared_ptr > _snapshots; }; diff --git a/logicsignal.cpp b/logicsignal.cpp index 69d58cb1..7580138f 100644 --- a/logicsignal.cpp +++ b/logicsignal.cpp @@ -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 > &snapshots = + const deque< shared_ptr > &snapshots = _data->get_snapshots(); if(snapshots.empty()) return;