* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef SIGSESSION_H
-#define SIGSESSION_H
+#ifndef PULSEVIEW_PV_SIGSESSION_H
+#define PULSEVIEW_PV_SIGSESSION_H
#include <boost/shared_ptr.hpp>
+#include <boost/thread.hpp>
#include <string>
+#include <utility>
#include <vector>
#include <QObject>
class LogicData;
class LogicDataSnapshot;
+
+namespace view {
class Signal;
+}
class SigSession : public QObject
{
void start_capture(struct sr_dev_inst* sdi, uint64_t record_length,
uint64_t sample_rate);
- std::vector< boost::shared_ptr<Signal> >&
+ std::vector< boost::shared_ptr<view::Signal> >
get_signals();
boost::shared_ptr<LogicData> get_data();
private:
+ void sample_thread_proc(struct sr_dev_inst *sdi,
+ uint64_t record_length, uint64_t sample_rate);
+
void data_feed_in(const struct sr_dev_inst *sdi,
struct sr_datafeed_packet *packet);
struct sr_datafeed_packet *packet);
private:
- std::vector< boost::shared_ptr<Signal> > _signals;
+ mutable boost::mutex _signals_mutex;
+ std::vector< boost::shared_ptr<view::Signal> > _signals;
+
+ mutable boost::mutex _data_mutex;
boost::shared_ptr<LogicData> _logic_data;
boost::shared_ptr<LogicDataSnapshot> _cur_logic_snapshot;
+ std::auto_ptr<boost::thread> _sampling_thread;
+
signals:
+ void signals_changed();
+
void data_updated();
private:
} // namespace pv
-#endif // SIGSESSION_H
+#endif // PULSEVIEW_PV_SIGSESSION_H