]> sigrok.org Git - pulseview.git/blobdiff - pv/data/logic.hpp
Use the "default" keyword.
[pulseview.git] / pv / data / logic.hpp
index 9adc9750bc8aa874849067c5eece2a6e939e4a8c..e7f7a055da3db150f12f8365edf16af3b7aec59c 100644 (file)
  * 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/>.
  */
 
-#ifndef PULSEVIEW_PV_DATA_LOGIC_H
-#define PULSEVIEW_PV_DATA_LOGIC_H
+#ifndef PULSEVIEW_PV_DATA_LOGIC_HPP
+#define PULSEVIEW_PV_DATA_LOGIC_HPP
 
 #include "signaldata.hpp"
 
 #include <deque>
 
+#include <QObject>
+
 namespace pv {
 namespace data {
 
 class LogicSegment;
 
-class Logic : public SignalData
+class Logic : public QObject, public SignalData
 {
+       Q_OBJECT
+
 public:
        Logic(unsigned int num_channels);
 
-       int get_num_channels() const;
+       unsigned int num_channels() const;
 
        void push_segment(
                std::shared_ptr<LogicSegment> &segment);
@@ -47,7 +50,16 @@ public:
 
        void clear();
 
-       uint64_t get_max_sample_count() const;
+       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_;
@@ -57,4 +69,4 @@ private:
 } // namespace data
 } // namespace pv
 
-#endif // PULSEVIEW_PV_DATA_LOGIC_H
+#endif // PULSEVIEW_PV_DATA_LOGIC_HPP