X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdata%2Fanalog.cpp;h=c7430432613c3eadbf373e25b16374f0a1cb980f;hb=d9aecf1fcd9af471db3b59de7efc65b9632a6d79;hp=6e2f2db8413a2b9917f246aa59ad539dda574f29;hpb=caabb84c559023f179bf2c4600a5ebce34eab081;p=pulseview.git diff --git a/pv/data/analog.cpp b/pv/data/analog.cpp index 6e2f2db..c743043 100644 --- a/pv/data/analog.cpp +++ b/pv/data/analog.cpp @@ -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 { @@ -47,5 +48,15 @@ void Analog::clear() _snapshots.clear(); } +uint64_t Analog::get_max_sample_count() const +{ + uint64_t l = 0; + for (const boost::shared_ptr s : _snapshots) { + assert(s); + l = max(l, s->get_sample_count()); + } + return l; +} + } // namespace data } // namespace pv