From 863d9fe32fbff286d4c359d6a5c29184ed511866 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 21 Dec 2015 22:53:23 +0100 Subject: Replace some boost shared_ptr by std ones --- src/ConfigParser.cpp | 9 +++++---- src/ConfigParser.h | 10 +++++----- src/DabMultiplexer.cpp | 10 +++++----- src/DabMultiplexer.h | 15 ++++++++------- src/DabMux.cpp | 14 ++++++-------- src/MuxElements.cpp | 3 ++- src/MuxElements.h | 2 +- src/RemoteControl.h | 3 ++- src/fig/FIG.h | 6 +++--- src/fig/FIGCarousel.cpp | 3 ++- src/fig/FIGCarousel.h | 4 ++-- src/utils.cpp | 6 +++--- src/utils.h | 5 +++-- 13 files changed, 47 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp index db01769..8795277 100644 --- a/src/ConfigParser.cpp +++ b/src/ConfigParser.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -143,8 +144,8 @@ uint16_t get_announcement_flag_from_ptree( } void parse_ptree(boost::property_tree::ptree& pt, - boost::shared_ptr ensemble, - boost::shared_ptr rc + std::shared_ptr ensemble, + std::shared_ptr rc ) { using boost::property_tree::ptree; @@ -554,9 +555,9 @@ void parse_ptree(boost::property_tree::ptree& pt, void setup_subchannel_from_ptree(dabSubchannel* subchan, boost::property_tree::ptree &pt, - boost::shared_ptr ensemble, + std::shared_ptr ensemble, string subchanuid, - boost::shared_ptr rc) + std::shared_ptr rc) { using boost::property_tree::ptree; using boost::property_tree::ptree_error; diff --git a/src/ConfigParser.h b/src/ConfigParser.h index 1eec783..0b10c04 100644 --- a/src/ConfigParser.h +++ b/src/ConfigParser.h @@ -36,17 +36,17 @@ #include "MuxElements.h" #include "DabMux.h" #include -#include +#include void parse_ptree(boost::property_tree::ptree& pt, - boost::shared_ptr ensemble, - boost::shared_ptr rc); + std::shared_ptr ensemble, + std::shared_ptr rc); void setup_subchannel_from_ptree(dabSubchannel* subchan, boost::property_tree::ptree &pt, - boost::shared_ptr ensemble, + std::shared_ptr ensemble, std::string subchanuid, - boost::shared_ptr rc); + std::shared_ptr rc); #endif diff --git a/src/DabMultiplexer.cpp b/src/DabMultiplexer.cpp index eb6de3d..fd59b8f 100644 --- a/src/DabMultiplexer.cpp +++ b/src/DabMultiplexer.cpp @@ -24,9 +24,9 @@ */ #include +#include #include "DabMultiplexer.h" #include "ConfigParser.h" -#include #include "fig/FIG.h" using namespace std; @@ -76,7 +76,7 @@ const unsigned short BitRateTable[64] = { }; DabMultiplexer::DabMultiplexer( - boost::shared_ptr rc, + std::shared_ptr rc, boost::property_tree::ptree pt) : RemoteControllable("mux"), m_pt(pt), @@ -89,7 +89,7 @@ DabMultiplexer::DabMultiplexer( currentFrame(0), insertFIG(0), rotateFIB(0), - ensemble(boost::make_shared()), + ensemble(std::make_shared()), fig_carousel(ensemble) { prepare_watermark(); @@ -125,7 +125,7 @@ void DabMultiplexer::prepare_watermark() void DabMultiplexer::update_config(boost::property_tree::ptree pt) { - ensemble_next = boost::make_shared(); + ensemble_next = std::make_shared(); m_pt_next = pt; @@ -425,7 +425,7 @@ void DabMultiplexer::prepare_data_inputs() } /* Each call creates one ETI frame */ -void DabMultiplexer::mux_frame(std::vector >& outputs) +void DabMultiplexer::mux_frame(std::vector >& outputs) { int cur; time_t date; diff --git a/src/DabMultiplexer.h b/src/DabMultiplexer.h index bafefff..aa468ea 100644 --- a/src/DabMultiplexer.h +++ b/src/DabMultiplexer.h @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include class MuxInitException : public std::exception @@ -66,13 +66,14 @@ class MuxInitException : public std::exception class DabMultiplexer : public RemoteControllable { public: - DabMultiplexer(boost::shared_ptr rc, - boost::property_tree::ptree pt); + DabMultiplexer( + std::shared_ptr rc, + boost::property_tree::ptree pt); void prepare(void); unsigned long getCurrentFrame() { return currentFrame; } - void mux_frame(std::vector >& outputs); + void mux_frame(std::vector >& outputs); void print_info(void); @@ -95,7 +96,7 @@ class DabMultiplexer : public RemoteControllable { void reconfigure(void); boost::property_tree::ptree m_pt; - boost::shared_ptr m_rc; + std::shared_ptr m_rc; unsigned timestamp; bool MNSC_increment_time; @@ -128,11 +129,11 @@ class DabMultiplexer : public RemoteControllable { std::vector::iterator subchannelFIG0_1; - boost::shared_ptr ensemble; + std::shared_ptr ensemble; // Multiplex reconfiguration requires two sets of configurations boost::property_tree::ptree m_pt_next; - boost::shared_ptr ensemble_next; + std::shared_ptr ensemble_next; #if HAVE_OUTPUT_EDI std::ofstream edi_debug_file; diff --git a/src/DabMux.cpp b/src/DabMux.cpp index f3f0c95..18fee19 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -29,7 +29,7 @@ # include "config.h" #endif -#include +#include #include #include #include @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) int returnCode = 0; ptree pt; - std::vector > outputs; + std::vector > outputs; try { if (argc == 2) { // Assume the only argument is a config file @@ -276,15 +276,13 @@ int main(int argc, char *argv[]) /************** READ REMOTE CONTROL PARAMETERS *************/ int telnetport = pt.get("remotecontrol.telnetport", 0); - boost::shared_ptr rc; + std::shared_ptr rc; if (telnetport != 0) { - rc = boost::shared_ptr( - new RemoteControllerTelnet(telnetport)); + rc = std::make_shared(telnetport); } else { - rc = boost::shared_ptr( - new RemoteControllerDummy()); + rc = std::make_shared(); } DabMultiplexer mux(rc, pt); @@ -412,7 +410,7 @@ int main(int argc, char *argv[]) return -1; } - boost::shared_ptr dabout(output); + std::shared_ptr dabout(output); outputs.push_back(dabout); } diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index adc6a60..b47a1ae 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -24,6 +24,7 @@ */ #include +#include #include #include "MuxElements.h" @@ -335,7 +336,7 @@ const string DabComponent::get_parameter(const string& parameter) const } -subchannel_type_t DabService::getType(boost::shared_ptr ensemble) +subchannel_type_t DabService::getType(std::shared_ptr ensemble) { vector::iterator subchannel; vector::iterator component = diff --git a/src/MuxElements.h b/src/MuxElements.h index 8539909..97b1390 100644 --- a/src/MuxElements.h +++ b/src/MuxElements.h @@ -361,7 +361,7 @@ class DabService : public RemoteControllable uint16_t ASu; std::vector clusters; - subchannel_type_t getType(boost::shared_ptr ensemble); + subchannel_type_t getType(std::shared_ptr ensemble); unsigned char nbComponent(std::vector& components); DabLabel label; diff --git a/src/RemoteControl.h b/src/RemoteControl.h index 46a828f..e7bb7fe 100644 --- a/src/RemoteControl.h +++ b/src/RemoteControl.h @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -105,7 +106,7 @@ class RemoteControllable { controller.enrol(this); } - virtual void enrol_at(boost::shared_ptr controller) { + virtual void enrol_at(std::shared_ptr controller) { controller->enrol(this); } diff --git a/src/fig/FIG.h b/src/fig/FIG.h index c1a5ae3..1c1ab8e 100644 --- a/src/fig/FIG.h +++ b/src/fig/FIG.h @@ -27,7 +27,7 @@ #ifndef __FIG_H_ #define __FIG_H_ -#include +#include #include "MuxElements.h" namespace FIC { @@ -36,14 +36,14 @@ namespace FIC { class FIGRuntimeInformation { public: - FIGRuntimeInformation(boost::shared_ptr e) : + FIGRuntimeInformation(std::shared_ptr e) : currentFrame(0), ensemble(e), factumAnalyzer(false) {} time_t date; unsigned long currentFrame; - boost::shared_ptr ensemble; + std::shared_ptr ensemble; bool factumAnalyzer; }; diff --git a/src/fig/FIGCarousel.cpp b/src/fig/FIGCarousel.cpp index c9daddf..5e1e82f 100644 --- a/src/fig/FIGCarousel.cpp +++ b/src/fig/FIGCarousel.cpp @@ -31,6 +31,7 @@ #include "fig/FIGCarousel.h" #include #include +#include #include #define CAROUSELDEBUG 0 @@ -56,7 +57,7 @@ void FIGCarouselElement::increase_deadline() /**************** FIGCarousel *****************/ -FIGCarousel::FIGCarousel(boost::shared_ptr ensemble) : +FIGCarousel::FIGCarousel(std::shared_ptr ensemble) : m_rti(ensemble), m_fig0_0(&m_rti), m_fig0_1(&m_rti), diff --git a/src/fig/FIGCarousel.h b/src/fig/FIGCarousel.h index bb6b546..738a302 100644 --- a/src/fig/FIGCarousel.h +++ b/src/fig/FIGCarousel.h @@ -34,7 +34,7 @@ #include "fig/FIG1.h" #include #include -#include +#include #include "MuxElements.h" namespace FIC { @@ -58,7 +58,7 @@ enum class FIBAllocation { class FIGCarousel { public: - FIGCarousel(boost::shared_ptr ensemble); + FIGCarousel(std::shared_ptr ensemble); void update(unsigned long currentFrame, time_t dabTime); diff --git a/src/utils.cpp b/src/utils.cpp index 7d80239..e87a698 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -24,7 +24,7 @@ */ #include #include -#include +#include #include #include "DabMux.h" #include "utils.h" @@ -354,7 +354,7 @@ void printUsage(char *name, FILE* out) } #endif -void printOutputs(vector >& outputs) +void printOutputs(vector >& outputs) { int index = 0; @@ -533,7 +533,7 @@ void printSubchannels(vector& subchannels) } } -void printEnsemble(const boost::shared_ptr ensemble) +void printEnsemble(const shared_ptr ensemble) { etiLog.log(info, "Ensemble"); etiLog.log(info, " id: 0x%lx (%lu)", ensemble->id, ensemble->id); diff --git a/src/utils.h b/src/utils.h index 3a5cf1c..926fa3d 100644 --- a/src/utils.h +++ b/src/utils.h @@ -29,6 +29,7 @@ #define _UTILS_H #include +#include #include "MuxElements.h" time_t getDabTime(); @@ -50,7 +51,7 @@ void printUsageConfigfile(char *name, FILE* out = stderr); /* The following four utility functions display a * description of all outputs, services, components * resp. subchannels*/ -void printOutputs(std::vector >& outputs); +void printOutputs(std::vector >& outputs); void printServices(const std::vector >& services); @@ -59,7 +60,7 @@ void printComponents(std::vector& components); void printSubchannels(std::vector& subchannels); /* Print information about the whole ensemble */ -void printEnsemble(const boost::shared_ptr ensemble); +void printEnsemble(const std::shared_ptr ensemble); /* Print detailed component information */ void printComponent(DabComponent* component); -- cgit v1.2.3