projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make member variable underscores a suffix instead of a prefix
[pulseview.git]
/
pv
/
data
/
decoderstack.h
diff --git
a/pv/data/decoderstack.h
b/pv/data/decoderstack.h
index 308dce6edde0ad8b480bf65beba7cc6b6ca7cac9..c50f3859962d020847ce9166727c1066feaa0bff 100644
(file)
--- a/
pv/data/decoderstack.h
+++ b/
pv/data/decoderstack.h
@@
-23,10
+23,14
@@
#include "signaldata.h"
#include "signaldata.h"
+#include <atomic>
+#include <condition_variable>
#include <list>
#include <list>
+#include <map>
+#include <memory>
+#include <thread>
-#include <boost/shared_ptr.hpp>
-#include <boost/thread.hpp>
+#include <boost/optional.hpp>
#include <QObject>
#include <QString>
#include <QObject>
#include <QString>
@@
-36,12
+40,12
@@
struct srd_decoder;
struct srd_decoder_annotation_row;
struct srd_decoder;
struct srd_decoder_annotation_row;
-struct srd_
probe
;
+struct srd_
channel
;
struct srd_proto_data;
struct srd_session;
namespace DecoderStackTest {
struct srd_proto_data;
struct srd_session;
namespace DecoderStackTest {
-
class
TwoDecoderStack;
+
struct
TwoDecoderStack;
}
namespace pv {
}
namespace pv {
@@
-71,15
+75,16
@@
private:
static const double DecodeMargin;
static const double DecodeThreshold;
static const int64_t DecodeChunkLength;
static const double DecodeMargin;
static const double DecodeThreshold;
static const int64_t DecodeChunkLength;
+ static const unsigned int DecodeNotifyPeriod;
public:
public:
- DecoderStack(pv::SigSession &
_session
,
+ DecoderStack(pv::SigSession &
session_
,
const srd_decoder *const decoder);
virtual ~DecoderStack();
const srd_decoder *const decoder);
virtual ~DecoderStack();
- const std::list<
boost
::shared_ptr<decode::Decoder> >& stack() const;
- void push(
boost
::shared_ptr<decode::Decoder> decoder);
+ const std::list<
std
::shared_ptr<decode::Decoder> >& stack() const;
+ void push(
std
::shared_ptr<decode::Decoder> decoder);
void remove(int index);
int64_t samples_decoded() const;
void remove(int index);
int64_t samples_decoded() const;
@@
-103,23
+108,28
@@
public:
void begin_decode();
private:
void begin_decode();
private:
- void decode_data(
- const boost::shared_ptr<pv::data::LogicSnapshot> &snapshot,
- srd_session *const session);
+ boost::optional<int64_t> wait_for_data() const;
- void decode_proc(boost::shared_ptr<data::Logic> data);
+ void decode_data(const int64_t sample_count,
+ const unsigned int unit_size, srd_session *const session);
+
+ void decode_proc();
static void annotation_callback(srd_proto_data *pdata,
void *decoder);
static void annotation_callback(srd_proto_data *pdata,
void *decoder);
-private
slots
:
+private
Q_SLOTS
:
void on_new_frame();
void on_new_frame();
-signals:
+ void on_data_received();
+
+ void on_frame_ended();
+
+Q_SIGNALS:
void new_decode_data();
private:
void new_decode_data();
private:
- pv::SigSession &
_session
;
+ pv::SigSession &
session_
;
/**
* This mutex prevents more than one decode operation occuring
/**
* This mutex prevents more than one decode operation occuring
@@
-127,22
+137,30
@@
private:
* @todo A proper solution should be implemented to allow multiple
* decode operations.
*/
* @todo A proper solution should be implemented to allow multiple
* decode operations.
*/
- static boost::mutex _global_decode_mutex;
+ static std::mutex global_decode_mutex_;
+
+ std::list< std::shared_ptr<decode::Decoder> > stack_;
+
+ std::shared_ptr<pv::data::LogicSnapshot> snapshot_;
- std::list< boost::shared_ptr<decode::Decoder> > _stack;
+ mutable std::mutex input_mutex_;
+ mutable std::condition_variable input_cond_;
+ int64_t sample_count_;
+ bool frame_complete_;
- mutable
boost::mutex _output_mutex
;
- int64_t
_samples_decoded
;
+ mutable
std::mutex output_mutex_
;
+ int64_t
samples_decoded_
;
- std::map<const decode::Row, decode::RowData>
_rows
;
+ std::map<const decode::Row, decode::RowData>
rows_
;
- std::map<std::pair<const srd_decoder*, int>, decode::Row>
_class_rows
;
+ std::map<std::pair<const srd_decoder*, int>, decode::Row>
class_rows_
;
- QString
_error_message
;
+ QString
error_message_
;
- boost::thread _decode_thread;
+ std::thread decode_thread_;
+ std::atomic<bool> interrupt_;
- friend
class
DecoderStackTest::TwoDecoderStack;
+ friend
struct
DecoderStackTest::TwoDecoderStack;
};
} // namespace data
};
} // namespace data