Logo ROOT  
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 <map>
16 #include <list>
17 
18 #include "RtypesCore.h"
19 
20 class TClass;
21 
22 namespace ROOT {
23 namespace Detail {
24 
26 protected:
27  static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName);
28 
29 public:
30  class Registry {
31  protected:
32  struct Info;
33 
34  std::map<UChar_t, std::list<Info>> fRegister; ///<! Register of bits seen so far.
35 
36  public:
37 
38  void RegisterBits(TClass &classRef);
39 
40  bool Check(TClass &classRef, bool verbose = false);
41 
42  Registry(); // Implemented in source file to allow hiding of the Info struct.
43  ~Registry(); // Implemented in source file to allow hiding of the Info struct.
44  };
45 
46  static bool Check(TClass &classRef, bool verbose = false);
47  static bool Check(const char *classname, bool verbose = false);
48  static bool CheckAllClasses(bool verbosity = false);
49 };
50 
51 } // Details
52 } // ROOT
53 
54 #endif // ROOT__TStatusBitsChecker
ROOT::Detail::TStatusBitsChecker::ConvertToBit
static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName)
Figure out which bit the constant has been set from/to.
Definition: TStatusBitsChecker.cxx:100
ROOT::Detail::TStatusBitsChecker::Check
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...
Definition: TStatusBitsChecker.cxx:225
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
ROOT::Detail::TStatusBitsChecker
Definition: TStatusBitsChecker.h:25
ROOT::Detail::TStatusBitsChecker::Registry::~Registry
~Registry()
Default destructor. Implemented in source file to allow hiding of the Info struct.
ROOT::Detail::TStatusBitsChecker::Registry::Registry
Registry()
Default constructor. Implemented in source file to allow hiding of the Info struct.
ROOT::Detail::TStatusBitsChecker::Registry
Definition: TStatusBitsChecker.h:30
ROOT::Detail::TStatusBitsChecker::Registry::Check
bool Check(TClass &classRef, bool verbose=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in the class...
Definition: TStatusBitsChecker.cxx:182
ROOT::Detail::TStatusBitsChecker::Registry::RegisterBits
void RegisterBits(TClass &classRef)
Add to fRegister the Info about the bits in this class and its base classes.
Definition: TStatusBitsChecker.cxx:136
ROOT::Detail::TStatusBitsChecker::Registry::fRegister
std::map< UChar_t, std::list< Info > > fRegister
! Register of bits seen so far.
Definition: TStatusBitsChecker.h:32
RtypesCore.h
Info
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition: TError.cxx:221
TClass
Definition: TClass.h:80
UChar_t
unsigned char UChar_t
Definition: RtypesCore.h:38
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Detail::TStatusBitsChecker::CheckAllClasses
static bool CheckAllClasses(bool verbosity=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in any of th...
Definition: TStatusBitsChecker.cxx:248