From: Joel Holdsworth Date: Tue, 20 May 2014 21:58:55 +0000 (+0100) Subject: Replaced boost::shared_ptr with std::shared_ptr X-Git-Tag: pulseview-0.3.0~612 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f9abf97e78bc4825d80926b0ebc6cbaef40768b1;p=pulseview.git Replaced boost::shared_ptr with std::shared_ptr --- diff --git a/pv/data/analog.cpp b/pv/data/analog.cpp index c7430432..53fa9a5a 100644 --- a/pv/data/analog.cpp +++ b/pv/data/analog.cpp @@ -21,9 +21,9 @@ #include "analog.h" #include "analogsnapshot.h" -using boost::shared_ptr; using std::deque; using std::max; +using std::shared_ptr; namespace pv { namespace data { @@ -51,7 +51,7 @@ void Analog::clear() uint64_t Analog::get_max_sample_count() const { uint64_t l = 0; - for (const boost::shared_ptr s : _snapshots) { + for (const std::shared_ptr s : _snapshots) { assert(s); l = max(l, s->get_sample_count()); } diff --git a/pv/data/analog.h b/pv/data/analog.h index 42e31677..7e36edd6 100644 --- a/pv/data/analog.h +++ b/pv/data/analog.h @@ -23,8 +23,8 @@ #include "signaldata.h" -#include #include +#include namespace pv { namespace data { @@ -37,9 +37,9 @@ public: Analog(); void push_snapshot( - boost::shared_ptr &snapshot); + std::shared_ptr &snapshot); - std::deque< boost::shared_ptr >& + std::deque< std::shared_ptr >& get_snapshots(); void clear(); @@ -47,7 +47,7 @@ public: uint64_t get_max_sample_count() const; private: - std::deque< boost::shared_ptr > _snapshots; + std::deque< std::shared_ptr > _snapshots; }; } // namespace data diff --git a/pv/data/decode/decoder.cpp b/pv/data/decode/decoder.cpp index 13c40a35..db9816c4 100644 --- a/pv/data/decode/decoder.cpp +++ b/pv/data/decode/decoder.cpp @@ -25,9 +25,9 @@ #include -using boost::shared_ptr; using std::set; using std::map; +using std::shared_ptr; using std::string; namespace pv { @@ -68,7 +68,7 @@ Decoder::channels() const } void Decoder::set_probes(std::map > probes) + std::shared_ptr > probes) { _probes = probes; } diff --git a/pv/data/decode/decoder.h b/pv/data/decode/decoder.h index dffefab2..3920aa4c 100644 --- a/pv/data/decode/decoder.h +++ b/pv/data/decode/decoder.h @@ -22,10 +22,9 @@ #define PULSEVIEW_PV_DATA_DECODE_DECODER_H #include +#include #include -#include - #include struct srd_decoder; @@ -58,9 +57,9 @@ public: void show(bool show = true); const std::map >& channels() const; + std::shared_ptr >& channels() const; void set_probes(std::map > probes); + std::shared_ptr > probes); const std::map& options() const; @@ -71,14 +70,14 @@ public: srd_decoder_inst* create_decoder_inst( srd_session *session, int unit_size) const; - std::set< boost::shared_ptr > get_data(); + std::set< std::shared_ptr > get_data(); private: const srd_decoder *const _decoder; bool _shown; - std::map > + std::map > _probes; std::map _options; }; diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index 1cb7d4ff..40683758 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -38,7 +38,6 @@ using boost::lock_guard; using boost::mutex; using boost::optional; -using boost::shared_ptr; using boost::unique_lock; using std::deque; using std::make_pair; @@ -47,6 +46,7 @@ using std::min; using std::list; using std::map; using std::pair; +using std::shared_ptr; using std::vector; using namespace pv::data::decode; @@ -87,13 +87,13 @@ DecoderStack::~DecoderStack() } } -const std::list< boost::shared_ptr >& +const std::list< std::shared_ptr >& DecoderStack::stack() const { return _stack; } -void DecoderStack::push(boost::shared_ptr decoder) +void DecoderStack::push(std::shared_ptr decoder) { assert(decoder); _stack.push_back(decoder); diff --git a/pv/data/decoderstack.h b/pv/data/decoderstack.h index 2eeaf1c7..1badc6b9 100644 --- a/pv/data/decoderstack.h +++ b/pv/data/decoderstack.h @@ -24,9 +24,9 @@ #include "signaldata.h" #include +#include #include -#include #include #include @@ -80,8 +80,8 @@ public: virtual ~DecoderStack(); - const std::list< boost::shared_ptr >& stack() const; - void push(boost::shared_ptr decoder); + const std::list< std::shared_ptr >& stack() const; + void push(std::shared_ptr decoder); void remove(int index); int64_t samples_decoded() const; @@ -136,9 +136,9 @@ private: */ static boost::mutex _global_decode_mutex; - std::list< boost::shared_ptr > _stack; + std::list< std::shared_ptr > _stack; - boost::shared_ptr _snapshot; + std::shared_ptr _snapshot; mutable boost::mutex _input_mutex; mutable boost::condition_variable _input_cond; diff --git a/pv/data/logic.cpp b/pv/data/logic.cpp index 9bcfd0a3..2737bcb5 100644 --- a/pv/data/logic.cpp +++ b/pv/data/logic.cpp @@ -21,9 +21,9 @@ #include "logic.h" #include "logicsnapshot.h" -using boost::shared_ptr; using std::deque; using std::max; +using std::shared_ptr; namespace pv { namespace data { @@ -59,7 +59,7 @@ void Logic::clear() uint64_t Logic::get_max_sample_count() const { uint64_t l = 0; - for (boost::shared_ptr s : _snapshots) { + for (std::shared_ptr s : _snapshots) { assert(s); l = max(l, s->get_sample_count()); } diff --git a/pv/data/logic.h b/pv/data/logic.h index 3d833942..607e0bd4 100644 --- a/pv/data/logic.h +++ b/pv/data/logic.h @@ -23,8 +23,8 @@ #include "signaldata.h" -#include #include +#include namespace pv { namespace data { @@ -39,9 +39,9 @@ public: int get_num_probes() const; void push_snapshot( - boost::shared_ptr &snapshot); + std::shared_ptr &snapshot); - std::deque< boost::shared_ptr >& + std::deque< std::shared_ptr >& get_snapshots(); void clear(); @@ -50,7 +50,7 @@ public: private: const unsigned int _num_probes; - std::deque< boost::shared_ptr > _snapshots; + std::deque< std::shared_ptr > _snapshots; }; } // namespace data diff --git a/pv/device/device.cpp b/pv/device/device.cpp index 4f9a7799..4a30e5fc 100644 --- a/pv/device/device.cpp +++ b/pv/device/device.cpp @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include diff --git a/pv/device/devinst.h b/pv/device/devinst.h index e6a51409..7f467cf4 100644 --- a/pv/device/devinst.h +++ b/pv/device/devinst.h @@ -21,10 +21,9 @@ #ifndef PULSEVIEW_PV_DEVICE_DEVINST_H #define PULSEVIEW_PV_DEVICE_DEVINST_H +#include #include -#include - #include #include diff --git a/pv/device/sessionfile.cpp b/pv/device/sessionfile.cpp index ffdeb670..80345799 100644 --- a/pv/device/sessionfile.cpp +++ b/pv/device/sessionfile.cpp @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "sessionfile.h" #include diff --git a/pv/devicemanager.cpp b/pv/devicemanager.cpp index 6b07b991..bbcfbf24 100644 --- a/pv/devicemanager.cpp +++ b/pv/devicemanager.cpp @@ -28,11 +28,11 @@ #include -using boost::shared_ptr; using std::list; using std::map; using std::ostringstream; using std::runtime_error; +using std::shared_ptr; using std::string; namespace pv { diff --git a/pv/devicemanager.h b/pv/devicemanager.h index acef8a42..ca86a7fe 100644 --- a/pv/devicemanager.h +++ b/pv/devicemanager.h @@ -24,10 +24,9 @@ #include #include +#include #include -#include - struct sr_context; struct sr_dev_driver; @@ -46,10 +45,10 @@ public: ~DeviceManager(); - const std::list< boost::shared_ptr >& + const std::list< std::shared_ptr >& devices() const; - std::list< boost::shared_ptr > driver_scan( + std::list< std::shared_ptr > driver_scan( struct sr_dev_driver *const driver, GSList *const drvopts = NULL); @@ -62,12 +61,12 @@ private: void release_driver(struct sr_dev_driver *const driver); - static bool compare_devices(boost::shared_ptr a, - boost::shared_ptr b); + static bool compare_devices(std::shared_ptr a, + std::shared_ptr b); private: struct sr_context *const _sr_ctx; - std::list< boost::shared_ptr > _devices; + std::list< std::shared_ptr > _devices; }; } // namespace pv diff --git a/pv/dialogs/connect.cpp b/pv/dialogs/connect.cpp index c5535d87..d554b4c1 100644 --- a/pv/dialogs/connect.cpp +++ b/pv/dialogs/connect.cpp @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include #include "connect.h" @@ -32,8 +34,8 @@ extern "C" { #include } -using boost::shared_ptr; using std::list; +using std::shared_ptr; using std::string; extern sr_context *sr_ctx; diff --git a/pv/dialogs/connect.h b/pv/dialogs/connect.h index 1de0ed8d..a3f05ee1 100644 --- a/pv/dialogs/connect.h +++ b/pv/dialogs/connect.h @@ -21,7 +21,7 @@ #ifndef PULSEVIEW_PV_CONNECT_H #define PULSEVIEW_PV_CONNECT_H -#include +#include #include #include @@ -52,7 +52,7 @@ class Connect : public QDialog public: Connect(QWidget *parent, pv::DeviceManager &device_manager); - boost::shared_ptr get_selected_device() const; + std::shared_ptr get_selected_device() const; private: void populate_drivers(); @@ -83,7 +83,7 @@ private: QPushButton _scan_button; QListWidget _device_list; - std::map > + std::map > _device_map; QDialogButtonBox _button_box; diff --git a/pv/dialogs/storeprogress.h b/pv/dialogs/storeprogress.h index 61d08d51..7d53832a 100644 --- a/pv/dialogs/storeprogress.h +++ b/pv/dialogs/storeprogress.h @@ -21,10 +21,9 @@ #ifndef PULSEVIEW_PV_DIALOGS_SAVEPROGRESS_H #define PULSEVIEW_PV_DIALOGS_SAVEPROGRESS_H +#include #include -#include - #include #include diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 26890603..42f79bbc 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -60,8 +60,8 @@ #include #include -using boost::shared_ptr; using std::list; +using std::shared_ptr; namespace pv { diff --git a/pv/mainwindow.h b/pv/mainwindow.h index 1f9dd528..22df24cf 100644 --- a/pv/mainwindow.h +++ b/pv/mainwindow.h @@ -22,8 +22,7 @@ #define PULSEVIEW_PV_MAINWINDOW_H #include - -#include +#include #include diff --git a/pv/popups/deviceoptions.cpp b/pv/popups/deviceoptions.cpp index 353dfcfe..eaa036c2 100644 --- a/pv/popups/deviceoptions.cpp +++ b/pv/popups/deviceoptions.cpp @@ -25,7 +25,7 @@ #include -using boost::shared_ptr; +using std::shared_ptr; namespace pv { namespace popups { diff --git a/pv/popups/deviceoptions.h b/pv/popups/deviceoptions.h index 945959b2..deedf587 100644 --- a/pv/popups/deviceoptions.h +++ b/pv/popups/deviceoptions.h @@ -35,13 +35,13 @@ class DeviceOptions : public pv::widgets::Popup Q_OBJECT public: - DeviceOptions(boost::shared_ptr dev_inst, + DeviceOptions(std::shared_ptr dev_inst, QWidget *parent); pv::prop::binding::DeviceOptions& binding(); private: - boost::shared_ptr _dev_inst; + std::shared_ptr _dev_inst; QVBoxLayout _layout; diff --git a/pv/popups/probes.cpp b/pv/popups/probes.cpp index ada4d9a0..f8fa970e 100644 --- a/pv/popups/probes.cpp +++ b/pv/popups/probes.cpp @@ -34,9 +34,9 @@ using namespace Qt; -using boost::shared_ptr; using std::map; using std::set; +using std::shared_ptr; using std::vector; using pv::view::Signal; diff --git a/pv/popups/probes.h b/pv/popups/probes.h index dbf90cd0..4265c159 100644 --- a/pv/popups/probes.h +++ b/pv/popups/probes.h @@ -22,10 +22,9 @@ #define PULSEVIEW_PV_POPUPS_PROBES_H #include +#include #include -#include - #include #include #include @@ -65,10 +64,10 @@ private: void set_all_probes(bool set); void populate_group(const sr_channel_group *group, - const std::vector< boost::shared_ptr > sigs); + const std::vector< std::shared_ptr > sigs); QGridLayout* create_channel_group_grid( - const std::vector< boost::shared_ptr > sigs); + const std::vector< std::shared_ptr > sigs); private: void showEvent(QShowEvent *e); @@ -86,9 +85,9 @@ private: bool _updating_probes; - std::vector< boost::shared_ptr > + std::vector< std::shared_ptr > _group_bindings; - std::map< QCheckBox*, boost::shared_ptr > + std::map< QCheckBox*, std::shared_ptr > _check_box_signal_map; QHBoxLayout _buttons_bar; diff --git a/pv/prop/binding/binding.cpp b/pv/prop/binding/binding.cpp index 1a5eb5ec..6432d293 100644 --- a/pv/prop/binding/binding.cpp +++ b/pv/prop/binding/binding.cpp @@ -18,19 +18,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include #include #include "binding.h" -using boost::shared_ptr; +using std::shared_ptr; namespace pv { namespace prop { namespace binding { -const std::vector< boost::shared_ptr >& Binding::properties() +const std::vector< std::shared_ptr >& Binding::properties() { return _properties; } diff --git a/pv/prop/binding/binding.h b/pv/prop/binding/binding.h index 89c1acbc..cce8ebf8 100644 --- a/pv/prop/binding/binding.h +++ b/pv/prop/binding/binding.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include @@ -41,7 +41,7 @@ namespace binding { class Binding { public: - const std::vector< boost::shared_ptr >& properties(); + const std::vector< std::shared_ptr >& properties(); void commit(); @@ -54,7 +54,7 @@ public: static QString print_gvariant(GVariant *const gvar); protected: - std::vector< boost::shared_ptr > _properties; + std::vector< std::shared_ptr > _properties; }; } // binding diff --git a/pv/prop/binding/decoderoptions.cpp b/pv/prop/binding/decoderoptions.cpp index 930e1f0a..0e44386e 100644 --- a/pv/prop/binding/decoderoptions.cpp +++ b/pv/prop/binding/decoderoptions.cpp @@ -34,10 +34,10 @@ using boost::bind; using boost::none; -using boost::shared_ptr; using std::make_pair; using std::map; using std::pair; +using std::shared_ptr; using std::string; using std::vector; diff --git a/pv/prop/binding/decoderoptions.h b/pv/prop/binding/decoderoptions.h index 6dec9c2e..a0b8dc4d 100644 --- a/pv/prop/binding/decoderoptions.h +++ b/pv/prop/binding/decoderoptions.h @@ -42,11 +42,11 @@ namespace binding { class DecoderOptions : public Binding { public: - DecoderOptions(boost::shared_ptr decoder_stack, - boost::shared_ptr decoder); + DecoderOptions(std::shared_ptr decoder_stack, + std::shared_ptr decoder); private: - static boost::shared_ptr bind_enum(const QString &name, + static std::shared_ptr bind_enum(const QString &name, const srd_decoder_option *option, Property::Getter getter, Property::Setter setter); @@ -55,8 +55,8 @@ private: void setter(const char *id, GVariant *value); private: - boost::shared_ptr _decoder_stack; - boost::shared_ptr _decoder; + std::shared_ptr _decoder_stack; + std::shared_ptr _decoder; }; } // binding diff --git a/pv/prop/binding/deviceoptions.cpp b/pv/prop/binding/deviceoptions.cpp index 2dc237a8..a1ae6ba7 100644 --- a/pv/prop/binding/deviceoptions.cpp +++ b/pv/prop/binding/deviceoptions.cpp @@ -37,9 +37,9 @@ using boost::bind; using boost::function; using boost::optional; -using boost::shared_ptr; using std::make_pair; using std::pair; +using std::shared_ptr; using std::string; using std::vector; diff --git a/pv/prop/binding/deviceoptions.h b/pv/prop/binding/deviceoptions.h index 445361fd..f0ba92ef 100644 --- a/pv/prop/binding/deviceoptions.h +++ b/pv/prop/binding/deviceoptions.h @@ -45,7 +45,7 @@ namespace binding { class DeviceOptions : public Binding { public: - DeviceOptions(boost::shared_ptr dev_inst, + DeviceOptions(std::shared_ptr dev_inst, const sr_channel_group *group = NULL); private: @@ -61,7 +61,7 @@ private: static QString print_voltage_threshold(GVariant *const gvar); protected: - boost::shared_ptr _dev_inst; + std::shared_ptr _dev_inst; const sr_channel_group *const _group; }; diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 282b7ec5..1d13de2a 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -47,14 +47,14 @@ #include -using boost::dynamic_pointer_cast; using boost::function; using boost::lock_guard; using boost::mutex; -using boost::shared_ptr; +using std::dynamic_pointer_cast; using std::list; using std::map; using std::set; +using std::shared_ptr; using std::string; using std::vector; diff --git a/pv/sigsession.h b/pv/sigsession.h index 1221750b..c7a81bfc 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -22,10 +22,10 @@ #define PULSEVIEW_PV_SIGSESSION_H #include -#include #include #include +#include #include #include #include @@ -76,12 +76,12 @@ public: ~SigSession(); - boost::shared_ptr get_device() const; + std::shared_ptr get_device() const; /** * Sets device instance that will be used in the next capture session. */ - void set_device(boost::shared_ptr dev_inst) + void set_device(std::shared_ptr dev_inst) throw(QString); void set_file(const std::string &name) @@ -97,15 +97,15 @@ public: void stop_capture(); - std::set< boost::shared_ptr > get_data() const; + std::set< std::shared_ptr > get_data() const; - std::vector< boost::shared_ptr > + std::vector< std::shared_ptr > get_signals() const; #ifdef ENABLE_DECODE bool add_decoder(srd_decoder *const dec); - std::vector< boost::shared_ptr > + std::vector< std::shared_ptr > get_decode_signals() const; void remove_decode_signal(view::DecodeTrace *signal); @@ -114,9 +114,9 @@ public: private: void set_capture_state(capture_state state); - void update_signals(boost::shared_ptr dev_inst); + void update_signals(std::shared_ptr dev_inst); - boost::shared_ptr signal_from_probe( + std::shared_ptr signal_from_probe( const sr_channel *probe) const; void read_sample_rate(const sr_dev_inst *const sdi); @@ -137,7 +137,7 @@ private: boost::function error_handler, sr_input_format *format = NULL); - void sample_thread_proc(boost::shared_ptr dev_inst, + void sample_thread_proc(std::shared_ptr dev_inst, boost::function error_handler); void feed_in_header(const sr_dev_inst *sdi); @@ -163,20 +163,20 @@ private: /** * The device instance that will be used in the next capture session. */ - boost::shared_ptr _dev_inst; + std::shared_ptr _dev_inst; - std::vector< boost::shared_ptr > _decode_traces; + std::vector< std::shared_ptr > _decode_traces; mutable boost::mutex _sampling_mutex; capture_state _capture_state; mutable boost::mutex _signals_mutex; - std::vector< boost::shared_ptr > _signals; + std::vector< std::shared_ptr > _signals; mutable boost::mutex _data_mutex; - boost::shared_ptr _logic_data; - boost::shared_ptr _cur_logic_snapshot; - std::map< const sr_channel*, boost::shared_ptr > + std::shared_ptr _logic_data; + std::shared_ptr _cur_logic_snapshot; + std::map< const sr_channel*, std::shared_ptr > _cur_analog_snapshots; boost::thread _sampling_thread; diff --git a/pv/storesession.cpp b/pv/storesession.cpp index 3d0f12fe..f60cd26c 100644 --- a/pv/storesession.cpp +++ b/pv/storesession.cpp @@ -25,16 +25,16 @@ #include #include -using boost::dynamic_pointer_cast; using boost::mutex; -using boost::shared_ptr; using boost::thread; using boost::lock_guard; using std::deque; +using std::dynamic_pointer_cast; using std::make_pair; using std::min; using std::pair; using std::set; +using std::shared_ptr; using std::string; using std::vector; diff --git a/pv/storesession.h b/pv/storesession.h index 5ef92a33..e543df13 100644 --- a/pv/storesession.h +++ b/pv/storesession.h @@ -61,7 +61,7 @@ public: void cancel(); private: - void store_proc(boost::shared_ptr snapshot); + void store_proc(std::shared_ptr snapshot); signals: void progress_updated(); diff --git a/pv/toolbars/samplingbar.cpp b/pv/toolbars/samplingbar.cpp index 367b9b2e..af5afb0c 100644 --- a/pv/toolbars/samplingbar.cpp +++ b/pv/toolbars/samplingbar.cpp @@ -35,10 +35,10 @@ #include #include -using boost::shared_ptr; using std::map; using std::max; using std::min; +using std::shared_ptr; using std::string; namespace pv { diff --git a/pv/toolbars/samplingbar.h b/pv/toolbars/samplingbar.h index e2e24b78..2c2431c4 100644 --- a/pv/toolbars/samplingbar.h +++ b/pv/toolbars/samplingbar.h @@ -25,8 +25,7 @@ #include #include - -#include +#include #include #include @@ -62,11 +61,11 @@ public: SamplingBar(SigSession &session, QWidget *parent); void set_device_list( - const std::list< boost::shared_ptr > + const std::list< std::shared_ptr > &devices, - boost::shared_ptr selected); + std::shared_ptr selected); - boost::shared_ptr get_selected_device() const; + std::shared_ptr get_selected_device() const; void set_capture_state(pv::SigSession::capture_state state); @@ -96,7 +95,7 @@ private: SigSession &_session; QComboBox _device_selector; - std::map > + std::map > _device_selector_map; bool _updating_device_selector; diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index c3f27383..156af100 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -27,9 +27,9 @@ #include "pv/data/analogsnapshot.h" #include "pv/view/view.h" -using boost::shared_ptr; using std::max; using std::min; +using std::shared_ptr; using std::deque; namespace pv { diff --git a/pv/view/analogsignal.h b/pv/view/analogsignal.h index f22d128b..6f0e49d7 100644 --- a/pv/view/analogsignal.h +++ b/pv/view/analogsignal.h @@ -23,7 +23,7 @@ #include "signal.h" -#include +#include namespace pv { @@ -42,15 +42,15 @@ private: static const float EnvelopeThreshold; public: - AnalogSignal(boost::shared_ptr dev_inst, + AnalogSignal(std::shared_ptr dev_inst, const sr_channel *const probe, - boost::shared_ptr data); + std::shared_ptr data); virtual ~AnalogSignal(); - boost::shared_ptr data() const; + std::shared_ptr data() const; - boost::shared_ptr analog_data() const; + std::shared_ptr analog_data() const; void set_scale(float scale); @@ -72,17 +72,17 @@ public: private: void paint_trace(QPainter &p, - const boost::shared_ptr &snapshot, + const std::shared_ptr &snapshot, int y, int left, const int64_t start, const int64_t end, const double pixels_offset, const double samples_per_pixel); void paint_envelope(QPainter &p, - const boost::shared_ptr &snapshot, + const std::shared_ptr &snapshot, int y, int left, const int64_t start, const int64_t end, const double pixels_offset, const double samples_per_pixel); private: - boost::shared_ptr _data; + std::shared_ptr _data; float _scale; }; diff --git a/pv/view/cursor.cpp b/pv/view/cursor.cpp index 95134b77..98b7289f 100644 --- a/pv/view/cursor.cpp +++ b/pv/view/cursor.cpp @@ -29,11 +29,12 @@ #include #include -#include +#include +#include #include -using boost::shared_ptr; +using std::shared_ptr; namespace pv { namespace view { diff --git a/pv/view/cursor.h b/pv/view/cursor.h index 290365e8..16e8298b 100644 --- a/pv/view/cursor.h +++ b/pv/view/cursor.h @@ -23,7 +23,7 @@ #include "timemarker.h" -#include +#include #include @@ -74,7 +74,7 @@ public: private: void compute_text_size(QPainter &p, unsigned int prefix); - boost::shared_ptr get_other_cursor() const; + std::shared_ptr get_other_cursor() const; private: QSizeF _text_size; diff --git a/pv/view/cursorpair.cpp b/pv/view/cursorpair.cpp index f73567e3..d319a7b1 100644 --- a/pv/view/cursorpair.cpp +++ b/pv/view/cursorpair.cpp @@ -23,12 +23,13 @@ #include "view.h" #include "pv/util.h" +#include #include -using boost::shared_ptr; using std::max; using std::make_pair; using std::min; +using std::shared_ptr; using std::pair; namespace pv { diff --git a/pv/view/cursorpair.h b/pv/view/cursorpair.h index 815276e2..6c56dcd7 100644 --- a/pv/view/cursorpair.h +++ b/pv/view/cursorpair.h @@ -23,7 +23,7 @@ #include "cursor.h" -#include +#include #include @@ -47,12 +47,12 @@ public: /** * Returns a pointer to the first cursor. */ - boost::shared_ptr first() const; + std::shared_ptr first() const; /** * Returns a pointer to the second cursor. */ - boost::shared_ptr second() const; + std::shared_ptr second() const; public: QRectF get_label_rect(const QRect &rect) const; @@ -69,7 +69,7 @@ public: std::pair get_cursor_offsets() const; private: - boost::shared_ptr _first, _second; + std::shared_ptr _first, _second; const View &_view; QSizeF _text_size; diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index e2c21184..53eb22f1 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -47,12 +47,12 @@ extern "C" { #include #include -using boost::dynamic_pointer_cast; -using boost::shared_ptr; +using std::dynamic_pointer_cast; using std::list; using std::max; using std::map; using std::min; +using std::shared_ptr; using std::vector; namespace pv { @@ -111,7 +111,7 @@ const QColor DecodeTrace::OutlineColours[16] = { }; DecodeTrace::DecodeTrace(pv::SigSession &session, - boost::shared_ptr decoder_stack, int index) : + std::shared_ptr decoder_stack, int index) : Trace(QString::fromUtf8( decoder_stack->stack().front()->decoder()->name)), _session(session), @@ -136,7 +136,7 @@ bool DecodeTrace::enabled() const return true; } -const boost::shared_ptr& DecodeTrace::decoder() const +const std::shared_ptr& DecodeTrace::decoder() const { return _decoder_stack; } diff --git a/pv/view/decodetrace.h b/pv/view/decodetrace.h index 9a991fcb..b2ff2b59 100644 --- a/pv/view/decodetrace.h +++ b/pv/view/decodetrace.h @@ -25,11 +25,10 @@ #include #include +#include #include -#include - #include struct srd_channel; @@ -65,7 +64,7 @@ private: struct ProbeSelector { const QComboBox *_combo; - const boost::shared_ptr _decoder; + const std::shared_ptr _decoder; const srd_channel *_pdch; }; @@ -83,12 +82,12 @@ private: public: DecodeTrace(pv::SigSession &session, - boost::shared_ptr decoder_stack, + std::shared_ptr decoder_stack, int index); bool enabled() const; - const boost::shared_ptr& decoder() const; + const std::shared_ptr& decoder() const; void set_view(pv::view::View *view); @@ -143,15 +142,15 @@ private: int right, double samples_per_pixel, double pixels_offset); void create_decoder_form(int index, - boost::shared_ptr &dec, + std::shared_ptr &dec, QWidget *parent, QFormLayout *form); QComboBox* create_probe_selector(QWidget *parent, - const boost::shared_ptr &dec, + const std::shared_ptr &dec, const srd_channel *const pdch); void commit_decoder_probes( - boost::shared_ptr &dec); + std::shared_ptr &dec); void commit_probes(); @@ -170,11 +169,11 @@ private slots: private: pv::SigSession &_session; - boost::shared_ptr _decoder_stack; + std::shared_ptr _decoder_stack; uint64_t _decode_start, _decode_end; - std::list< boost::shared_ptr > + std::list< std::shared_ptr > _bindings; std::list _probe_selectors; diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 7c68f302..87effd3d 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -34,10 +34,10 @@ #include -using boost::shared_ptr; using std::max; using std::make_pair; using std::pair; +using std::shared_ptr; using std::vector; namespace pv { @@ -222,7 +222,7 @@ void Header::mouseMoveEvent(QMouseEvent *event) const int delta = event->pos().y() - _mouse_down_point.y(); for (auto i = _drag_traces.begin(); i != _drag_traces.end(); i++) { - const boost::shared_ptr trace((*i).first); + const std::shared_ptr trace((*i).first); if (trace) { const int y = (*i).second + delta; const int y_snap = diff --git a/pv/view/header.h b/pv/view/header.h index 489a5caa..641f203b 100644 --- a/pv/view/header.h +++ b/pv/view/header.h @@ -21,10 +21,8 @@ #ifndef PULSEVIEW_PV_VIEW_HEADER_H #define PULSEVIEW_PV_VIEW_HEADER_H -#include -#include - #include +#include #include #include "marginwidget.h" @@ -48,7 +46,7 @@ public: QSize sizeHint() const; private: - boost::shared_ptr get_mouse_over_trace( + std::shared_ptr get_mouse_over_trace( const QPoint &pt); void clear_selection(); @@ -84,7 +82,7 @@ private: QPoint _mouse_down_point; bool _dragging; - std::list, int> > + std::list, int> > _drag_traces; }; diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 546743e3..8363383a 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -34,11 +34,11 @@ #include #include -using boost::shared_ptr; using std::deque; using std::max; using std::min; using std::pair; +using std::shared_ptr; using std::vector; namespace pv { diff --git a/pv/view/logicsignal.h b/pv/view/logicsignal.h index c3e16661..34a307c9 100644 --- a/pv/view/logicsignal.h +++ b/pv/view/logicsignal.h @@ -23,7 +23,7 @@ #include "signal.h" -#include +#include class QToolBar; @@ -49,15 +49,15 @@ private: static const QColor SignalColours[10]; public: - LogicSignal(boost::shared_ptr dev_inst, + LogicSignal(std::shared_ptr dev_inst, const sr_channel *const probe, - boost::shared_ptr data); + std::shared_ptr data); virtual ~LogicSignal(); - boost::shared_ptr data() const; + std::shared_ptr data() const; - boost::shared_ptr logic_data() const; + std::shared_ptr logic_data() const; /** * Paints the background layer of the signal with a QPainter @@ -102,7 +102,7 @@ private slots: void on_trigger_change(); private: - boost::shared_ptr _data; + std::shared_ptr _data; QToolBar *_trigger_bar; QAction *_trigger_none; diff --git a/pv/view/ruler.cpp b/pv/view/ruler.cpp index 9e29ec29..934b0a67 100644 --- a/pv/view/ruler.cpp +++ b/pv/view/ruler.cpp @@ -35,7 +35,7 @@ #include using namespace Qt; -using boost::shared_ptr; +using std::shared_ptr; namespace pv { namespace view { diff --git a/pv/view/ruler.h b/pv/view/ruler.h index c48f25a0..e7575db1 100644 --- a/pv/view/ruler.h +++ b/pv/view/ruler.h @@ -21,7 +21,7 @@ #ifndef PULSEVIEW_PV_VIEW_RULER_H #define PULSEVIEW_PV_VIEW_RULER_H -#include +#include #include "marginwidget.h" @@ -67,7 +67,7 @@ private slots: void hover_point_changed(); private: - boost::weak_ptr _grabbed_marker; + std::weak_ptr _grabbed_marker; QPoint _mouse_down_point; bool _dragging; }; diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index 3312c592..48b400d1 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -34,7 +34,7 @@ #include -using boost::shared_ptr; +using std::shared_ptr; namespace pv { namespace view { diff --git a/pv/view/signal.h b/pv/view/signal.h index 32d18177..99b685c0 100644 --- a/pv/view/signal.h +++ b/pv/view/signal.h @@ -21,7 +21,7 @@ #ifndef PULSEVIEW_PV_VIEW_SIGNAL_H #define PULSEVIEW_PV_VIEW_SIGNAL_H -#include +#include #include #include @@ -49,7 +49,7 @@ class Signal : public Trace Q_OBJECT protected: - Signal(boost::shared_ptr dev_inst, + Signal(std::shared_ptr dev_inst, const sr_channel *const probe); public: @@ -58,7 +58,7 @@ public: */ void set_name(QString name); - virtual boost::shared_ptr data() const = 0; + virtual std::shared_ptr data() const = 0; /** * Returns true if the trace is visible and enabled. @@ -79,7 +79,7 @@ private slots: void on_disable(); protected: - boost::shared_ptr _dev_inst; + std::shared_ptr _dev_inst; const sr_channel *const _probe; QComboBox *_name_widget; diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 0ebfea1e..d33d4ec9 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -41,8 +41,6 @@ #include "pv/data/logic.h" #include "pv/data/logicsnapshot.h" -using boost::shared_ptr; -using boost::weak_ptr; using pv::data::SignalData; using std::deque; using std::list; @@ -51,7 +49,9 @@ using std::make_pair; using std::min; using std::pair; using std::set; +using std::shared_ptr; using std::vector; +using std::weak_ptr; namespace pv { namespace view { diff --git a/pv/view/view.h b/pv/view/view.h index 06616376..83a6fe2d 100644 --- a/pv/view/view.h +++ b/pv/view/view.h @@ -23,12 +23,10 @@ #include +#include #include #include -#include -#include - #include #include @@ -97,11 +95,11 @@ public: */ void set_scale_offset(double scale, double offset); - std::vector< boost::shared_ptr > get_traces() const; + std::vector< std::shared_ptr > get_traces() const; - std::list > selected_items() const; + std::list > selected_items() const; - std::set< boost::shared_ptr > + std::set< std::shared_ptr > get_visible_data() const; std::pair get_time_extents() const; @@ -162,8 +160,8 @@ private: void update_layout(); static bool compare_trace_v_offsets( - const boost::shared_ptr &a, - const boost::shared_ptr &b); + const std::shared_ptr &a, + const std::shared_ptr &b); private: bool eventFilter(QObject *object, QEvent *event); diff --git a/pv/view/viewport.cpp b/pv/view/viewport.cpp index cdae779e..f8d56810 100644 --- a/pv/view/viewport.cpp +++ b/pv/view/viewport.cpp @@ -26,9 +26,9 @@ #include -using boost::shared_ptr; using std::max; using std::min; +using std::shared_ptr; using std::vector; namespace pv { diff --git a/test/data/decoderstack.cpp b/test/data/decoderstack.cpp index d6e4f75a..0fc0da39 100644 --- a/test/data/decoderstack.cpp +++ b/test/data/decoderstack.cpp @@ -28,10 +28,10 @@ #include "../../pv/sigsession.h" #include "../../pv/view/decodetrace.h" -using boost::shared_ptr; using pv::data::DecoderStack; using pv::data::decode::Decoder; using pv::view::DecodeTrace; +using std::shared_ptr; using std::vector; BOOST_AUTO_TEST_SUITE(DecoderStackTest)