X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Flogic.hpp;h=c80f0151f8957122d8a87687a75c535b083d196f;hp=9adc9750bc8aa874849067c5eece2a6e939e4a8c;hb=6f925ba9d6faf1077b73c5a5808259576081716a;hpb=f3d66e52ed6b454ea7a0662d5e6367e230116a2b diff --git a/pv/data/logic.hpp b/pv/data/logic.hpp index 9adc975..c80f015 100644 --- a/pv/data/logic.hpp +++ b/pv/data/logic.hpp @@ -14,47 +14,61 @@ * 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 . */ -#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 +#include + +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); - int get_num_channels() const; + unsigned int num_channels() const; - void push_segment( - std::shared_ptr &segment); + void push_segment(shared_ptr &segment); - const std::deque< std::shared_ptr >& - logic_segments() const; + const deque< shared_ptr >& logic_segments() const; - std::vector< std::shared_ptr > segments() const; + vector< shared_ptr > segments() const; 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_; - std::deque< std::shared_ptr > segments_; + deque< shared_ptr > segments_; }; } // namespace data } // namespace pv -#endif // PULSEVIEW_PV_DATA_LOGIC_H +#endif // PULSEVIEW_PV_DATA_LOGIC_HPP