projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replaced BOOST_FOREACH with C++11 range-based for loops
[pulseview.git]
/
pv
/
data
/
analogsnapshot.cpp
diff --git
a/pv/data/analogsnapshot.cpp
b/pv/data/analogsnapshot.cpp
index 4907d7954a186af7c6d7b5f0c2c8447714edc32a..ab968cf7362332667e2402b2cf8f59338c1a621c 100644
(file)
--- a/
pv/data/analogsnapshot.cpp
+++ b/
pv/data/analogsnapshot.cpp
@@
-27,8
+27,6
@@
#include <algorithm>
#include <algorithm>
-#include <boost/foreach.hpp>
-
#include "analogsnapshot.h"
using boost::lock_guard;
#include "analogsnapshot.h"
using boost::lock_guard;
@@
-47,9
+45,11
@@
const float AnalogSnapshot::LogEnvelopeScaleFactor =
logf(EnvelopeScaleFactor);
const uint64_t AnalogSnapshot::EnvelopeDataUnit = 64*1024; // bytes
logf(EnvelopeScaleFactor);
const uint64_t AnalogSnapshot::EnvelopeDataUnit = 64*1024; // bytes
-AnalogSnapshot::AnalogSnapshot() :
+AnalogSnapshot::AnalogSnapshot(
const uint64_t expected_num_samples
) :
Snapshot(sizeof(float))
{
Snapshot(sizeof(float))
{
+ set_capacity(expected_num_samples);
+
lock_guard<recursive_mutex> lock(_mutex);
memset(_envelope_levels, 0, sizeof(_envelope_levels));
}
lock_guard<recursive_mutex> lock(_mutex);
memset(_envelope_levels, 0, sizeof(_envelope_levels));
}
@@
-57,7
+57,7
@@
AnalogSnapshot::AnalogSnapshot() :
AnalogSnapshot::~AnalogSnapshot()
{
lock_guard<recursive_mutex> lock(_mutex);
AnalogSnapshot::~AnalogSnapshot()
{
lock_guard<recursive_mutex> lock(_mutex);
-
BOOST_FOREACH(Envelope &e,
_envelope_levels)
+
for (Envelope &e :
_envelope_levels)
free(e.samples);
}
free(e.samples);
}