projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replaced boost::shared_ptr with std::shared_ptr
[pulseview.git]
/
pv
/
data
/
logic.cpp
diff --git
a/pv/data/logic.cpp
b/pv/data/logic.cpp
index 7b42e47497054c3fc6d359bf3ac860bb577fc09f..2737bcb58238870b63066231778ca674c6231e25 100644
(file)
--- a/
pv/data/logic.cpp
+++ b/
pv/data/logic.cpp
@@
-21,17
+21,18
@@
#include "logic.h"
#include "logicsnapshot.h"
#include "logic.h"
#include "logicsnapshot.h"
-using namespace boost;
-using namespace std;
+using std::deque;
+using std::max;
+using std::shared_ptr;
namespace pv {
namespace data {
namespace pv {
namespace data {
-Logic::Logic(const sr_datafeed_meta_logic &meta,
- uint64_t samplerate) :
- SignalData(samplerate),
- _num_probes(meta.num_probes)
+Logic::Logic(unsigned int num_probes) :
+ SignalData(),
+ _num_probes(num_probes)
{
{
+ assert(_num_probes > 0);
}
int Logic::get_num_probes() const
}
int Logic::get_num_probes() const
@@
-50,5
+51,20
@@
deque< shared_ptr<LogicSnapshot> >& Logic::get_snapshots()
return _snapshots;
}
return _snapshots;
}
+void Logic::clear()
+{
+ _snapshots.clear();
+}
+
+uint64_t Logic::get_max_sample_count() const
+{
+ uint64_t l = 0;
+ for (std::shared_ptr<LogicSnapshot> s : _snapshots) {
+ assert(s);
+ l = max(l, s->get_sample_count());
+ }
+ return l;
+}
+
} // namespace data
} // namespace pv
} // namespace data
} // namespace pv