From cf004f69b29a03de9e3ce8378bc33daaf4163d71 Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Tue, 22 Sep 2020 10:47:01 +0200 Subject: [PATCH] FairMQChannel: replace ResetChannel() with Invalidate() --- fairmq/FairMQChannel.cxx | 16 +++++----------- fairmq/FairMQChannel.h | 8 ++++---- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/fairmq/FairMQChannel.cxx b/fairmq/FairMQChannel.cxx index 54a146b9..aa971f50 100644 --- a/fairmq/FairMQChannel.cxx +++ b/fairmq/FairMQChannel.cxx @@ -81,7 +81,7 @@ FairMQChannel::FairMQChannel(const string& name, const string& type, const strin , fPortRangeMin(DefaultPortRangeMin) , fPortRangeMax(DefaultPortRangeMax) , fAutoBind(DefaultAutoBind) - , fIsValid(false) + , fValid(false) , fMultipart(false) {} @@ -126,7 +126,7 @@ FairMQChannel::FairMQChannel(const FairMQChannel& chan, const string& newName) , fPortRangeMin(chan.fPortRangeMin) , fPortRangeMax(chan.fPortRangeMax) , fAutoBind(chan.fAutoBind) - , fIsValid(false) + , fValid(false) , fMultipart(chan.fMultipart) {} @@ -152,7 +152,7 @@ FairMQChannel& FairMQChannel::operator=(const FairMQChannel& chan) fPortRangeMin = chan.fPortRangeMin; fPortRangeMax = chan.fPortRangeMax; fAutoBind = chan.fAutoBind; - fIsValid = false; + fValid = false; fMultipart = chan.fMultipart; return *this; @@ -348,7 +348,7 @@ try { stringstream ss; ss << "Validating channel '" << fName << "'... "; - if (fIsValid) { + if (fValid) { ss << "ALREADY VALID"; LOG(debug) << ss.str(); return true; @@ -483,7 +483,7 @@ try { throw ChannelConfigurationError(tools::ToString("invalid socket rate logging interval (cannot be negative): '", fRateLogging, "'")); } - fIsValid = true; + fValid = true; ss << "VALID"; LOG(debug) << ss.str(); return true; @@ -559,9 +559,3 @@ bool FairMQChannel::BindEndpoint(string& endpoint) } } - -void FairMQChannel::ResetChannel() -{ - fIsValid = false; - // TODO: implement channel resetting -} diff --git a/fairmq/FairMQChannel.h b/fairmq/FairMQChannel.h index d0b1379f..872787c9 100644 --- a/fairmq/FairMQChannel.h +++ b/fairmq/FairMQChannel.h @@ -230,7 +230,7 @@ class FairMQChannel /// Checks if the configured channel settings are valid (checks the validity parameter, without running full validation (as oposed to ValidateChannel())) /// @return true if channel settings are valid, false otherwise. - bool IsValid() const; + bool IsValid() const { return fValid; } /// Validates channel configuration /// @return true if channel settings are valid, false otherwise. @@ -242,8 +242,8 @@ class FairMQChannel bool BindEndpoint(std::string& endpoint); - /// Resets the channel (requires validation to be used again). - void ResetChannel(); + /// invalidates the channel (requires validation to be used again). + void Invalidate() { fValid = false; } /// Sends a message to the socket queue. /// @param msg Constant reference of unique_ptr to a FairMQMessage @@ -369,7 +369,7 @@ class FairMQChannel int fPortRangeMax; bool fAutoBind; - bool fIsValid; + bool fValid; bool fMultipart;