projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Unify get_samples() semantics for AnalogSegment and LogicSegment
[pulseview.git]
/
pv
/
data
/
analog.cpp
diff --git
a/pv/data/analog.cpp
b/pv/data/analog.cpp
index eb25629fe68fa0f5f94d165ca6f5d7a0a66e222e..217cdfd742b3e4c84557f87178aee195ba82d5f4 100644
(file)
--- a/
pv/data/analog.cpp
+++ b/
pv/data/analog.cpp
@@
-14,18
+14,18
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <cassert>
*/
#include <cassert>
-#include "analog.h"
-#include "analogs
napshot.h
"
+#include "analog.h
pp
"
+#include "analogs
egment.hpp
"
using std::deque;
using std::max;
using std::shared_ptr;
using std::deque;
using std::max;
using std::shared_ptr;
+using std::vector;
namespace pv {
namespace data {
namespace pv {
namespace data {
@@
-35,25
+35,31
@@
Analog::Analog() :
{
}
{
}
-void Analog::push_s
napshot(shared_ptr<AnalogSnapshot> &snapsho
t)
+void Analog::push_s
egment(shared_ptr<AnalogSegment> &segmen
t)
{
{
- s
napshots_.push_front(snapsho
t);
+ s
egments_.push_front(segmen
t);
}
}
-deque< shared_ptr<AnalogSnapshot> >& Analog::get_snapshots()
+const deque< shared_ptr<AnalogSegment> >& Analog::analog_segments() const
{
{
- return snapshots_;
+ return segments_;
+}
+
+vector< shared_ptr<Segment> > Analog::segments() const
+{
+ return vector< shared_ptr<Segment> >(
+ segments_.begin(), segments_.end());
}
void Analog::clear()
{
}
void Analog::clear()
{
- s
napsho
ts_.clear();
+ s
egmen
ts_.clear();
}
}
-uint64_t Analog::
get_
max_sample_count() const
+uint64_t Analog::max_sample_count() const
{
uint64_t l = 0;
{
uint64_t l = 0;
- for (const std::shared_ptr<AnalogS
napshot> s : snapsho
ts_) {
+ for (const std::shared_ptr<AnalogS
egment> s : segmen
ts_) {
assert(s);
l = max(l, s->get_sample_count());
}
assert(s);
l = max(l, s->get_sample_count());
}