]> sigrok.org Git - pulseview.git/blobdiff - pv/data/analog.cpp
Replaced BOOST_FOREACH with C++11 range-based for loops
[pulseview.git] / pv / data / analog.cpp
index fadd5c696331ce95a0c79ee057b1d81b40d6434c..c7430432613c3eadbf373e25b16374f0a1cb980f 100644 (file)
@@ -21,8 +21,9 @@
 #include "analog.h"
 #include "analogsnapshot.h"
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using std::deque;
+using std::max;
 
 namespace pv {
 namespace data {
@@ -42,10 +43,20 @@ deque< shared_ptr<AnalogSnapshot> >& Analog::get_snapshots()
        return _snapshots;
 }
 
-void Analog::clear_snapshots()
+void Analog::clear()
 {
        _snapshots.clear();
 }
 
+uint64_t Analog::get_max_sample_count() const
+{
+       uint64_t l = 0;
+       for (const boost::shared_ptr<AnalogSnapshot> s : _snapshots) {
+               assert(s);
+               l = max(l, s->get_sample_count());
+       }
+       return l;
+}
+
 } // namespace data
 } // namespace pv