init_decoder();
}
+Decoder::~Decoder()
+{
+ _decode_thread.interrupt();
+ _decode_thread.join();
+}
+
const srd_decoder* Decoder::get_decoder() const
{
return _decoder;
}
+void Decoder::begin_decode()
+{
+ _decode_thread.interrupt();
+ _decode_thread.join();
+
+ _decode_thread = boost::thread(&Decoder::decode_proc, this,
+ shared_ptr<data::Logic>());
+}
+
+void Decoder::clear_snapshots()
+{
+}
+
void Decoder::init_decoder()
{
_decoder_inst = srd_inst_new(_decoder->id, NULL);
srd_inst_probe_set_all(_decoder_inst, probes);
}
-void Decoder::clear_snapshots()
+void Decoder::decode_proc(shared_ptr<data::Logic> data)
{
+ (void)data;
}
} // namespace data
#include <map>
#include <boost/shared_ptr.hpp>
+#include <boost/thread.hpp>
struct srd_decoder;
struct srd_decoder_inst;
namespace data {
+class Logic;
+
class Decoder : public SignalData
{
public:
std::map<const srd_probe*,
boost::shared_ptr<pv::view::Signal> > probes);
+ virtual ~Decoder();
+
const srd_decoder* get_decoder() const;
+ void begin_decode();
+
void clear_snapshots();
private:
void init_decoder();
+ void decode_proc(boost::shared_ptr<data::Logic> data);
+
private:
const srd_decoder *const _decoder;
std::map<const srd_probe*, boost::shared_ptr<view::Signal> >
_probes;
srd_decoder_inst *_decoder_inst;
+
+ boost::thread _decode_thread;
};
} // namespace data