* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <boost/foreach.hpp>
-
#include "analog.h"
#include "analogsnapshot.h"
uint64_t Analog::get_max_sample_count() const
{
uint64_t l = 0;
- BOOST_FOREACH(const boost::shared_ptr<AnalogSnapshot> s, _snapshots) {
+ for (const boost::shared_ptr<AnalogSnapshot> s : _snapshots) {
assert(s);
l = max(l, s->get_sample_count());
}
#include <algorithm>
-#include <boost/foreach.hpp>
-
#include "analogsnapshot.h"
using boost::lock_guard;
AnalogSnapshot::~AnalogSnapshot()
{
lock_guard<recursive_mutex> lock(_mutex);
- BOOST_FOREACH(Envelope &e, _envelope_levels)
+ for (Envelope &e : _envelope_levels)
free(e.samples);
}
#include <libsigrokdecode/libsigrokdecode.h>
-#include <boost/foreach.hpp>
#include <boost/thread/thread.hpp>
#include <stdexcept>
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())
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");
}
// 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();
// 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())))
// 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);
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <boost/foreach.hpp>
-
#include "logic.h"
#include "logicsnapshot.h"
uint64_t Logic::get_max_sample_count() const
{
uint64_t l = 0;
- BOOST_FOREACH(boost::shared_ptr<LogicSnapshot> s, _snapshots) {
+ for (boost::shared_ptr<LogicSnapshot> s : _snapshots) {
assert(s);
l = max(l, s->get_sample_count());
}
#include <stdlib.h>
#include <math.h>
-#include <boost/foreach.hpp>
-
#include "config.h"
#include "logicsnapshot.h"
LogicSnapshot::~LogicSnapshot()
{
lock_guard<recursive_mutex> lock(_mutex);
- BOOST_FOREACH(MipMapLevel &l, _mip_map)
+ for (MipMapLevel &l : _mip_map)
free(l.data);
}
#include <stdexcept>
#include <string>
-#include <boost/foreach.hpp>
-
#include <libsigrok/libsigrok.h>
using boost::shared_ptr;
void DeviceManager::release_devices()
{
// Release all the used devices
- BOOST_FOREACH(shared_ptr<device::Device> dev, _devices) {
+ for (shared_ptr<device::Device> dev : _devices) {
assert(dev);
dev->release();
}
void DeviceManager::release_driver(struct sr_dev_driver *const driver)
{
- BOOST_FOREACH(shared_ptr<device::Device> dev, _devices) {
+ for (shared_ptr<device::Device> dev : _devices) {
assert(dev);
if(dev->dev_inst()->driver == driver)
dev->release();
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <boost/foreach.hpp>
-
#include <libsigrok/libsigrok.h>
#include "connect.h"
g_slist_free_full(drvopts, (GDestroyNotify)free_drvopts);
- BOOST_FOREACH(shared_ptr<device::Device> dev_inst, devices)
+ for (shared_ptr<device::Device> dev_inst : devices)
{
assert(dev_inst);
const sr_dev_inst *const sdi = dev_inst->dev_inst();
#endif
#include <boost/bind.hpp>
-#include <boost/foreach.hpp>
#include <algorithm>
#include <iterator>
#include "deviceoptions.h"
-#include <boost/foreach.hpp>
-
#include <QFormLayout>
#include <QListWidget>
#include <map>
-#include <boost/foreach.hpp>
-
#include <QCheckBox>
#include <QFormLayout>
#include <QGridLayout>
// Collect a set of signals
map<const sr_channel*, shared_ptr<Signal> > signal_map;
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
- BOOST_FOREACH(const shared_ptr<Signal> &sig, sigs)
+ for (const shared_ptr<Signal> &sig : sigs)
signal_map[sig->probe()] = sig;
// Populate channel groups
int row = 0, col = 0;
QGridLayout *const grid = new QGridLayout();
- BOOST_FOREACH(const shared_ptr<pv::view::Signal>& sig, sigs)
+ for (const shared_ptr<pv::view::Signal>& sig : sigs)
{
assert(sig);
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <boost/foreach.hpp>
-
#include <QFormLayout>
#include <pv/prop/property.h>
void Binding::commit()
{
- BOOST_FOREACH(shared_ptr<pv::prop::Property> p, _properties) {
+ for (shared_ptr<pv::prop::Property> p : _properties) {
assert(p);
p->commit();
}
{
assert(layout);
- BOOST_FOREACH(shared_ptr<pv::prop::Property> p, _properties)
+ for (shared_ptr<pv::prop::Property> p : _properties)
{
assert(p);
#include "decoderoptions.h"
#include <boost/bind.hpp>
-#include <boost/foreach.hpp>
#include <boost/none_t.hpp>
#include <pv/data/decoderstack.h>
#include <stdexcept>
-#include <boost/foreach.hpp>
-
#include <sys/stat.h>
#include <QDebug>
default_device = devices.front();
// Try and find the demo device and select that by default
- BOOST_FOREACH (shared_ptr<pv::device::Device> dev, devices)
+ for (shared_ptr<pv::device::Device> dev : devices)
if (strcmp(dev->dev_inst()->driver->name,
"demo") == 0) {
default_device = dev;
{
lock_guard<mutex> lock(_signals_mutex);
set< shared_ptr<data::SignalData> > data;
- BOOST_FOREACH(const shared_ptr<view::Signal> sig, _signals) {
+ for (const shared_ptr<view::Signal> sig : _signals) {
assert(sig);
data.insert(sig->data());
}
all_probes.push_back((const srd_channel*)i->data);
// Auto select the initial probes
- BOOST_FOREACH(const srd_channel *pdch, all_probes)
- BOOST_FOREACH(shared_ptr<view::Signal> s, _signals)
+ for (const srd_channel *pdch : all_probes)
+ for (shared_ptr<view::Signal> s : _signals)
{
shared_ptr<view::LogicSignal> l =
dynamic_pointer_cast<view::LogicSignal>(s);
const sr_channel *probe) const
{
lock_guard<mutex> lock(_signals_mutex);
- BOOST_FOREACH(shared_ptr<view::Signal> sig, _signals) {
+ for (shared_ptr<view::Signal> sig : _signals) {
assert(sig);
if (sig->probe() == probe)
return sig;
// Set the sample rate of all data
const set< shared_ptr<data::SignalData> > data_set = get_data();
- BOOST_FOREACH(shared_ptr<data::SignalData> data, data_set) {
+ for (shared_ptr<data::SignalData> data : data_set) {
assert(data);
data->set_samplerate(sample_rate);
}
#include <assert.h>
-#include <boost/foreach.hpp>
-
#include <QAction>
#include <QDebug>
#include <QHelpEvent>
_device_selector.clear();
_device_selector_map.clear();
- BOOST_FOREACH (shared_ptr<pv::device::DevInst> dev_inst, devices) {
+ for (shared_ptr<pv::device::DevInst> dev_inst : devices) {
assert(dev_inst);
const string title = dev_inst->format_device_title();
const sr_dev_inst *sdi = dev_inst->dev_inst();
#include <extdef.h>
-#include <boost/foreach.hpp>
#include <boost/functional/hash.hpp>
#include <QAction>
_decoder_stack->get_annotation_subset(annotations, row,
start_sample, end_sample);
if (!annotations.empty()) {
- BOOST_FOREACH(const Annotation &a, annotations)
+ for (const Annotation &a : annotations)
draw_annotation(a, p, get_text_colour(),
annotation_height, left, right,
samples_per_pixel, pixels_offset, y,
QString best_annotation;
int best_width = 0;
- BOOST_FOREACH(const QString &a, annotations) {
+ for (const QString &a : annotations) {
const int w = p.boundingRect(QRectF(), 0, a).width();
if (w <= rect.width() && w > best_width)
best_annotation = a, best_width = w;
// We get the logic data of the first probe in the list.
// This works because we are currently assuming all
// LogicSignals have the same data/snapshot
- BOOST_FOREACH (const shared_ptr<Decoder> &dec, stack)
+ for (const shared_ptr<Decoder> &dec : stack)
if (dec && !dec->channels().empty() &&
((logic_signal = (*dec->channels().begin()).second)) &&
((data = logic_signal->logic_data())))
map<const srd_channel*, shared_ptr<LogicSignal> > probe_map;
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
- BOOST_FOREACH(const ProbeSelector &s, _probe_selectors)
+ for (const ProbeSelector &s : _probe_selectors)
{
if(s._decoder != dec)
break;
(LogicSignal*)s._combo->itemData(
s._combo->currentIndex()).value<void*>();
- BOOST_FOREACH(shared_ptr<Signal> sig, sigs)
+ for (shared_ptr<Signal> sig : sigs)
if(sig.get() == selection) {
probe_map[s._pdch] =
dynamic_pointer_cast<LogicSignal>(sig);
void DecodeTrace::commit_probes()
{
assert(_decoder_stack);
- BOOST_FOREACH(shared_ptr<data::decode::Decoder> dec,
- _decoder_stack->stack())
+ for (shared_ptr<data::decode::Decoder> dec : _decoder_stack->stack())
commit_decoder_probes(dec);
_decoder_stack->begin_decode();
#include <assert.h>
-#include <boost/foreach.hpp>
-
#include <QApplication>
#include <QMenu>
#include <QMouseEvent>
int max_width = 0;
const vector< shared_ptr<Trace> > traces(_view.get_traces());
- BOOST_FOREACH(shared_ptr<Trace> t, traces) {
+ for (shared_ptr<Trace> t : traces) {
assert(t);
if (t->enabled()) {
const int w = width();
const vector< shared_ptr<Trace> > traces(_view.get_traces());
- BOOST_FOREACH(const shared_ptr<Trace> t, traces)
+ for (const shared_ptr<Trace> t : traces)
{
assert(t);
if (t->pt_in_label_rect(0, w, pt))
void Header::clear_selection()
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
- BOOST_FOREACH(const shared_ptr<Trace> t, traces) {
+ for (const shared_ptr<Trace> t : traces) {
assert(t);
t->select(false);
}
painter.setRenderHint(QPainter::Antialiasing);
const bool dragging = !_drag_traces.empty();
- BOOST_FOREACH(const shared_ptr<Trace> t, traces)
+ for (const shared_ptr<Trace> t : traces)
{
assert(t);
_mouse_down_point = event->pos();
// Save the offsets of any signals which will be dragged
- BOOST_FOREACH(const shared_ptr<Trace> t, traces)
+ for (const shared_ptr<Trace> t : traces)
if (t->selected())
_drag_traces.push_back(
make_pair(t, t->get_v_offset()));
if (~QApplication::keyboardModifiers() & Qt::ControlModifier) {
// Unselect all other signals because the Ctrl is not
// pressed
- BOOST_FOREACH(const shared_ptr<Trace> t, traces)
+ for (const shared_ptr<Trace> t : traces)
if (t != mouse_over_trace)
t->select(false);
}
case Qt::Key_Delete:
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
- BOOST_FOREACH(const shared_ptr<Trace> t, traces)
+ for (const shared_ptr<Trace> t : traces)
if (t->selected())
t->delete_pressed();
break;
void Header::on_signals_changed()
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
- BOOST_FOREACH(shared_ptr<Trace> t, traces) {
+ for (shared_ptr<Trace> t : traces) {
assert(t);
connect(t.get(), SIGNAL(visibility_changed()),
this, SLOT(on_trace_changed()));
#include <limits.h>
#include <math.h>
-#include <boost/foreach.hpp>
-
#include <QEvent>
#include <QMouseEvent>
#include <QScrollBar>
return;
double samplerate = 0.0;
- BOOST_FOREACH(const shared_ptr<SignalData> d, visible_data) {
+ for (const shared_ptr<SignalData> d : visible_data) {
assert(d);
samplerate = max(samplerate, d->samplerate());
}
// List the selected signals
const vector< shared_ptr<Trace> > traces(get_traces());
- BOOST_FOREACH (shared_ptr<Trace> t, traces) {
+ for (shared_ptr<Trace> t : traces) {
assert(t);
if (t->selected())
items.push_back(t);
// Make a set of all the visible data objects
set< shared_ptr<SignalData> > visible_data;
- BOOST_FOREACH(const shared_ptr<Signal> sig, sigs)
+ for (const shared_ptr<Signal> sig : sigs)
if (sig->enabled())
visible_data.insert(sig->data());
return make_pair(0.0, 0.0);
double left_time = DBL_MAX, right_time = DBL_MIN;
- BOOST_FOREACH(const shared_ptr<SignalData> d, visible_data)
+ for (const shared_ptr<SignalData> d : visible_data)
{
const double start_time = d->get_start_time();
double samplerate = d->samplerate();
const vector< shared_ptr<Trace> > traces(get_traces());
int v_min = INT_MAX;
- BOOST_FOREACH(const shared_ptr<Trace> t, traces)
+ for (const shared_ptr<Trace> t : traces)
v_min = min(t->get_v_offset(), v_min);
const int delta = -min(v_min, 0);
- BOOST_FOREACH(shared_ptr<Trace> t, traces)
+ for (shared_ptr<Trace> t : traces)
t->set_v_offset(t->get_v_offset() + delta);
verticalScrollBar()->setSliderPosition(_v_offset + delta);
{
int offset = SignalMargin + SignalHeight;
const vector< shared_ptr<Trace> > traces(get_traces());
- BOOST_FOREACH(shared_ptr<Trace> t, traces) {
+ for (shared_ptr<Trace> t : traces) {
t->set_view(this);
t->set_v_offset(offset);
offset += SignalHeight + 2 * SignalMargin;
#include <QMouseEvent>
-#include <boost/foreach.hpp>
-
using boost::shared_ptr;
using std::max;
using std::min;
{
int h = 0;
const vector< shared_ptr<Trace> > traces(_view.get_traces());
- BOOST_FOREACH(const shared_ptr<Trace> t, traces) {
+ for (const shared_ptr<Trace> t : traces) {
assert(t);
h = max(t->get_v_offset() + View::SignalHeight, h);
}
_view.cursors().draw_viewport_background(p, rect());
// Plot the signal
- BOOST_FOREACH(const shared_ptr<Trace> t, traces)
+ for (const shared_ptr<Trace> t : traces)
{
assert(t);
t->paint_back(p, 0, width());
}
- BOOST_FOREACH(const shared_ptr<Trace> t, traces)
+ for (const shared_ptr<Trace> t : traces)
t->paint_mid(p, 0, width());
- BOOST_FOREACH(const shared_ptr<Trace> t, traces)
+ for (const shared_ptr<Trace> t : traces)
t->paint_fore(p, 0, width());
if (_view.cursors_shown())
void Viewport::on_signals_changed()
{
const vector< shared_ptr<Trace> > traces(_view.get_traces());
- BOOST_FOREACH(shared_ptr<Trace> t, traces) {
+ for (shared_ptr<Trace> t : traces) {
assert(t);
connect(t.get(), SIGNAL(visibility_changed()),
this, SLOT(update()));