SignalBase: Make sure PDs are restarted when conv options change
[pulseview.git] / pv / data / logic.cpp
index cd80ac99de13ca54384e9a7013239d68076f7823..084e8efd7f231fd920a0da8dfad18cfd9e4ac66e 100644 (file)
@@ -42,8 +42,7 @@ unsigned int Logic::num_channels() const
        return num_channels_;
 }
 
-void Logic::push_segment(
-       shared_ptr<LogicSegment> &segment)
+void Logic::push_segment(shared_ptr<LogicSegment> &segment)
 {
        segments_.push_front(segment);
 }
@@ -55,8 +54,12 @@ const deque< shared_ptr<LogicSegment> >& Logic::logic_segments() const
 
 vector< shared_ptr<Segment> > Logic::segments() const
 {
-       return vector< shared_ptr<Segment> >(
-               segments_.begin(), segments_.end());
+       return vector< shared_ptr<Segment> >(segments_.begin(), segments_.end());
+}
+
+int Logic::get_segment_count() const
+{
+       return segments_.size();
 }
 
 void Logic::clear()
@@ -69,7 +72,7 @@ void Logic::clear()
 uint64_t Logic::max_sample_count() const
 {
        uint64_t l = 0;
-       for (std::shared_ptr<LogicSegment> s : segments_) {
+       for (shared_ptr<LogicSegment> s : segments_) {
                assert(s);
                l = max(l, s->get_sample_count());
        }