X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Flogic.cpp;h=9bcfd0a382ac39c020d396007d07a4e1885fbef8;hp=4d2254428dee22f44a9ca1bd1efd5a8d25103458;hb=d9aecf1fcd9af471db3b59de7efc65b9632a6d79;hpb=be73bdfa788fcc62bda3187cb1ba04fed2b9d721 diff --git a/pv/data/logic.cpp b/pv/data/logic.cpp index 4d22544..9bcfd0a 100644 --- a/pv/data/logic.cpp +++ b/pv/data/logic.cpp @@ -21,14 +21,15 @@ #include "logic.h" #include "logicsnapshot.h" -using namespace boost; -using namespace std; +using boost::shared_ptr; +using std::deque; +using std::max; namespace pv { namespace data { -Logic::Logic(unsigned int num_probes, uint64_t samplerate) : - SignalData(samplerate), +Logic::Logic(unsigned int num_probes) : + SignalData(), _num_probes(num_probes) { assert(_num_probes > 0); @@ -50,5 +51,20 @@ deque< shared_ptr >& Logic::get_snapshots() return _snapshots; } +void Logic::clear() +{ + _snapshots.clear(); +} + +uint64_t Logic::get_max_sample_count() const +{ + uint64_t l = 0; + for (boost::shared_ptr s : _snapshots) { + assert(s); + l = max(l, s->get_sample_count()); + } + return l; +} + } // namespace data } // namespace pv