Replaced boost::shared_ptr with std::shared_ptr
[pulseview.git] / pv / data / decoderstack.cpp
index f82d3ecc1ef82f32dbfbee4f460d5af588a2fd1c..40683758a4c1280de4815e7439e09e68fc5e47cf 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <libsigrokdecode/libsigrokdecode.h>
 
-#include <boost/foreach.hpp>
 #include <boost/thread/thread.hpp>
 
 #include <stdexcept>
@@ -39,7 +38,6 @@
 using boost::lock_guard;
 using boost::mutex;
 using boost::optional;
-using boost::shared_ptr;
 using boost::unique_lock;
 using std::deque;
 using std::make_pair;
@@ -48,6 +46,7 @@ using std::min;
 using std::list;
 using std::map;
 using std::pair;
+using std::shared_ptr;
 using std::vector;
 
 using namespace pv::data::decode;
@@ -88,13 +87,13 @@ DecoderStack::~DecoderStack()
        }
 }
 
-const std::list< boost::shared_ptr<decode::Decoder> >&
+const std::list< std::shared_ptr<decode::Decoder> >&
 DecoderStack::stack() const
 {
        return _stack;
 }
 
-void DecoderStack::push(boost::shared_ptr<decode::Decoder> decoder)
+void DecoderStack::push(std::shared_ptr<decode::Decoder> decoder)
 {
        assert(decoder);
        _stack.push_back(decoder);
@@ -126,7 +125,7 @@ std::vector<Row> DecoderStack::get_visible_rows() const
 
        vector<Row> rows;
 
-       BOOST_FOREACH (const shared_ptr<decode::Decoder> &dec, _stack)
+       for (const shared_ptr<decode::Decoder> &dec : _stack)
        {
                assert(dec);
                if (!dec->shown())
@@ -194,7 +193,7 @@ void DecoderStack::begin_decode()
        clear();
 
        // Check that all decoders have the required channels
-       BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec, _stack)
+       for (const shared_ptr<decode::Decoder> &dec : _stack)
                if (!dec->have_required_probes()) {
                        _error_message = tr("One or more required channels "
                                "have not been specified");
@@ -202,7 +201,7 @@ void DecoderStack::begin_decode()
                }
 
        // Add classes
-       BOOST_FOREACH (const shared_ptr<decode::Decoder> &dec, _stack)
+       for (const shared_ptr<decode::Decoder> &dec : _stack)
        {
                assert(dec);
                const srd_decoder *const decc = dec->decoder();
@@ -235,7 +234,7 @@ void DecoderStack::begin_decode()
        // We get the logic data of the first channel in the list.
        // This works because we are currently assuming all
        // LogicSignals have the same data/snapshot
-       BOOST_FOREACH (const shared_ptr<decode::Decoder> &dec, _stack)
+       for (const shared_ptr<decode::Decoder> &dec : _stack)
                if (dec && !dec->channels().empty() &&
                        ((logic_signal = (*dec->channels().begin()).second)) &&
                        ((data = logic_signal->logic_data())))
@@ -336,7 +335,7 @@ void DecoderStack::decode_proc()
        // Create the decoders
        const unsigned int unit_size = _snapshot->unit_size();
 
-       BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec, _stack)
+       for (const shared_ptr<decode::Decoder> &dec : _stack)
        {
                srd_decoder_inst *const di = dec->create_decoder_inst(session, unit_size);