FairMQChannel: replace ResetChannel() with Invalidate()

This commit is contained in:
Alexey Rybalchenko 2020-09-22 10:47:01 +02:00 committed by Dennis Klein
parent cfa18ccfce
commit cf004f69b2
2 changed files with 9 additions and 15 deletions

View File

@ -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
}

View File

@ -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;