Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
20class TClass;
21
22namespace ROOT {
23namespace Detail {
24
26protected:
27 static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName);
28
29public:
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
unsigned char UChar_t
Definition RtypesCore.h:38
long long Long64_t
Definition RtypesCore.h:80
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:81
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...