X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fdecoder.h;h=b8608d2cc4290ed712722ba1e677e6383e96fb03;hp=8a0f00a42a5a731bb83b48d3a2c0bd6a3ce05e13;hb=fe89c96185dba8ccf02b6b3d0994c2e149198c73;hpb=67fe5e9c02e4e9cfe94d465a0a5e5b598129e4e3 diff --git a/pv/data/decoder.h b/pv/data/decoder.h index 8a0f00a4..b8608d2c 100644 --- a/pv/data/decoder.h +++ b/pv/data/decoder.h @@ -29,15 +29,22 @@ #include #include +#include + +#include struct srd_decoder; -struct srd_decoder_inst; struct srd_probe; +struct srd_proto_data; + +namespace DecoderTest { +class TwoDecoder; +} namespace pv { namespace view { -class Signal; +class LogicSignal; namespace decode { class Annotation; @@ -61,7 +68,7 @@ private: public: Decoder(const srd_decoder *const decoder, std::map > probes, + boost::shared_ptr > probes, GHashTable *options); virtual ~Decoder(); @@ -71,6 +78,8 @@ public: const std::vector< boost::shared_ptr > annotations() const; + QString error_message(); + void clear_snapshots(); private: @@ -83,19 +92,32 @@ private: static void annotation_callback(srd_proto_data *pdata, void *decoder); +signals: + void new_decode_data(); + private: + + /** + * This mutex prevents more than one decode operation occuring + * concurrently. + * @todo A proper solution should be implemented to allow multiple + * decode operations. + */ + static boost::mutex _global_decode_mutex; + const srd_decoder *const _decoder; - std::map > + std::map > _probes; GHashTable *_options; - srd_decoder_inst *_decoder_inst; - - mutable boost::mutex _annotations_mutex; + mutable boost::mutex _mutex; std::vector< boost::shared_ptr > _annotations; + QString _error_message; boost::thread _decode_thread; + + friend class DecoderTest::TwoDecoder; }; } // namespace data