Logo ROOT   6.18/05
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
21class TClass;
22
23namespace ROOT {
24namespace Detail {
25
27protected:
28 static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName);
29
30public:
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
unsigned char UChar_t
Definition: RtypesCore.h:34
long long Long64_t
Definition: RtypesCore.h:69
void Info(const char *location, const char *msgfmt,...)
std::map< UChar_t, std::list< Info > > fRegister
! Register of bits seen so far.
Registry()
Default constructor. Implemented in source file to allow hiding of the Info struct.
bool Check(TClass &classRef, bool verbose=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in the class...
void RegisterBits(TClass &classRef)
Add to fRegister the Info about the bits in this class and its base classes.
~Registry()
Default destructor. Implemented in source file to allow hiding of the Info struct.
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...
static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName)
Figure out which bit the constant has been set from/to.
static bool CheckAllClasses(bool verbosity=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in any of th...
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21