Skip to content

Commit e3faf16

Browse files
ChristianTackeGSIdennisklein
authored andcommitted
chore: Use override in FairMQ device derived classes
1 parent 0a4e061 commit e3faf16

8 files changed

Lines changed: 37 additions & 37 deletions

File tree

examples/MQ/pixelDetector/src/devices/FairMQPixelSampler.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -30,7 +30,7 @@ class FairMQPixelSampler : public fair::mq::Device
3030
{
3131
public:
3232
FairMQPixelSampler();
33-
virtual ~FairMQPixelSampler();
33+
~FairMQPixelSampler() override;
3434

3535
void AddInputFileName(const std::string& tempString) { fFileNames.push_back(tempString); }
3636
void AddInputBranchName(const std::string& tempString) { fBranchNames.push_back(tempString); }
@@ -45,10 +45,10 @@ class FairMQPixelSampler : public fair::mq::Device
4545
void SetAckChannelName(const std::string& tstr) { fAckChannelName = tstr; }
4646

4747
protected:
48-
virtual bool ConditionalRun();
49-
virtual void PreRun();
50-
virtual void PostRun();
51-
virtual void InitTask();
48+
bool ConditionalRun() override;
49+
void PreRun() override;
50+
void PostRun() override;
51+
void InitTask() override;
5252

5353
private:
5454
std::string fOutputChannelName;

examples/MQ/pixelDetector/src/devices/FairMQPixelSamplerBin.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -30,7 +30,7 @@ class FairMQPixelSamplerBin : public fair::mq::Device
3030
{
3131
public:
3232
FairMQPixelSamplerBin();
33-
virtual ~FairMQPixelSamplerBin();
33+
~FairMQPixelSamplerBin() override;
3434

3535
void AddInputFileName(const std::string& tempString) { fFileNames.push_back(tempString); }
3636
void AddInputBranchName(const std::string& tempString) { fBranchNames.push_back(tempString); }
@@ -43,10 +43,10 @@ class FairMQPixelSamplerBin : public fair::mq::Device
4343
void SetAckChannelName(const std::string& tstr) { fAckChannelName = tstr; }
4444

4545
protected:
46-
virtual bool ConditionalRun();
47-
virtual void PreRun();
48-
virtual void PostRun();
49-
virtual void InitTask();
46+
bool ConditionalRun() override;
47+
void PreRun() override;
48+
void PostRun() override;
49+
void InitTask() override;
5050

5151
private:
5252
std::string fOutputChannelName;

examples/MQ/pixelSimSplit/src/devices/FairMQPrimaryGeneratorDevice.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2017-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2017-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
@@ -31,7 +31,7 @@ class FairMQPrimaryGeneratorDevice : public fair::mq::Device
3131
{
3232
public:
3333
FairMQPrimaryGeneratorDevice();
34-
virtual ~FairMQPrimaryGeneratorDevice();
34+
~FairMQPrimaryGeneratorDevice() override;
3535

3636
virtual void SendPrimaries();
3737

@@ -50,10 +50,10 @@ class FairMQPrimaryGeneratorDevice : public fair::mq::Device
5050

5151
protected:
5252
bool Reply(fair::mq::MessagePtr&, int);
53-
virtual void InitTask();
54-
virtual void PreRun();
55-
virtual void PostRun();
56-
virtual bool ConditionalRun();
53+
void InitTask() override;
54+
void PreRun() override;
55+
void PostRun() override;
56+
bool ConditionalRun() override;
5757

5858
private:
5959
std::string fGeneratorChannelName;

examples/advanced/Tutorial3/MQ/processor.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -45,10 +45,10 @@ class Processor : public fair::mq::Device
4545
Processor(const Processor&) = delete;
4646
Processor operator=(const Processor&) = delete;
4747

48-
virtual ~Processor() {}
48+
~Processor() override = default;
4949

5050
protected:
51-
virtual void InitTask()
51+
void InitTask() override
5252
{
5353
std::string inChannelName = fConfig->GetValue<std::string>("in-channel");
5454
std::string outChannelName = fConfig->GetValue<std::string>("out-channel");
@@ -74,7 +74,7 @@ class Processor : public fair::mq::Device
7474
});
7575
}
7676

77-
virtual void PostRun() { LOG(info) << "Received " << fReceivedMsgs << " and sent " << fSentMsgs << " messages!"; }
77+
void PostRun() override { LOG(info) << "Received " << fReceivedMsgs << " and sent " << fSentMsgs << " messages!"; }
7878

7979
private:
8080
std::unique_ptr<ProcessorTask> fProcessorTask;

examples/advanced/Tutorial3/MQ/sampler.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -65,10 +65,10 @@ class Sampler : public fair::mq::Device
6565
Sampler(const Sampler&) = delete;
6666
Sampler operator=(const Sampler&) = delete;
6767

68-
virtual ~Sampler() {}
68+
~Sampler() override = default;
6969

7070
protected:
71-
virtual void InitTask()
71+
void InitTask() override
7272
{
7373
LOG(info) << "Initializing Task...";
7474

@@ -117,7 +117,7 @@ class Sampler : public fair::mq::Device
117117
LOG(info) << "Number of events to process: " << fNumEvents;
118118
}
119119

120-
virtual void Run()
120+
void Run() override
121121
{
122122
while (fSentMsgs < fNumEvents) {
123123
fair::mq::MessagePtr msg;
@@ -142,7 +142,7 @@ class Sampler : public fair::mq::Device
142142
}
143143
}
144144

145-
virtual void ResetTask()
145+
void ResetTask() override
146146
{
147147
if (fFairRunAna) {
148148
fFairRunAna->TerminateRun();

fairroot/basemq/devices/FairMQLmdSampler.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class FairMQLmdSampler : public fair::mq::Device
5858
FairMQLmdSampler(const FairMQLmdSampler&) = delete;
5959
FairMQLmdSampler operator=(const FairMQLmdSampler&) = delete;
6060

61-
virtual ~FairMQLmdSampler() {}
61+
~FairMQLmdSampler() override = default;
6262

6363
void AddSubEvtKey(short type,
6464
short subType,
@@ -105,7 +105,7 @@ class FairMQLmdSampler : public fair::mq::Device
105105
}
106106

107107
protected:
108-
void InitTask()
108+
void InitTask() override
109109
{
110110
fFilename = fConfig->GetValue<std::string>("input-file-name");
111111
fType = fConfig->GetValue<short>("lmd-type");
@@ -134,7 +134,7 @@ class FairMQLmdSampler : public fair::mq::Device
134134
fNEvent = 0;
135135
fCurrentEvent = 0;
136136
}
137-
void Run()
137+
void Run() override
138138
{
139139
while (!NewStatePending()) //&& !fStop)
140140
{

fairroot/basemq/devices/FairMQUnpacker.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class FairMQUnpacker : public fair::mq::Device
4343
FairMQUnpacker(const FairMQUnpacker&) = delete;
4444
FairMQUnpacker operator=(const FairMQUnpacker&) = delete;
4545

46-
virtual ~FairMQUnpacker() { delete fUnpacker; }
46+
~FairMQUnpacker() override { delete fUnpacker; }
4747

4848
void AddSubEvtKey(short type,
4949
short subType,
@@ -68,7 +68,7 @@ class FairMQUnpacker : public fair::mq::Device
6868
}
6969

7070
protected:
71-
void InitTask()
71+
void InitTask() override
7272
{
7373
fType = fConfig->GetValue<short>("lmd-type");
7474
fSubType = fConfig->GetValue<short>("lmd-sub-type");
@@ -105,7 +105,7 @@ class FairMQUnpacker : public fair::mq::Device
105105
// fUnpacker->Init(); // a priori not needed -> only required for Registering in FairRootManager
106106
}
107107

108-
void Run()
108+
void Run() override
109109
{
110110
auto& inputChannel = GetChannel(fInputChannelName);
111111

fairroot/parmq/ParameterMQServer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -29,10 +29,10 @@ class ParameterMQServer : public fair::mq::Device
2929
ParameterMQServer(const ParameterMQServer&) = delete;
3030
ParameterMQServer operator=(const ParameterMQServer&) = delete;
3131

32-
virtual ~ParameterMQServer();
32+
~ParameterMQServer() override;
3333

34-
virtual void InitTask();
35-
virtual void Init();
34+
void InitTask() override;
35+
void Init() override;
3636
bool ProcessRequest(fair::mq::MessagePtr&, int);
3737
bool ProcessUpdate(fair::mq::MessagePtr&, int);
3838

0 commit comments

Comments
 (0)