Decoder::~Decoder()
{
- for (map<string, GVariant*>::const_iterator i = _options.begin();
- i != _options.end(); i++)
+ for (auto i = _options.begin(); i != _options.end(); i++)
g_variant_unref((*i).second);
}
set< shared_ptr<pv::data::Logic> > Decoder::get_data()
{
set< shared_ptr<pv::data::Logic> > data;
- for(map<const srd_channel*, shared_ptr<view::LogicSignal> >::
- const_iterator i = _probes.begin();
- i != _probes.end(); i++)
- {
+ for(auto i = _probes.cbegin(); i != _probes.cend(); i++) {
shared_ptr<view::LogicSignal> signal((*i).second);
assert(signal);
data.insert(signal->logic_data());
GHashTable *const opt_hash = g_hash_table_new_full(g_str_hash,
g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
- for (map<string, GVariant*>::const_iterator i = _options.begin();
- i != _options.end(); i++)
+ for (auto i = _options.cbegin(); i != _options.cend(); i++)
{
GVariant *const value = (*i).second;
g_variant_ref(value);
GHashTable *const probes = g_hash_table_new_full(g_str_hash,
g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
- for(map<const srd_channel*, shared_ptr<view::LogicSignal> >::
- const_iterator i = _probes.begin();
- i != _probes.end(); i++)
+ for(auto i = _probes.cbegin(); i != _probes.cend(); i++)
{
shared_ptr<view::LogicSignal> signal((*i).second);
GVariant *const gvar = g_variant_new_int32(
vector<pv::data::decode::Annotation> &dest,
uint64_t start_sample, uint64_t end_sample) const
{
- for (vector<Annotation>::const_iterator i = _annotations.begin();
- i != _annotations.end(); i++)
+ for (auto i = _annotations.cbegin(); i != _annotations.cend(); i++)
if ((*i).end_sample() > start_sample &&
(*i).start_sample() <= end_sample)
dest.push_back(*i);
assert(index < (int)_stack.size());
// Find the decoder in the stack
- list< shared_ptr<Decoder> >::iterator iter = _stack.begin();
+ auto iter = _stack.begin();
for(int i = 0; i < index; i++, iter++)
assert(iter != _stack.end());
{
lock_guard<mutex> lock(_output_mutex);
- std::map<const Row, decode::RowData>::const_iterator iter =
- _rows.find(row);
+ const auto iter = _rows.find(row);
if (iter != _rows.end())
(*iter).second.get_annotation_subset(dest,
start_sample, end_sample);
{
uint64_t max_sample_count = 0;
- for (map<const Row, RowData>::const_iterator i = _rows.begin();
- i != _rows.end(); i++)
+ for (auto i = _rows.cbegin(); i != _rows.end(); i++)
max_sample_count = max(max_sample_count,
(*i).second.get_max_sample());
const srd_decoder *const decc = pdata->pdo->di->decoder;
assert(decc);
- map<const Row, decode::RowData>::iterator row_iter = d->_rows.end();
+ auto row_iter = d->_rows.end();
// Try looking up the sub-row of this class
- const map<pair<const srd_decoder*, int>, Row>::const_iterator r =
- d->_class_rows.find(make_pair(decc, a.format()));
+ const auto r = d->_class_rows.find(make_pair(decc, a.format()));
if (r != d->_class_rows.end())
row_iter = d->_rows.find((*r).second);
else
// Remove any device instances from this driver from the device
// list. They will not be valid after the scan.
- list< shared_ptr<device::Device> >::iterator i = _devices.begin();
+ auto i = _devices.begin();
while (i != _devices.end()) {
if ((*i)->dev_inst()->driver == driver)
i = _devices.erase(i);
Qt::UserRole).value<void*>();
assert(sdi);
- std::map<const sr_dev_inst*, boost::shared_ptr<pv::device::Device> >::
- const_iterator iter = _device_map.find(sdi);
+ const auto iter = _device_map.find(sdi);
assert(iter != _device_map.end());
return (*iter).second;
const sr_channel *const probe = (const sr_channel*)p->data;
assert(probe);
- const map<const sr_channel*, shared_ptr<Signal> >::
- iterator iter = signal_map.find(probe);
+ const auto iter = signal_map.find(probe);
assert(iter != signal_map.end());
group_sigs.push_back((*iter).second);
// Get the value from the hash table if it is already present
const map<string, GVariant*>& options = _decoder->options();
- map<string, GVariant*>::const_iterator iter = options.find(id);
+ const auto iter = options.find(id);
if (iter != options.end())
val = (*iter).second;
void SigSession::remove_decode_signal(view::DecodeTrace *signal)
{
- for (vector< shared_ptr<view::DecodeTrace> >::iterator i =
- _decode_traces.begin();
- i != _decode_traces.end();
- i++)
+ for (auto i = _decode_traces.begin(); i != _decode_traces.end(); i++)
if ((*i).get() == signal)
{
_decode_traces.erase(i);
index).value<void*>();
assert(sdi);
- map<const sr_dev_inst*, boost::weak_ptr<device::DevInst> >::
- const_iterator iter = _device_selector_map.find(sdi);
+ const auto iter = _device_selector_map.find(sdi);
if (iter == _device_selector_map.end())
return shared_ptr<pv::device::DevInst>();
}
else
{
- list< shared_ptr<Decoder> >::const_iterator iter =
- stack.begin();
+ auto iter = stack.cbegin();
for (int i = 0; i < (int)stack.size(); i++, iter++) {
shared_ptr<Decoder> dec(*iter);
create_decoder_form(i, dec, parent, form);
const vector< shared_ptr<Signal> > sigs = _session.get_signals();
assert(_decoder_stack);
- const map<const srd_channel*,
- shared_ptr<LogicSignal> >::const_iterator probe_iter =
- dec->channels().find(pdch);
+ const auto probe_iter = dec->channels().find(pdch);
QComboBox *selector = new QComboBox(parent);
const list< shared_ptr<Decoder> > stack(_decoder_stack->stack());
// Find the decoder in the stack
- list< shared_ptr<Decoder> >::const_iterator iter = stack.begin();
+ auto iter = stack.cbegin();
for(int i = 0; i < index; i++, iter++)
assert(iter != stack.end());
const int delta = event->pos().y() - _mouse_down_point.y();
- for (std::list<std::pair<boost::weak_ptr<Trace>,
- int> >::iterator i = _drag_traces.begin();
- i != _drag_traces.end(); i++) {
+ for (auto i = _drag_traces.begin(); i != _drag_traces.end(); i++) {
const boost::shared_ptr<Trace> trace((*i).first);
if (trace) {
const int y = (*i).second + delta;
QLineF *const edge_lines = new QLineF[edge_count];
line = edge_lines;
- for (vector<pv::data::LogicSnapshot::EdgePair>::const_iterator i =
- edges.begin() + 1;
- i != edges.end() - 1; i++) {
+ for (auto i = edges.cbegin() + 1; i != edges.cend() - 1; i++) {
const float x = ((*i).first / samples_per_pixel -
pixels_offset) + left;
*line++ = QLineF(x, high_offset, x, low_offset);
{
QLineF *line = lines;
- for (vector<pv::data::LogicSnapshot::EdgePair>::const_iterator i =
- edges.begin(); i != (edges.end() - 1); i++)
+ for (auto i = edges.begin(); i != (edges.end() - 1); i++)
if ((*i).second == level) {
*line++ = QLineF(
((*i).first / samples_per_pixel -
vector< shared_ptr<Trace> > traces(sigs.size());
#endif
- vector< shared_ptr<Trace> >::iterator i = traces.begin();
+ auto i = traces.begin();
i = copy(sigs.begin(), sigs.end(), i);
#ifdef ENABLE_DECODE
i = copy(decode_sigs.begin(), decode_sigs.end(), i);