From acf63d3c1bde7f1950fd403eeab2239301b11982 Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Wed, 26 May 2021 13:53:48 +0200 Subject: [PATCH] Apply modernize-use-default-member-init --- examples/1-1/sampler.cxx | 9 ++---- examples/1-1/sink.cxx | 6 ++-- examples/1-n-1/sampler.cxx | 9 ++---- examples/1-n-1/sink.cxx | 6 ++-- examples/copypush/sampler.cxx | 15 ++++------ examples/copypush/sink.cxx | 6 ++-- examples/dds/sampler.cxx | 6 ++-- examples/dds/sink.cxx | 6 ++-- examples/multipart/sampler.cxx | 9 ++---- examples/multiple-channels/sampler.cxx | 9 ++---- examples/multiple-channels/sink.cxx | 12 +++----- examples/multiple-transports/sampler1.cxx | 10 ++----- examples/multiple-transports/sampler2.cxx | 9 ++---- examples/multiple-transports/sink.cxx | 9 ++---- examples/n-m/receiver.cxx | 14 +++------- examples/n-m/sender.cxx | 15 +++------- examples/n-m/synchronizer.cxx | 8 ++---- examples/readout/readout.cxx | 20 +++++-------- examples/readout/receiver.cxx | 10 ++----- examples/readout/sender.cxx | 4 +-- examples/region/sampler.cxx | 22 +++++---------- examples/region/sink.cxx | 9 ++---- examples/req-rep/client.cxx | 9 ++---- examples/req-rep/server.cxx | 7 ++--- fairmq/FairMQUnmanagedRegion.h | 34 +++++++++-------------- fairmq/devices/BenchmarkSampler.h | 28 ++++++------------- fairmq/devices/Merger.h | 5 ++-- fairmq/devices/Multiplier.h | 11 ++------ fairmq/devices/Proxy.h | 8 ++---- fairmq/devices/Sink.h | 20 ++++--------- fairmq/devices/Splitter.h | 14 +++------- fairmq/shmem/Common.h | 12 +++----- fairmq/zeromq/Message.h | 6 +--- 33 files changed, 120 insertions(+), 257 deletions(-) diff --git a/examples/1-1/sampler.cxx b/examples/1-1/sampler.cxx index e212a66c..46a63508 100644 --- a/examples/1-1/sampler.cxx +++ b/examples/1-1/sampler.cxx @@ -16,15 +16,12 @@ namespace bpo = boost::program_options; class Sampler : public FairMQDevice { public: - Sampler() - : fMaxIterations(0) - , fNumIterations(0) - {} + Sampler() {} protected: std::string fText; - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; void InitTask() override { diff --git a/examples/1-1/sink.cxx b/examples/1-1/sink.cxx index 10e77ec4..b28cb996 100644 --- a/examples/1-1/sink.cxx +++ b/examples/1-1/sink.cxx @@ -17,8 +17,6 @@ class Sink : public FairMQDevice { public: Sink() - : fMaxIterations(0) - , fNumIterations(0) { // register a handler for data arriving on "data" channel OnData("data", &Sink::HandleData); @@ -46,8 +44,8 @@ class Sink : public FairMQDevice } private: - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/1-n-1/sampler.cxx b/examples/1-n-1/sampler.cxx index 5202c7f2..2b7404d9 100644 --- a/examples/1-n-1/sampler.cxx +++ b/examples/1-n-1/sampler.cxx @@ -18,15 +18,12 @@ namespace bpo = boost::program_options; class Sampler : public FairMQDevice { public: - Sampler() - : fMaxIterations(0) - , fNumIterations(0) - {} + Sampler() {} protected: std::string fText; - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; void InitTask() override { diff --git a/examples/1-n-1/sink.cxx b/examples/1-n-1/sink.cxx index f1fcaca3..f2102e95 100644 --- a/examples/1-n-1/sink.cxx +++ b/examples/1-n-1/sink.cxx @@ -17,8 +17,6 @@ class Sink : public FairMQDevice { public: Sink() - : fMaxIterations(0) - , fNumIterations(0) { // register a handler for data arriving on "data2" channel OnData("data2", &Sink::HandleData); @@ -45,8 +43,8 @@ class Sink : public FairMQDevice } private: - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/copypush/sampler.cxx b/examples/copypush/sampler.cxx index b262731e..c01c13ee 100644 --- a/examples/copypush/sampler.cxx +++ b/examples/copypush/sampler.cxx @@ -18,12 +18,7 @@ namespace bpo = boost::program_options; class Sampler : public FairMQDevice { public: - Sampler() - : fNumDataChannels(0) - , fCounter(0) - , fMaxIterations(0) - , fNumIterations(0) - {} + Sampler() {} protected: void InitTask() override @@ -56,10 +51,10 @@ class Sampler : public FairMQDevice } - int fNumDataChannels; - uint64_t fCounter; - uint64_t fMaxIterations; - uint64_t fNumIterations; + int fNumDataChannels = 0; + uint64_t fCounter = 0; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/copypush/sink.cxx b/examples/copypush/sink.cxx index cbc0fe78..652cb027 100644 --- a/examples/copypush/sink.cxx +++ b/examples/copypush/sink.cxx @@ -17,8 +17,6 @@ class Sink : public FairMQDevice { public: Sink() - : fMaxIterations(0) - , fNumIterations(0) { OnData("data", &Sink::HandleData); } @@ -44,8 +42,8 @@ class Sink : public FairMQDevice } private: - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/dds/sampler.cxx b/examples/dds/sampler.cxx index 3409e9cd..47747db6 100644 --- a/examples/dds/sampler.cxx +++ b/examples/dds/sampler.cxx @@ -17,8 +17,6 @@ class Sampler : public FairMQDevice { public: Sampler() - : fIterations(0) - , fCounter(0) {} void InitTask() override @@ -53,8 +51,8 @@ class Sampler : public FairMQDevice } private: - uint64_t fIterations; - uint64_t fCounter; + uint64_t fIterations = 0; + uint64_t fCounter = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/dds/sink.cxx b/examples/dds/sink.cxx index a6586847..8583aa84 100644 --- a/examples/dds/sink.cxx +++ b/examples/dds/sink.cxx @@ -17,8 +17,6 @@ class Sink : public FairMQDevice { public: Sink() - : fIterations(0) - , fCounter(0) { OnData("data2", &Sink::HandleData); } @@ -45,8 +43,8 @@ class Sink : public FairMQDevice } private: - uint64_t fIterations; - uint64_t fCounter; + uint64_t fIterations = 0; + uint64_t fCounter = 0; }; void addCustomOptions(bpo::options_description& options) { diff --git a/examples/multipart/sampler.cxx b/examples/multipart/sampler.cxx index a9570585..97dac564 100644 --- a/examples/multipart/sampler.cxx +++ b/examples/multipart/sampler.cxx @@ -20,10 +20,7 @@ namespace bpo = boost::program_options; class Sampler : public FairMQDevice { public: - Sampler() - : fMaxIterations(5) - , fNumIterations(0) - {} + Sampler() {} protected: void InitTask() override @@ -81,8 +78,8 @@ class Sampler : public FairMQDevice } private: - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 5; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/multiple-channels/sampler.cxx b/examples/multiple-channels/sampler.cxx index 6e6a898e..1abfdd72 100644 --- a/examples/multiple-channels/sampler.cxx +++ b/examples/multiple-channels/sampler.cxx @@ -19,10 +19,7 @@ namespace bpo = boost::program_options; class Sampler : public FairMQDevice { public: - Sampler() - : fMaxIterations(0) - , fNumIterations(0) - {} + Sampler() {} void InitTask() override { @@ -64,8 +61,8 @@ class Sampler : public FairMQDevice protected: std::string fText; - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/multiple-channels/sink.cxx b/examples/multiple-channels/sink.cxx index fa9f11ec..c8914259 100644 --- a/examples/multiple-channels/sink.cxx +++ b/examples/multiple-channels/sink.cxx @@ -18,10 +18,6 @@ class Sink : public FairMQDevice { public: Sink() - : fReceivedData(false) - , fReceivedBroadcast(false) - , fMaxIterations(0) - , fNumIterations(0) { OnData("broadcast", &Sink::HandleBroadcast); OnData("data", &Sink::HandleData); @@ -61,10 +57,10 @@ class Sink : public FairMQDevice } private: - bool fReceivedData; - bool fReceivedBroadcast; - uint64_t fMaxIterations; - uint64_t fNumIterations; + bool fReceivedData = false; + bool fReceivedBroadcast = false; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/multiple-transports/sampler1.cxx b/examples/multiple-transports/sampler1.cxx index 8b4d34d9..1b5eb28e 100644 --- a/examples/multiple-transports/sampler1.cxx +++ b/examples/multiple-transports/sampler1.cxx @@ -16,11 +16,7 @@ namespace bpo = boost::program_options; class Sampler1 : public FairMQDevice { public: - Sampler1() - : fAckListener() - , fMaxIterations(0) - , fNumIterations(0) - {} + Sampler1() {} protected: void InitTask() override @@ -73,8 +69,8 @@ class Sampler1 : public FairMQDevice } std::thread fAckListener; - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/multiple-transports/sampler2.cxx b/examples/multiple-transports/sampler2.cxx index 3e9c5c82..50d1f167 100644 --- a/examples/multiple-transports/sampler2.cxx +++ b/examples/multiple-transports/sampler2.cxx @@ -16,10 +16,7 @@ namespace bpo = boost::program_options; class Sampler2 : public FairMQDevice { public: - Sampler2() - : fMaxIterations(0) - , fNumIterations(0) - {} + Sampler2() {} protected: void InitTask() override @@ -47,8 +44,8 @@ class Sampler2 : public FairMQDevice private: - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/multiple-transports/sink.cxx b/examples/multiple-transports/sink.cxx index f7fa2e30..4773d758 100644 --- a/examples/multiple-transports/sink.cxx +++ b/examples/multiple-transports/sink.cxx @@ -15,9 +15,6 @@ class Sink : public FairMQDevice { public: Sink() - : fMaxIterations(0) - , fNumIterations1(0) - , fNumIterations2(0) { // register a handler for data arriving on "data" channel OnData("data1", &Sink::HandleData1); @@ -65,9 +62,9 @@ class Sink : public FairMQDevice } private: - uint64_t fMaxIterations; - uint64_t fNumIterations1; - uint64_t fNumIterations2; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations1 = 0; + uint64_t fNumIterations2 = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/n-m/receiver.cxx b/examples/n-m/receiver.cxx index f51599fd..4700a429 100644 --- a/examples/n-m/receiver.cxx +++ b/examples/n-m/receiver.cxx @@ -33,12 +33,6 @@ class Receiver : public FairMQDevice { public: Receiver() - : fBuffer() - , fDiscardedSet() - , fNumSenders(0) - , fBufferTimeoutInMs(5000) - , fMaxTimeframes(0) - , fTimeframeCounter(0) { OnData("data", &Receiver::HandleData); } @@ -102,10 +96,10 @@ class Receiver : public FairMQDevice unordered_map fBuffer; unordered_set fDiscardedSet; - int fNumSenders; - int fBufferTimeoutInMs; - int fMaxTimeframes; - int fTimeframeCounter; + int fNumSenders = 0; + int fBufferTimeoutInMs = 5000; + int fMaxTimeframes = 0; + int fTimeframeCounter = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/n-m/sender.cxx b/examples/n-m/sender.cxx index b9d54b79..862485bc 100644 --- a/examples/n-m/sender.cxx +++ b/examples/n-m/sender.cxx @@ -20,15 +20,8 @@ namespace bpo = boost::program_options; class Sender : public FairMQDevice { public: - Sender() - : fNumReceivers(0) - , fIndex(0) - , fSubtimeframeSize(10000) - {} + Sender() {} - ~Sender() = default; - - protected: void InitTask() override { fIndex = GetConfig()->GetProperty("sender-index"); @@ -64,9 +57,9 @@ class Sender : public FairMQDevice } private: - int fNumReceivers; - unsigned int fIndex; - int fSubtimeframeSize; + int fNumReceivers = 0; + unsigned int fIndex = 0; + int fSubtimeframeSize = 10000; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/n-m/synchronizer.cxx b/examples/n-m/synchronizer.cxx index 48c7739c..3bff1e5c 100644 --- a/examples/n-m/synchronizer.cxx +++ b/examples/n-m/synchronizer.cxx @@ -18,12 +18,8 @@ namespace bpo = boost::program_options; class Synchronizer : public FairMQDevice { public: - Synchronizer() - : fTimeframeId(0) - {} - ~Synchronizer() = default; + Synchronizer() {} - protected: bool ConditionalRun() override { FairMQMessagePtr msg(NewSimpleMessage(fTimeframeId)); @@ -39,7 +35,7 @@ class Synchronizer : public FairMQDevice return true; } - uint16_t fTimeframeId; + uint16_t fTimeframeId = 0; }; void addCustomOptions(bpo::options_description& /* options */) {} diff --git a/examples/readout/readout.cxx b/examples/readout/readout.cxx index aca1d9ea..a86935a7 100644 --- a/examples/readout/readout.cxx +++ b/examples/readout/readout.cxx @@ -18,15 +18,8 @@ namespace bpo = boost::program_options; class Readout : public FairMQDevice { public: - Readout() - : fMsgSize(10000) - , fMaxIterations(0) - , fNumIterations(0) - , fRegion(nullptr) - , fNumUnackedMsgs(0) - {} + Readout() {} - protected: void InitTask() override { fMsgSize = fConfig->GetProperty("msg-size"); @@ -65,6 +58,7 @@ class Readout : public FairMQDevice return true; } + void ResetTask() override { // if not all messages acknowledged, wait for a bit. But only once, since receiver could be already dead. @@ -77,11 +71,11 @@ class Readout : public FairMQDevice } private: - int fMsgSize; - uint64_t fMaxIterations; - uint64_t fNumIterations; - FairMQUnmanagedRegionPtr fRegion; - std::atomic fNumUnackedMsgs; + int fMsgSize = 10000; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; + FairMQUnmanagedRegionPtr fRegion = nullptr; + std::atomic fNumUnackedMsgs = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/readout/receiver.cxx b/examples/readout/receiver.cxx index 8bdde0ae..33d16aae 100644 --- a/examples/readout/receiver.cxx +++ b/examples/readout/receiver.cxx @@ -14,12 +14,8 @@ namespace bpo = boost::program_options; class Receiver : public FairMQDevice { public: - Receiver() - : fMaxIterations(0) - , fNumIterations(0) - {} + Receiver() {} - protected: void InitTask() override { // Get the fMaxIterations value from the command line options (via fConfig) @@ -43,8 +39,8 @@ class Receiver : public FairMQDevice } private: - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/readout/sender.cxx b/examples/readout/sender.cxx index aa80c950..cb90e64a 100644 --- a/examples/readout/sender.cxx +++ b/examples/readout/sender.cxx @@ -16,9 +16,7 @@ namespace bpo = boost::program_options; class Sender : public FairMQDevice { public: - Sender() - : fInputChannelName() - {} + Sender() {} void Init() override { diff --git a/examples/region/sampler.cxx b/examples/region/sampler.cxx index a256e071..53c2f565 100644 --- a/examples/region/sampler.cxx +++ b/examples/region/sampler.cxx @@ -18,16 +18,8 @@ namespace bpo = boost::program_options; class Sampler : public FairMQDevice { public: - Sampler() - : fMsgSize(10000) - , fLinger(100) - , fMaxIterations(0) - , fNumIterations(0) - , fRegion(nullptr) - , fNumUnackedMsgs(0) - {} + Sampler() {} - protected: void InitTask() override { fMsgSize = fConfig->GetProperty("msg-size"); @@ -102,13 +94,13 @@ class Sampler : public FairMQDevice } private: - int fMsgSize; - uint32_t fLinger; - uint64_t fMaxIterations; - uint64_t fNumIterations; - FairMQUnmanagedRegionPtr fRegion; + int fMsgSize = 10000; + uint32_t fLinger = 100; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; + FairMQUnmanagedRegionPtr fRegion = nullptr; std::mutex fMtx; - uint64_t fNumUnackedMsgs; + uint64_t fNumUnackedMsgs = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/region/sink.cxx b/examples/region/sink.cxx index 55b0c250..b9dd7778 100644 --- a/examples/region/sink.cxx +++ b/examples/region/sink.cxx @@ -14,10 +14,7 @@ namespace bpo = boost::program_options; class Sink : public FairMQDevice { public: - Sink() - : fMaxIterations(0) - , fNumIterations(0) - {} + Sink() {} void InitTask() override { @@ -56,8 +53,8 @@ class Sink : public FairMQDevice } private: - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; diff --git a/examples/req-rep/client.cxx b/examples/req-rep/client.cxx index d37d34c7..698cc7e0 100644 --- a/examples/req-rep/client.cxx +++ b/examples/req-rep/client.cxx @@ -18,10 +18,7 @@ namespace bpo = boost::program_options; class Client : public FairMQDevice { public: - Client() - : fMaxIterations(0) - , fNumIterations(0) - {} + Client() {} void InitTask() override { @@ -66,8 +63,8 @@ class Client : public FairMQDevice private: std::string fText; - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/examples/req-rep/server.cxx b/examples/req-rep/server.cxx index 8465d309..44c37f80 100644 --- a/examples/req-rep/server.cxx +++ b/examples/req-rep/server.cxx @@ -17,13 +17,10 @@ class Server : public FairMQDevice { public: Server() - : fMaxIterations(0) - , fNumIterations(0) { OnData("data", &Server::HandleData); } - protected: void InitTask() override { // Get the fMaxIterations value from the command line options (via fConfig) @@ -56,8 +53,8 @@ class Server : public FairMQDevice } private: - uint64_t fMaxIterations; - uint64_t fNumIterations; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; }; void addCustomOptions(bpo::options_description& options) diff --git a/fairmq/FairMQUnmanagedRegion.h b/fairmq/FairMQUnmanagedRegion.h index 2d1f6399..a9bf721d 100644 --- a/fairmq/FairMQUnmanagedRegion.h +++ b/fairmq/FairMQUnmanagedRegion.h @@ -27,14 +27,7 @@ enum class FairMQRegionEvent : int struct FairMQRegionInfo { - FairMQRegionInfo() - : managed(true) - , id(0) - , ptr(nullptr) - , size(0) - , flags(0) - , event(FairMQRegionEvent::created) - {} + FairMQRegionInfo() {} FairMQRegionInfo(bool _managed, uint64_t _id, void* _ptr, size_t _size, int64_t _flags, FairMQRegionEvent _event) : managed(_managed) @@ -45,12 +38,12 @@ struct FairMQRegionInfo , event(_event) {} - bool managed; // managed/unmanaged - uint64_t id; // id of the region - void* ptr; // pointer to the start of the region - size_t size; // region size - int64_t flags; // custom flags set by the creator - FairMQRegionEvent event; + bool managed = true; // managed/unmanaged + uint64_t id = 0; // id of the region + void* ptr = nullptr; // pointer to the start of the region + size_t size = 0; // region size + int64_t flags = 0; // custom flags set by the creator + FairMQRegionEvent event = FairMQRegionEvent::created; }; struct FairMQRegionBlock { @@ -108,17 +101,16 @@ inline std::ostream& operator<<(std::ostream& os, const FairMQRegionEvent& event namespace fair::mq { -struct RegionConfig { - bool lock; - bool zero; - - RegionConfig() - : lock(false), zero(false) - {} +struct RegionConfig +{ + RegionConfig() {} RegionConfig(bool l, bool z) : lock(l), zero(z) {} + + bool lock = false; + bool zero = false; }; using RegionCallback = FairMQRegionCallback; diff --git a/fairmq/devices/BenchmarkSampler.h b/fairmq/devices/BenchmarkSampler.h index 5f403f4d..287ff624 100644 --- a/fairmq/devices/BenchmarkSampler.h +++ b/fairmq/devices/BenchmarkSampler.h @@ -29,17 +29,7 @@ namespace fair::mq class BenchmarkSampler : public Device { public: - BenchmarkSampler() - : fMultipart(false) - , fMemSet(false) - , fNumParts(1) - , fMsgSize(10000) - , fMsgAlignment(0) - , fMsgRate(0) - , fNumIterations(0) - , fMaxIterations(0) - , fOutChannelName() - {} + BenchmarkSampler() {} void InitTask() override { @@ -109,14 +99,14 @@ class BenchmarkSampler : public Device } protected: - bool fMultipart; - bool fMemSet; - size_t fNumParts; - size_t fMsgSize; - size_t fMsgAlignment; - float fMsgRate; - uint64_t fNumIterations; - uint64_t fMaxIterations; + bool fMultipart = false; + bool fMemSet = false; + size_t fNumParts = 1; + size_t fMsgSize = 10000; + size_t fMsgAlignment = 0; + float fMsgRate = 0; + uint64_t fNumIterations = 0; + uint64_t fMaxIterations = 0; std::string fOutChannelName; }; diff --git a/fairmq/devices/Merger.h b/fairmq/devices/Merger.h index 583085ca..0c450c6d 100644 --- a/fairmq/devices/Merger.h +++ b/fairmq/devices/Merger.h @@ -23,13 +23,12 @@ class Merger : public Device { public: Merger() - : fMultipart(true) - , fInChannelName("data-in") + : fInChannelName("data-in") , fOutChannelName("data-out") {} protected: - bool fMultipart; + bool fMultipart = true; std::string fInChannelName; std::string fOutChannelName; diff --git a/fairmq/devices/Multiplier.h b/fairmq/devices/Multiplier.h index 3ededc61..296ddf7f 100644 --- a/fairmq/devices/Multiplier.h +++ b/fairmq/devices/Multiplier.h @@ -20,16 +20,11 @@ namespace fair::mq class Multiplier : public Device { public: - Multiplier() - : fMultipart(true) - , fNumOutputs(0) - , fInChannelName() - , fOutChannelNames() - {} + Multiplier() {} protected: - bool fMultipart; - int fNumOutputs; + bool fMultipart = true; + int fNumOutputs = 0; std::string fInChannelName; std::vector fOutChannelNames; diff --git a/fairmq/devices/Proxy.h b/fairmq/devices/Proxy.h index 344fc2c6..ffa13d19 100644 --- a/fairmq/devices/Proxy.h +++ b/fairmq/devices/Proxy.h @@ -19,14 +19,10 @@ namespace fair::mq class Proxy : public Device { public: - Proxy() - : fMultipart(true) - , fInChannelName() - , fOutChannelName() - {} + Proxy() {} protected: - bool fMultipart; + bool fMultipart = true; std::string fInChannelName; std::string fOutChannelName; diff --git a/fairmq/devices/Sink.h b/fairmq/devices/Sink.h index 49da4bd9..cbd85858 100644 --- a/fairmq/devices/Sink.h +++ b/fairmq/devices/Sink.h @@ -25,22 +25,14 @@ namespace fair::mq class Sink : public Device { public: - Sink() - : fMultipart(false) - , fMaxIterations(0) - , fNumIterations(0) - , fMaxFileSize(0) - , fBytesWritten(0) - , fInChannelName() - , fOutFilename() - {} + Sink() {} protected: - bool fMultipart; - uint64_t fMaxIterations; - uint64_t fNumIterations; - uint64_t fMaxFileSize; - uint64_t fBytesWritten; + bool fMultipart = false; + uint64_t fMaxIterations = 0; + uint64_t fNumIterations = 0; + uint64_t fMaxFileSize = 0; + uint64_t fBytesWritten = 0; std::string fInChannelName; std::string fOutFilename; std::fstream fOutputFile; diff --git a/fairmq/devices/Splitter.h b/fairmq/devices/Splitter.h index 2bd45200..119f3340 100644 --- a/fairmq/devices/Splitter.h +++ b/fairmq/devices/Splitter.h @@ -19,18 +19,12 @@ namespace fair::mq class Splitter : public Device { public: - Splitter() - : fMultipart(true) - , fNumOutputs(0) - , fDirection(0) - , fInChannelName() - , fOutChannelName() - {} + Splitter() {} protected: - bool fMultipart; - int fNumOutputs; - int fDirection; + bool fMultipart = true; + int fNumOutputs = 0; + int fDirection = 0; std::string fInChannelName; std::string fOutChannelName; diff --git a/fairmq/shmem/Common.h b/fairmq/shmem/Common.h index 2b134ff5..b05f64e9 100644 --- a/fairmq/shmem/Common.h +++ b/fairmq/shmem/Common.h @@ -187,11 +187,7 @@ using Uint16MsgDebugMapHashMap = boost::unordered_map()) { if (zmq_msg_init(fMsg.get()) != 0) { @@ -55,7 +54,6 @@ class Message final : public fair::mq::Message Message(const size_t size, FairMQTransportFactory* factory = nullptr) : fair::mq::Message(factory) - , fAlignment(0) , fMsg(std::make_unique()) { if (zmq_msg_init_size(fMsg.get(), size) != 0) { @@ -96,7 +94,6 @@ class Message final : public fair::mq::Message Message(void* data, const size_t size, fairmq_free_fn* ffn, void* hint = nullptr, FairMQTransportFactory* factory = nullptr) : fair::mq::Message(factory) - , fAlignment(0) , fMsg(std::make_unique()) { if (zmq_msg_init_data(fMsg.get(), data, size, ffn, hint) != 0) { @@ -106,7 +103,6 @@ class Message final : public fair::mq::Message Message(UnmanagedRegionPtr& region, void* data, const size_t size, void* hint = 0, FairMQTransportFactory* factory = nullptr) : fair::mq::Message(factory) - , fAlignment(0) , fMsg(std::make_unique()) { if (region->GetType() != GetType()) { @@ -264,7 +260,7 @@ class Message final : public fair::mq::Message ~Message() override { CloseMessage(); } private: - size_t fAlignment; + size_t fAlignment = 0; std::unique_ptr fMsg; zmq_msg_t* GetMessage() const { return fMsg.get(); }