Skip to content

Commit b1146c7

Browse files
ChristianTackeGSIdennisklein
authored andcommitted
Add override in examples/
Add `override` in the examples shouldn't hurt, really.
1 parent 43536bf commit b1146c7

48 files changed

Lines changed: 367 additions & 371 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/MQ/histogramServer/FairMQExHistoCanvasDrawerExample.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2022 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, *
@@ -19,11 +19,11 @@ class FairMQExHistoCanvasDrawerExample : public FairMQExHistoCanvasDrawer
1919
{
2020
public:
2121
FairMQExHistoCanvasDrawerExample();
22-
virtual ~FairMQExHistoCanvasDrawerExample();
22+
~FairMQExHistoCanvasDrawerExample() override;
2323

24-
void CreateCanvases(THttpServer&);
24+
void CreateCanvases(THttpServer&) override;
2525

26-
void DrawHistograms(TObjArray&);
26+
void DrawHistograms(TObjArray&) override;
2727

2828
private:
2929
FairMQExHistoCanvasDrawerExample(const FairMQExHistoCanvasDrawerExample&);

examples/MQ/histogramServer/FairMQExHistoDevice.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ class FairMQExHistoDevice : public fair::mq::Device
1919
{
2020
public:
2121
FairMQExHistoDevice();
22-
virtual ~FairMQExHistoDevice();
22+
~FairMQExHistoDevice() override;
2323

2424
protected:
25-
virtual void InitTask();
26-
virtual void PreRun();
27-
virtual void PostRun();
28-
virtual bool ConditionalRun();
25+
void InitTask() override;
26+
void PreRun() override;
27+
void PostRun() override;
28+
bool ConditionalRun() override;
2929

3030
private:
3131
FairMQExHistoDevice(const FairMQExHistoDevice&);

examples/MQ/histogramServer/FairMQExHistoServer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class FairMQExHistoServer : public fair::mq::Device
2323
public:
2424
FairMQExHistoServer();
2525

26-
virtual ~FairMQExHistoServer();
26+
~FairMQExHistoServer() override;
2727

2828
void UpdateHttpServer();
2929

@@ -33,13 +33,13 @@ class FairMQExHistoServer : public fair::mq::Device
3333
}
3434

3535
protected:
36-
virtual void InitTask();
36+
void InitTask() override;
3737

3838
bool ReceiveData(fair::mq::MessagePtr& msg, int index);
3939

40-
virtual void PreRun();
40+
void PreRun() override;
4141

42-
virtual void PostRun();
42+
void PostRun() override;
4343

4444
private:
4545
std::string fInputChannelName;

examples/MQ/parameters/FairMQExParamsClient.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ class FairMQExParamsClient : public fair::mq::Device
2424
{
2525
public:
2626
FairMQExParamsClient();
27-
virtual ~FairMQExParamsClient();
27+
~FairMQExParamsClient() override;
2828

2929
protected:
30-
virtual bool ConditionalRun();
31-
virtual void InitTask();
30+
bool ConditionalRun() override;
31+
void InitTask() override;
3232

3333
private:
3434
int fRunId;

examples/MQ/parameters/FairMQExParamsContFact.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2022 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, *
@@ -20,10 +20,10 @@ class FairMQExParamsContFact : public FairContFact
2020

2121
public:
2222
FairMQExParamsContFact();
23-
~FairMQExParamsContFact() {}
23+
~FairMQExParamsContFact() override = default;
2424

25-
FairParSet* createContainer(FairContainer*);
26-
ClassDef(FairMQExParamsContFact, 0);
25+
FairParSet* createContainer(FairContainer*) override;
26+
ClassDefOverride(FairMQExParamsContFact, 0);
2727
};
2828

2929
#endif /* FAIRMQEXPARAMSCONTFACT_H */

examples/MQ/parameters/FairMQExParamsParOne.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2022 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, *
@@ -26,15 +26,15 @@ class FairMQExParamsParOne : public FairParGenericSet
2626
const char* context = "Default");
2727

2828
/** Destructor **/
29-
virtual ~FairMQExParamsParOne();
29+
~FairMQExParamsParOne() override;
3030

31-
virtual void print();
31+
void print() override;
3232

3333
/** Reset all parameters **/
34-
virtual void clear();
34+
void clear() override;
3535

36-
void putParams(FairParamList* list);
37-
Bool_t getParams(FairParamList* list);
36+
void putParams(FairParamList* list) override;
37+
Bool_t getParams(FairParamList* list) override;
3838

3939
inline void SetValue(const Int_t& val) { fParameterValue = val; }
4040

@@ -44,7 +44,7 @@ class FairMQExParamsParOne : public FairParGenericSet
4444
FairMQExParamsParOne(const FairMQExParamsParOne&);
4545
FairMQExParamsParOne& operator=(const FairMQExParamsParOne&);
4646

47-
ClassDef(FairMQExParamsParOne, 1);
47+
ClassDefOverride(FairMQExParamsParOne, 1);
4848
};
4949

5050
#endif // FAIRMQEXPARAMSPARONE_H_

examples/MQ/pixelAlternative/src/devices/FairMQPixAltFileSinkBin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class FairMQPixAltFileSinkBin : public fair::mq::Device
2424
{
2525
public:
2626
FairMQPixAltFileSinkBin();
27-
virtual ~FairMQPixAltFileSinkBin();
27+
~FairMQPixAltFileSinkBin() override;
2828

2929
void SetOutputFileName(const std::string& tempString) { fFileName = tempString; }
3030
std::string GetOutputFileName() { return fFileName; }
@@ -34,7 +34,7 @@ class FairMQPixAltFileSinkBin : public fair::mq::Device
3434

3535
protected:
3636
bool StoreData(fair::mq::Parts&, int);
37-
virtual void Init();
37+
void Init() override;
3838

3939
private:
4040
std::string fInputChannelName;

examples/MQ/pixelAlternative/src/devices/FairMQPixAltSamplerBin.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class FairMQPixAltSamplerBin : public fair::mq::Device
3131
{
3232
public:
3333
FairMQPixAltSamplerBin();
34-
virtual ~FairMQPixAltSamplerBin();
34+
~FairMQPixAltSamplerBin() override;
3535

3636
void AddInputFileName(const std::string& tempString) { fFileNames.push_back(tempString); }
3737

@@ -45,10 +45,10 @@ class FairMQPixAltSamplerBin : public fair::mq::Device
4545
void SetAggregateFactor(int nal) { fAggregateLevel = nal; }
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
bool ReadBinFile();
5454
bool ReadRootFile();

examples/MQ/pixelDetector/src/FairOnlineSink.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2017-2022 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,35 +31,35 @@ class FairOnlineSink : public FairSink
3131
{
3232
public:
3333
FairOnlineSink();
34-
virtual ~FairOnlineSink() {}
34+
~FairOnlineSink() override = default;
3535

36-
virtual Bool_t InitSink() { return kTRUE; }
37-
virtual void Close() {}
38-
virtual void Reset() {}
36+
Bool_t InitSink() override { return kTRUE; }
37+
void Close() override {}
38+
void Reset() override {}
3939

40-
virtual Sink_Type GetSinkType() { return kONLINESINK; }
40+
Sink_Type GetSinkType() override { return kONLINESINK; }
4141

4242
virtual void FillEventHeader(FairEventHeader* /* feh */) {}
4343

44-
virtual void SetOutTree(TTree* /* fTree */) { return; }
44+
void SetOutTree(TTree* /* fTree */) override { return; }
4545

46-
virtual void Fill();
46+
void Fill() override;
4747

48-
virtual Int_t Write(const char* /* name=0 */, Int_t /* option=0 */, Int_t /* bufsize=0 */) { return -1; }
48+
Int_t Write(const char* /* name=0 */, Int_t /* option=0 */, Int_t /* bufsize=0 */) override { return -1; }
4949

50-
virtual void RegisterImpl(const char*, const char*, void*);
51-
virtual void RegisterAny(const char* brname, const std::type_info& oi, const std::type_info& pi, void* obj);
50+
void RegisterImpl(const char*, const char*, void*) override;
51+
void RegisterAny(const char* brname, const std::type_info& oi, const std::type_info& pi, void* obj) override;
5252

53-
virtual void WriteFolder() {}
54-
virtual bool CreatePersistentBranchesAny() { return false; }
53+
void WriteFolder() override {}
54+
bool CreatePersistentBranchesAny() override { return false; }
5555

56-
virtual void WriteObject(TObject* /* f */, const char*, Int_t /* option = 0 */) {}
57-
virtual void WriteGeometry() {}
56+
void WriteObject(TObject* /* f */, const char*, Int_t /* option = 0 */) override {}
57+
void WriteGeometry() override {}
5858

5959
virtual void SetMQRunDevice(FairMQRunDevice* mrs) { fMQRunDevice = mrs; }
6060
virtual FairMQRunDevice* GetMQRunDevice() { return fMQRunDevice; }
6161

62-
virtual FairSink* CloneSink();
62+
FairSink* CloneSink() override;
6363

6464
bool IsPersistentBranchAny(const char* name);
6565

examples/MQ/pixelDetector/src/Pixel.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2022 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, *
@@ -31,27 +31,27 @@ class Pixel : public FairDetector
3131
Pixel();
3232

3333
/** destructor */
34-
virtual ~Pixel();
34+
~Pixel() override;
3535

3636
/** Initialization of the detector is done here */
37-
virtual void Initialize();
37+
void Initialize() override;
3838

3939
/** this method is called for each step during simulation
4040
* (see FairMCApplication::Stepping())
4141
*/
42-
virtual Bool_t ProcessHits(FairVolume* v = 0);
42+
Bool_t ProcessHits(FairVolume* v = 0) override;
4343

4444
/** Registers the produced collections in FAIRRootManager. */
45-
virtual void Register();
45+
void Register() override;
4646

4747
/** Gets the produced collections */
48-
virtual TClonesArray* GetCollection(Int_t iColl) const;
48+
TClonesArray* GetCollection(Int_t iColl) const override;
4949

5050
/** has to be called after each event to reset the containers */
51-
virtual void Reset();
51+
void Reset() override;
5252

5353
/** Create the detector geometry */
54-
void ConstructGeometry();
54+
void ConstructGeometry() override;
5555

5656
/** This method is an example of how to add your own point
5757
* of type PixelPoint to the clones array
@@ -65,17 +65,17 @@ class Pixel : public FairDetector
6565

6666
// virtual void CopyClones( TClonesArray* cl1, TClonesArray* cl2 ,
6767
// Int_t offset) {;}
68-
virtual void SetSpecialPhysicsCuts() { ; }
69-
virtual void EndOfEvent();
70-
virtual void FinishPrimary() { ; }
71-
virtual void FinishRun() { ; }
72-
virtual void BeginPrimary() { ; }
73-
virtual void PostTrack() { ; }
74-
virtual void PreTrack() { ; }
75-
virtual void BeginEvent() { ; }
76-
77-
virtual Bool_t IsSensitive(const std::string& name);
78-
virtual FairModule* CloneModule() const;
68+
void SetSpecialPhysicsCuts() override { ; }
69+
void EndOfEvent() override;
70+
void FinishPrimary() override { ; }
71+
void FinishRun() override { ; }
72+
void BeginPrimary() override { ; }
73+
void PostTrack() override { ; }
74+
void PreTrack() override { ; }
75+
void BeginEvent() override { ; }
76+
77+
Bool_t IsSensitive(const std::string& name) override;
78+
FairModule* CloneModule() const override;
7979

8080
private:
8181
/** Track information to be stored until the track leaves the
@@ -96,7 +96,7 @@ class Pixel : public FairDetector
9696
Pixel(const Pixel&);
9797
Pixel& operator=(const Pixel&);
9898

99-
ClassDef(Pixel, 1);
99+
ClassDefOverride(Pixel, 1);
100100
};
101101

102102
#endif // PIXEL_H

0 commit comments

Comments
 (0)