X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsession.hpp;h=f5c87f694f8e22a574307e7ae3568968423df9e8;hp=ba07fdcf648ddacd86ec660086eb457482c394a7;hb=8e99ef9634a6c91d38e85c3fa7587a4ae22fcd2b;hpb=f3d66e52ed6b454ea7a0662d5e6367e230116a2b diff --git a/pv/session.hpp b/pv/session.hpp index ba07fdcf..f5c87f69 100644 --- a/pv/session.hpp +++ b/pv/session.hpp @@ -18,8 +18,8 @@ * 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 #include @@ -27,8 +27,14 @@ #include #include #include +#include #include +#ifdef _WIN32 +// Windows: Avoid namespace pollution by thread.hpp (which includes windows.h). +#define NOGDI +#define NORESOURCE +#endif #include #include @@ -38,13 +44,13 @@ struct srd_decoder; 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 { @@ -94,7 +100,11 @@ public: */ void set_device(std::shared_ptr 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(); @@ -108,7 +118,8 @@ public: boost::shared_mutex& signals_mutex() const; - const std::vector< std::shared_ptr >& signals() const; + const std::unordered_set< std::shared_ptr >& + signals() const; #ifdef ENABLE_DECODE bool add_decoder(srd_decoder *const dec); @@ -162,7 +173,7 @@ private: capture_state capture_state_; mutable boost::shared_mutex signals_mutex_; - std::vector< std::shared_ptr > signals_; + std::unordered_set< std::shared_ptr > signals_; mutable std::mutex data_mutex_; std::shared_ptr logic_data_; @@ -188,4 +199,4 @@ Q_SIGNALS: } // namespace pv -#endif // PULSEVIEW_PV_SIGSESSION_H +#endif // PULSEVIEW_PV_SESSION_HPP