Skip to content

Commit c2ec1cb

Browse files
committed
Use override syntax in meta classes
1 parent 9d8fdee commit c2ec1cb

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

core/meta/inc/TClass.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -381,18 +381,18 @@ friend class TStreamerInfo;
381381
static Int_t ReadRules(const char *filename);
382382
static Int_t ReadRules();
383383
void AdoptSchemaRules( ROOT::Detail::TSchemaRuleSet *rules );
384-
virtual void Browse(TBrowser *b);
384+
void Browse(TBrowser *b) override;
385385
void BuildRealData(void *pointer=0, Bool_t isTransient = kFALSE);
386386
void BuildEmulatedRealData(const char *name, Longptr_t offset, TClass *cl, Bool_t isTransient = kFALSE);
387387
void CalculateStreamerOffset() const;
388388
Bool_t CallShowMembers(const void* obj, TMemberInspector &insp, Bool_t isTransient = kFALSE) const;
389389
Bool_t CanSplit() const;
390390
Bool_t CanIgnoreTObjectStreamer() { return TestBit(kIgnoreTObjectStreamer);}
391391
Long_t ClassProperty() const;
392-
TObject *Clone(const char *newname="") const;
392+
TObject *Clone(const char *newname="") const override;
393393
void CopyCollectionProxy(const TVirtualCollectionProxy&);
394-
void Draw(Option_t *option="");
395-
void Dump() const { TDictionary::Dump(); }
394+
void Draw(Option_t *option="") override;
395+
void Dump() const override { TDictionary::Dump(); }
396396
void Dump(const void *obj, Bool_t noAddr = kFALSE) const;
397397
char *EscapeChars(const char *text) const;
398398
TVirtualStreamerInfo *FindStreamerInfo(UInt_t checksum, Bool_t isTransient = kFALSE) const;
@@ -503,21 +503,21 @@ friend class TStreamerInfo;
503503
}
504504
Bool_t HasDictionary() const;
505505
static Bool_t HasDictionarySelection(const char* clname);
506-
Bool_t HasLocalHashMember() const;
506+
Bool_t HasLocalHashMember() const;
507507
void GetMissingDictionaries(THashTable& result, bool recurse = false);
508508
void IgnoreTObjectStreamer(Bool_t ignore=kTRUE);
509-
Bool_t InheritsFrom(const char *cl) const;
510-
Bool_t InheritsFrom(const TClass *cl) const;
509+
Bool_t InheritsFrom(const char *cl) const override;
510+
Bool_t InheritsFrom(const TClass *cl) const override;
511511
void InterpretedShowMembers(void* obj, TMemberInspector &insp, Bool_t isTransient);
512-
Bool_t IsFolder() const { return kTRUE; }
512+
Bool_t IsFolder() const override { return kTRUE; }
513513
Bool_t IsLoaded() const;
514514
Bool_t IsForeign() const;
515515
Bool_t IsStartingWithTObject() const;
516516
Bool_t IsSyntheticPair() const { return fIsSyntheticPair; }
517517
Bool_t IsVersioned() const { return !( GetClassVersion()<=1 && IsForeign() ); }
518518
Bool_t IsTObject() const;
519519
static TClass *LoadClass(const char *requestedname, Bool_t silent);
520-
void ls(Option_t *opt="") const;
520+
void ls(Option_t *opt="") const override;
521521
void MakeCustomMenuList();
522522
Bool_t MatchLegacyCheckSum(UInt_t checksum) const;
523523
void Move(void *arenaFrom, void *arenaTo) const;
@@ -530,7 +530,7 @@ friend class TStreamerInfo;
530530
ObjectPtr NewObjectArray(Long_t nElements, ENewType defConstructor = kClassNew) const;
531531
ObjectPtr NewObjectArray(Long_t nElements, void *arena, ENewType defConstructor = kClassNew) const;
532532
virtual void PostLoadCheck();
533-
Long_t Property() const;
533+
Long_t Property() const override;
534534
Int_t ReadBuffer(TBuffer &b, void *pointer, Int_t version, UInt_t start, UInt_t count);
535535
Int_t ReadBuffer(TBuffer &b, void *pointer);
536536
void RegisterStreamerInfo(TVirtualStreamerInfo *info);
@@ -610,7 +610,7 @@ friend class TStreamerInfo;
610610
#endif
611611
}
612612

613-
ClassDef(TClass,0) //Dictionary containing class information
613+
ClassDefOverride(TClass,0) //Dictionary containing class information
614614
};
615615

616616
namespace ROOT {

core/meta/inc/TDataMember.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ class TDataMember : public TDictionary {
9191
Bool_t IsPersistent() const { return TestBit(kObjIsPersistent); }
9292
Int_t IsSTLContainer();
9393
Bool_t IsValid();
94-
Long_t Property() const;
94+
Long_t Property() const override;
9595
void SetClass(TClass* cl) { fClass = cl; }
9696
virtual bool Update(DataMemberInfo_t *info);
9797

98-
ClassDef(TDataMember,2) //Dictionary for a class data member
98+
ClassDefOverride(TDataMember,2) //Dictionary for a class data member
9999
};
100100

101101

@@ -112,12 +112,12 @@ class TOptionListItem : public TObject {
112112
TString fOptName; //Text assigned to option which appears in option menu
113113
TString fOptLabel; //Text (or enum) value assigned to option.
114114
TOptionListItem():
115-
fDataMember(0), fValue(0), fValueMaskBit(0), fToggleMaskBit(0)
115+
fDataMember(nullptr), fValue(0), fValueMaskBit(0), fToggleMaskBit(0)
116116
{}
117117
TOptionListItem(TDataMember *m,Long_t val, Long_t valmask, Long_t tglmask,
118118
const char *name, const char *label);
119119

120-
ClassDef(TOptionListItem,2); //Element in the list of options.
120+
ClassDefOverride(TOptionListItem,2); //Element in the list of options.
121121
};
122122

123123
#endif

core/meta/inc/TDataType.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,22 @@ class TDataType : public TDictionary {
6161
TDataType& operator=(const TDataType&);
6262

6363
public:
64-
TDataType(TypedefInfo_t *info = 0);
64+
TDataType(TypedefInfo_t *info = nullptr);
6565
TDataType(const char *typenam);
6666
virtual ~TDataType();
6767
Int_t Size() const;
6868
Int_t GetType() const { return (Int_t)fType; }
6969
TString GetTypeName();
7070
const char *GetFullTypeName() const;
7171
const char *AsString(void *buf) const;
72-
Long_t Property() const;
72+
Long_t Property() const override;
7373

7474
static const char *GetTypeName(EDataType type);
7575
static TDataType *GetDataType(EDataType type);
7676
static EDataType GetType(const std::type_info &typeinfo);
7777
static void AddBuiltins(TCollection* types);
7878

79-
ClassDef(TDataType,2) //Basic data type descriptor
79+
ClassDefOverride(TDataType,2) //Basic data type descriptor
8080
};
8181

8282
#endif

core/meta/inc/TDictAttributeMap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ class TDictAttributeMap : public TObject
3939
Int_t GetPropertySize() const { return fStringProperty.GetSize(); }
4040
TString RemovePropertyString(const char* key);
4141
Bool_t RemoveProperty(const char* key);
42-
void Clear(Option_t* option = "");
42+
void Clear(Option_t* option = "") override;
4343

4444
private:
4545

4646
THashTable fStringProperty; //all properties of String type
4747

48-
ClassDef(TDictAttributeMap,2) // Container for name/value pairs of TDictionary attributes
48+
ClassDefOverride(TDictAttributeMap,2) // Container for name/value pairs of TDictionary attributes
4949
};
5050

5151
#endif // ROOT_TDictAttributeMap

core/meta/inc/TDictionary.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class TDictionary : public TNamed {
221221
static bool WantsUsingDecls(EMemberSelection sel) { return sel != EMemberSelection::kNoUsingDecls; }
222222

223223
typedef const void *DeclId_t;
224-
ClassDef(TDictionary,2) //Interface to dictionary
224+
ClassDefOverride(TDictionary,2) //Interface to dictionary
225225
};
226226

227227
#endif

core/meta/inc/TInterpreter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct InterpreterMutexRegistrationRAII {
6464
class TInterpreter : public TNamed {
6565

6666
protected:
67-
virtual void Execute(TMethod *method, TObjArray *params, int *error = 0) = 0;
67+
void Execute(TMethod *method, TObjArray *params, int *error = nullptr) override = 0;
6868
virtual Bool_t SetSuspendAutoParsing(Bool_t value) = 0;
6969

7070
friend class SuspendAutoParsing;
@@ -233,7 +233,7 @@ class TInterpreter : public TNamed {
233233
virtual void GetInterpreterTypeName(const char *name, std::string &output, Bool_t full = kFALSE) = 0;
234234
virtual void *GetInterfaceMethod(TClass *cl, const char *method, const char *params, Bool_t objectIsConst = kFALSE) = 0;
235235
virtual void *GetInterfaceMethodWithPrototype(TClass *cl, const char *method, const char *proto, Bool_t objectIsConst = kFALSE, ROOT::EFunctionMatchMode /* mode */ = ROOT::kConversionMatch) = 0;
236-
virtual void Execute(const char *function, const char *params, int *error = 0) = 0;
236+
void Execute(const char *function, const char *params, int *error = 0) override = 0;
237237
virtual void Execute(TObject *obj, TClass *cl, const char *method, const char *params, int *error = 0) = 0;
238238
virtual void Execute(TObject *obj, TClass *cl, TMethod *method, TObjArray *params, int *error = 0) = 0;
239239
virtual void ExecuteWithArgsAndReturn(TMethod *method, void* address, const void* args[] = 0, int /*nargs*/ = 0, void* ret= 0) const = 0;
@@ -553,7 +553,7 @@ class TInterpreter : public TNamed {
553553

554554
static TInterpreter *Instance();
555555

556-
ClassDef(TInterpreter,0) //ABC defining interface to generic interpreter
556+
ClassDefOverride(TInterpreter,0) //ABC defining interface to generic interpreter
557557
};
558558

559559

core/meta/inc/TIsAProxy.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ class TIsAProxy : public TVirtualIsAProxy {
5757
// Standard destructor
5858
virtual ~TIsAProxy();
5959
// Callbacl to set the class
60-
virtual void SetClass(TClass *cl);
60+
void SetClass(TClass *cl) override;
6161
// IsA callback
62-
virtual TClass* operator()(const void *obj);
62+
TClass* operator()(const void *obj) override;
6363
};
6464

6565
//////////////////////////////////////////////////////////////////////////
@@ -85,10 +85,10 @@ template <class T> class TInstrumentedIsAProxy : public TVirtualIsAProxy {
8585
// Standard destructor
8686
virtual ~TInstrumentedIsAProxy() {}
8787
// Callbacl to set the class
88-
virtual void SetClass(TClass *cl) { fClass = cl; }
88+
virtual void SetClass(TClass *cl) override { fClass = cl; }
8989
// IsA callback
90-
virtual TClass* operator()(const void *obj) {
91-
return obj==0 ? fClass : ((const T*)obj)->IsA();
90+
TClass* operator()(const void *obj) override {
91+
return !obj ? fClass : ((const T*)obj)->IsA();
9292
}
9393
};
9494

0 commit comments

Comments
 (0)