projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Renamed C++ headers to .hpp
[pulseview.git]
/
pv
/
data
/
analog.cpp
diff --git
a/pv/data/analog.cpp
b/pv/data/analog.cpp
index fadd5c696331ce95a0c79ee057b1d81b40d6434c..30cf5013033dd0f9cc8b002031769b109495c4b5 100644
(file)
--- a/
pv/data/analog.cpp
+++ b/
pv/data/analog.cpp
@@
-18,11
+18,14
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "analog.h"
-#include "analogsnapshot.h"
+#include <cassert>
-using namespace boost;
-using namespace std;
+#include "analog.hpp"
+#include "analogsnapshot.hpp"
+
+using std::deque;
+using std::max;
+using std::shared_ptr;
namespace pv {
namespace data {
namespace pv {
namespace data {
@@
-34,17
+37,27
@@
Analog::Analog() :
void Analog::push_snapshot(shared_ptr<AnalogSnapshot> &snapshot)
{
void Analog::push_snapshot(shared_ptr<AnalogSnapshot> &snapshot)
{
-
_snapshots
.push_front(snapshot);
+
snapshots_
.push_front(snapshot);
}
deque< shared_ptr<AnalogSnapshot> >& Analog::get_snapshots()
{
}
deque< shared_ptr<AnalogSnapshot> >& Analog::get_snapshots()
{
- return _snapshots;
+ return snapshots_;
+}
+
+void Analog::clear()
+{
+ snapshots_.clear();
}
}
-void Analog::clear_snapshots()
+uint64_t Analog::get_max_sample_count() const
{
{
- _snapshots.clear();
+ uint64_t l = 0;
+ for (const std::shared_ptr<AnalogSnapshot> s : snapshots_) {
+ assert(s);
+ l = max(l, s->get_sample_count());
+ }
+ return l;
}
} // namespace data
}
} // namespace data