* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_SIGSESSION_H
-#define PULSEVIEW_PV_SIGSESSION_H
+#ifndef PULSEVIEW_PV_SESSION_HPP
+#define PULSEVIEW_PV_SESSION_HPP
#include <map>
#include <memory>
#include <set>
#include <string>
#include <thread>
+#include <unordered_set>
#include <vector>
+#ifdef _WIN32
+// Windows: Avoid namespace pollution by thread.hpp (which includes windows.h).
+#define NOGDI
+#define NORESOURCE
+#endif
#include <boost/thread.hpp>
#include <QObject>
struct srd_channel;
namespace sigrok {
- class Analog;
- class Channel;
- class Device;
- class Logic;
- class Meta;
- class Packet;
- class Session;
+class Analog;
+class Channel;
+class Device;
+class Logic;
+class Meta;
+class Packet;
+class Session;
}
namespace pv {
*/
void set_device(std::shared_ptr<sigrok::Device> device);
- void set_file(const std::string &name);
+ /**
+ * Sets a sigrok session file as the capture device.
+ * @param name the path to the file.
+ */
+ void set_session_file(const std::string &name);
void set_default_device();
boost::shared_mutex& signals_mutex() const;
- const std::vector< std::shared_ptr<view::Signal> >& signals() const;
+ const std::unordered_set< std::shared_ptr<view::Signal> >&
+ signals() const;
#ifdef ENABLE_DECODE
bool add_decoder(srd_decoder *const dec);
capture_state capture_state_;
mutable boost::shared_mutex signals_mutex_;
- std::vector< std::shared_ptr<view::Signal> > signals_;
+ std::unordered_set< std::shared_ptr<view::Signal> > signals_;
mutable std::mutex data_mutex_;
std::shared_ptr<data::Logic> logic_data_;
} // namespace pv
-#endif // PULSEVIEW_PV_SIGSESSION_H
+#endif // PULSEVIEW_PV_SESSION_HPP