Logo ROOT   6.12/06
Reference Guide
TStatusBitsChecker.h
Go to the documentation of this file.
1 // @(#)root/meta:$Id$
2 // Author: Philippe Canal, 2017
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TStatusBitsChecker
13 #define ROOT_TStatusBitsChecker
14 
15 #include <string>
16 #include <map>
17 #include <list>
18 
19 #include "Rtypes.h"
20 
21 class TClass;
22 
23 namespace ROOT {
24 namespace Detail {
25 
27 protected:
28  static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName);
29 
30 public:
31  class Registry {
32  protected:
33  struct Info;
34 
35  std::map<UChar_t, std::list<Info>> fRegister; ///<! Register of bits seen so far.
36 
37  public:
38 
39  void RegisterBits(TClass &classRef);
40 
41  bool Check(TClass &classRef, bool verbose = false);
42 
43  Registry(); // Implemented in source file to allow hiding of the Info struct.
44  ~Registry(); // Implemented in source file to allow hiding of the Info struct.
45  };
46 
47  static bool Check(TClass &classRef, bool verbose = false);
48  static bool Check(const char *classname, bool verbose = false);
49  static bool CheckAllClasses(bool verbosity = false);
50 };
51 
52 } // Details
53 } // ROOT
54 
55 #endif // ROOT__TStatusBitsChecker
long long Long64_t
Definition: RtypesCore.h:69
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
void RegisterBits(TClass &classRef)
Add to fRegister the Info about the bits in this class and its base classes.
static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName)
Figure out which bit the constant has been set from/to.
~Registry()
Default destructor. Implemented in source file to allow hiding of the Info struct.
void Info(const char *location, const char *msgfmt,...)
static bool CheckAllClasses(bool verbosity=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in any of th...
bool Check(TClass &classRef, bool verbose=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in the class...
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:75
static bool Check(TClass &classRef, bool verbose=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in the class...
Registry()
Default constructor. Implemented in source file to allow hiding of the Info struct.
std::map< UChar_t, std::list< Info > > fRegister
! Register of bits seen so far.
unsigned char UChar_t
Definition: RtypesCore.h:34