Don't use std:: in the code directly (where possible).
[pulseview.git] / pv / data / logic.hpp
index 6e5749a31ee86daac20bf38f2b963a66ed69ebb3..c80f0151f8957122d8a87687a75c535b083d196f 100644 (file)
 
 #include <deque>
 
+#include <QObject>
+
+using std::deque;
+using std::shared_ptr;
+using std::vector;
+
 namespace pv {
 namespace data {
 
 class LogicSegment;
 
-class Logic : public SignalData
+class Logic : public QObject, public SignalData
 {
+       Q_OBJECT
+
 public:
        Logic(unsigned int num_channels);
 
        unsigned int num_channels() const;
 
-       void push_segment(
-               std::shared_ptr<LogicSegment> &segment);
+       void push_segment(shared_ptr<LogicSegment> &segment);
 
-       const std::deque< std::shared_ptr<LogicSegment> >&
-               logic_segments() const;
+       const deque< shared_ptr<LogicSegment> >& logic_segments() const;
 
-       std::vector< std::shared_ptr<Segment> > segments() const;
+       vector< shared_ptr<Segment> > segments() const;
 
        void clear();
 
        uint64_t max_sample_count() const;
 
+       void notify_samples_added(QObject* segment, uint64_t start_sample,
+               uint64_t end_sample);
+
+Q_SIGNALS:
+       void samples_cleared();
+
+       void samples_added(QObject* segment, uint64_t start_sample,
+               uint64_t end_sample);
+
 private:
        const unsigned int num_channels_;
-       std::deque< std::shared_ptr<LogicSegment> > segments_;
+       deque< shared_ptr<LogicSegment> > segments_;
 };
 
 } // namespace data