Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
67d2d49
Remove never used enum (TRef::kNotComputed)
pcanal Aug 29, 2017
f7b63a2
Remove enum TClonesArray::kNoSplit not used since 2.26 (circa 2001)
pcanal Aug 29, 2017
e9c82a3
Update release notes
pcanal Aug 29, 2017
9a9d54f
Mark status bits as 'enum EStatusBits' in core, i/o, tree and hist.
pcanal Aug 29, 2017
4b8053e
Remove never used enum constant TLink::kObjIsParent
pcanal Aug 29, 2017
18c9cb5
Change value of TBranchObject::kWarn. Reset it upon reading.
pcanal Aug 29, 2017
8084146
Change value of TLeafObject::kWarn. Reset it upon reading.
pcanal Aug 29, 2017
20d96bb
Change value of TApplicationRemote::kCollecting.
pcanal Aug 29, 2017
1bc4ff7
Remove information duplication
pcanal Aug 29, 2017
87a10fc
Mark TObject::kObjInCanvas as deprecated
pcanal Aug 29, 2017
71f2c55
Add comments on status bits that are not available to TObject (even-t…
pcanal Aug 29, 2017
e2bf336
Update value of TClonesArray::kForgetBits.
pcanal Aug 30, 2017
67609c6
Introduce EStatusBitsDupExceptions in TStreamerElement and TVirtualSt…
pcanal Aug 30, 2017
f2ebec4
Introduce TStatusBitsChecker to avoid Status Bits overlap.
pcanal Aug 31, 2017
127c729
In ConvertToBit replace log2,nearbyint with std::frexp.
pcanal Aug 31, 2017
ae8a0ce
White spaces [NFC]
pcanal Aug 31, 2017
f2da26f
Typo [NFC]
pcanal Sep 1, 2017
3f043a6
Add TSystem::LoadAllLibs
pcanal Sep 1, 2017
28b43f6
Change value of TProofServ::kHighMemory and TVirtualProofPlayer::kIsS…
pcanal Sep 1, 2017
3fa653f
Add TStatusBitsChecker.cxx gtest
pcanal Sep 1, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README/ReleaseNotes/v610/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ The following interfaces have been removed, after deprecation in v6.08.
- `SetFCN(void*)` from TVirtualFitter, TFitter, TBackCompFitter, TMinuit
- `TFoam::SetRhoInt(void*)`

### Core

- The enum constant `TRef::kNotComputed`, `TLink::kObjIsParent` were never used and have been removed.
- The enum constant `TClonesArray::kNoSplit` has not been used since v2.26 and has been removed.

## Interpreter

- Automatic declaration of variables (`h = new TH1F(...)`) is *only* available at the prompt. The side-effects of relying on this in source files is simply too grave. Due to a bug (ROOT-8538), automatically declared variables must currently reside on the top-most scope, i.e. not inside an `if` block etc.
Expand Down
4 changes: 2 additions & 2 deletions core/base/inc/TApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class TApplication : public TObject, public TQObject {
public:
// TApplication specific bits
enum EStatusBits {
kProcessRemotely = BIT(15), // TRUE if this line has to be processed remotely
kDefaultApplication = BIT(16) // TRUE if created via CreateApplication()
kProcessRemotely = BIT(15), // TRUE if this line has to be processed remotely
kDefaultApplication = BIT(16) // TRUE if created via CreateApplication()
};
// TApplication specific bits for fFiles
enum EFileBits {
Expand Down
2 changes: 1 addition & 1 deletion core/base/inc/TBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TBrowser : public TNamed {
Bool_t fNeedRefresh; //True if the browser needs refresh

public:
enum {
enum EStatusBits {
kNoHidden = BIT(9) // don't show '.' files and directories
};

Expand Down
6 changes: 4 additions & 2 deletions core/base/inc/TBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ class TBuffer : public TObject {

public:
enum EMode { kRead = 0, kWrite = 1 };
enum { kIsOwner = BIT(16) }; //if set TBuffer owns fBuffer
enum { kCannotHandleMemberWiseStreaming = BIT(17)}; //if set TClonesArray should not use member wise streaming
enum EStatusBits {
kIsOwner = BIT(16), //if set TBuffer owns fBuffer
kCannotHandleMemberWiseStreaming = BIT(17) //if set TClonesArray should not use member wise streaming
};
enum { kInitialSize = 1024, kMinimalSize = 128 };

TBuffer(EMode mode);
Expand Down
9 changes: 8 additions & 1 deletion core/base/inc/TObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,22 @@ class TObject {
//----- any given hierarchy).
enum EStatusBits {
kCanDelete = BIT(0), ///< if object in a list can be deleted
// 2 is taken by TDataMember
kMustCleanup = BIT(3), ///< if object destructor must call RecursiveRemove()
kObjInCanvas = BIT(3), ///< for backward compatibility only, use kMustCleanup
kIsReferenced = BIT(4), ///< if object is referenced by a TRef or TRefArray
kHasUUID = BIT(5), ///< if object has a TUUID (its fUniqueID=UUIDNumber)
kCannotPick = BIT(6), ///< if object in a pad cannot be picked
// 7 is taken by TAxis.
kNoContextMenu = BIT(8), ///< if object does not want context menu
// 9, 10 are taken by TH1, TF1, TAxis and a few others
// 12 is taken by TAxis
kInvalidObject = BIT(13) ///< if object ctor succeeded but object should not be used
};

enum EDeprecatedStatusBits {
kObjInCanvas = BIT(3) ///< for backward compatibility only, use kMustCleanup
};

//----- Private bits, clients can only test but not change them
enum {
kIsOnHeap = 0x01000000, ///< object is on heap
Expand Down
2 changes: 0 additions & 2 deletions core/base/inc/TRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class TRef : public TObject {
static TObject *fgObject; //In: this, Out: pointer to object (used by Action on Demand)

public:
//status bits
enum { kNotComputed = BIT(12)};

TRef(): fPID(0) { }
TRef(TObject *obj);
Expand Down
1 change: 1 addition & 0 deletions core/base/inc/TSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ class TSystem : public TNamed {
virtual Func_t DynFindSymbol(const char *module, const char *entry);
virtual int Load(const char *module, const char *entry = "", Bool_t system = kFALSE);
virtual void Unload(const char *module);
virtual UInt_t LoadAllLibraries();
virtual void ListSymbols(const char *module, const char *re = "");
virtual void ListLibraries(const char *regexp = "");
virtual const char *GetLibraries(const char *regexp = "",
Expand Down
50 changes: 50 additions & 0 deletions core/base/src/TSystem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ allows a simple partial implementation for new OS'es.
#include "TVersionCheck.h"
#include "compiledata.h"
#include "RConfigure.h"
#include "THashList.h"

const char *gRootDir;
const char *gProgName;
Expand Down Expand Up @@ -1945,6 +1946,55 @@ int TSystem::Load(const char *module, const char *entry, Bool_t system)
return -1;
}

///////////////////////////////////////////////////////////////////////////////
/// Load all libraries known to ROOT via the rootmap system.
/// Returns the number of top level libraries successfully loaded.

UInt_t TSystem::LoadAllLibraries()
{
UInt_t nlibs = 0;

TEnv* mapfile = gInterpreter->GetMapfile();
if (!mapfile || !mapfile->GetTable()) return 0;

std::set<std::string> loadedlibs;
std::set<std::string> failedlibs;

TEnvRec* rec = 0;
TIter iEnvRec(mapfile->GetTable());
while ((rec = (TEnvRec*) iEnvRec())) {
TString libs = rec->GetValue();
TString lib;
Ssiz_t pos = 0;
while (libs.Tokenize(lib, pos)) {
// check that none of the libs failed to load
if (failedlibs.find(lib.Data()) != failedlibs.end()) {
// don't load it or any of its dependencies
libs = "";
break;
}
}
pos = 0;
while (libs.Tokenize(lib, pos)) {
// ignore libCore - it's already loaded
if (lib.BeginsWith("libCore"))
continue;

if (loadedlibs.find(lib.Data()) == loadedlibs.end()) {
// just load the first library - TSystem will do the rest.
auto res = gSystem->Load(lib);
if (res >=0) {
if (res == 0) ++nlibs;
loadedlibs.insert(lib.Data());
} else {
failedlibs.insert(lib.Data());
}
}
}
}
return nlibs;
}

////////////////////////////////////////////////////////////////////////////////
/// Find a dynamic library called lib using the system search paths.
/// Appends known extensions if needed. Returned string must be deleted
Expand Down
7 changes: 3 additions & 4 deletions core/cont/inc/TClonesArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ class TClonesArray : public TObjArray {
TObjArray *fKeep; //!Saved copies of pointers to objects

public:
enum {
kForgetBits = BIT(0), // Do not create branches for fBits, fUniqueID
kNoSplit = BIT(1), // Array not split by TTree::Branch
kBypassStreamer = BIT(12) // Class Streamer not called (default)
enum EStatusBits {
kBypassStreamer = BIT(12), // Class Streamer not called (default)
kForgetBits = BIT(15) // Do not create branches for fBits, fUniqueID
};

TClonesArray();
Expand Down
2 changes: 1 addition & 1 deletion core/cont/inc/TCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class TCollection : public TObject {
void operator=(const TCollection &); //are too complex to be automatically copied

protected:
enum { kIsOwner = BIT(14) };
enum EStatusBits { kIsOwner = BIT(14) };

TString fName; //name of the collection
Int_t fSize; //number of elements in collection
Expand Down
2 changes: 1 addition & 1 deletion core/cont/inc/TMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ friend class TMapIter;
TMap& operator=(const TMap& map); // not implemented

protected:
enum { kIsOwnerValue = BIT(15) };
enum EStatusBits { kIsOwnerValue = BIT(15) };

virtual void PrintCollectionEntry(TObject* entry, Option_t* option, Int_t recurse) const;

Expand Down
2 changes: 1 addition & 1 deletion core/cont/inc/TRefTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class TRefTable : public TObject {

public:

enum {
enum EStatusBits {
kHaveWarnedReadingOld = BIT(14)
};

Expand Down
3 changes: 3 additions & 0 deletions core/meta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ ROOT_OBJECT_LIBRARY(Meta ${sources})

ROOT_INSTALL_HEADERS()

if(testing)
add_subdirectory(test)
endif()
1 change: 1 addition & 0 deletions core/meta/inc/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
#pragma link C++ class TListOfEnums+;
#pragma link C++ class TListOfEnumsWithLock+;
#pragma link C++ class TListOfEnumsWithLockIter;
#pragma link C++ class ROOT::Detail::TStatusBitsChecker-;
//for new protoclasses
#pragma link C++ class std::vector<TDataMember * >+;
#pragma link C++ class std::vector<TProtoClass::TProtoRealData >+;
Expand Down
22 changes: 12 additions & 10 deletions core/meta/inc/TClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,18 @@ friend class TProtoClass;

public:
// TClass status bits
enum { kClassSaved = BIT(12), kIgnoreTObjectStreamer = BIT(15),
kUnloaded = BIT(16), // The library containing the dictionary for this class was
// loaded and has been unloaded from memory.
kIsTObject = BIT(17),
kIsForeign = BIT(18),
kIsEmulation = BIT(19), // Deprecated
kStartWithTObject = BIT(20), // see comments for IsStartingWithTObject()
kWarned = BIT(21),
kHasNameMapNode = BIT(22),
kHasCustomStreamerMember = BIT(23) // The class has a Streamer method and it is implemented by the user or an older (not StreamerInfo based) automatic streamer.
enum EStatusBits {
kClassSaved = BIT(12),
kIgnoreTObjectStreamer = BIT(15),
kUnloaded = BIT(16), // The library containing the dictionary for this class was
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you're touching this anyway, can you use pre-member doxygen doc like so:

/// The library containing the dictionary for this class was
/// loaded and has been unloaded from memory.
kUnloaded    = BIT(16),

This makes it easier to read and write precise documentation and enables doxygen to actually pick it up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The annoying part is that (visually at the very least), unless there is a empy line above the comment, I never 'know' whether the comment applies to the one before or after.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we're paid by lines of code, so adding empty lines is a wonderful thing! ;-)

// loaded and has been unloaded from memory.
kIsTObject = BIT(17),
kIsForeign = BIT(18),
kIsEmulation = BIT(19), // Deprecated
kStartWithTObject = BIT(20), // see comments for IsStartingWithTObject()
kWarned = BIT(21),
kHasNameMapNode = BIT(22),
kHasCustomStreamerMember = BIT(23) // The class has a Streamer method and it is implemented by the user or an older (not StreamerInfo based) automatic streamer.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

};
enum ENewType { kRealNew = 0, kClassNew, kDummyNew };
enum ECheckSum {
Expand Down
4 changes: 3 additions & 1 deletion core/meta/inc/TDataMember.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class TMethodCall;
class TDataMember : public TDictionary {

private:
enum { kObjIsPersistent = BIT(2) };
enum EStatusBits {
kObjIsPersistent = BIT(2)
};

DataMemberInfo_t *fInfo; //!pointer to CINT data member info
TClass *fClass; //!pointer to the class
Expand Down
2 changes: 1 addition & 1 deletion core/meta/inc/TProtoClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TProtoClass: public TNamed {
Int_t fClassIndex; // index of class belonging to in list of dep classes
char fStatusFlag; // status of the real data member (if bit 0 set is an object, if bit 1 set is transient if bit 2 set is a pointer)

enum {
enum EStatusFlags {
kIsObject = BIT(0), // member is object
kIsTransient = BIT(1), // data member is transient
kIsPointer = BIT(2), // data member is a pointer
Expand Down
2 changes: 1 addition & 1 deletion core/meta/inc/TRealData.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TRealData : public TObject {
TRealData& operator=(const TRealData& rhs); // Copying TRealData in not allowed.

public:
enum {
enum EStatusBits {
kTransient = BIT(14) // The member is transient.
};

Expand Down
55 changes: 55 additions & 0 deletions core/meta/inc/TStatusBitsChecker.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// @(#)root/meta:$Id$
// Author: Philippe Canal, 2017

/*************************************************************************
* Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

#ifndef ROOT_TStatusBitsChecker
#define ROOT_TStatusBitsChecker

#include <string>
#include <map>
#include <list>

#include "Rtypes.h"

class TClass;

namespace ROOT {
namespace Detail {

class TStatusBitsChecker {
protected:
static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName);

public:
class Registry {
protected:
struct Info;

std::map<UChar_t, std::list<Info>> fRegister; ///<! Register of bits seen so far.

public:

void RegisterBits(TClass &classRef);

bool Check(TClass &classRef, bool verbose = false);

Registry(); // Implemented in source file to allow hiding of the Info struct.
~Registry(); // Implemented in source file to allow hiding of the Info struct.
};

static bool Check(TClass &classRef, bool verbose = false);
static bool Check(const char *classname, bool verbose = false);
static bool CheckAllClasses(bool verbosity = false);
};

} // Details
} // ROOT

#endif // ROOT__TStatusBitsChecker
19 changes: 17 additions & 2 deletions core/meta/inc/TStreamerElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class TStreamerElement : public TNamed {
kSTLbitset = ROOT::kSTLbitset
};
// TStreamerElement status bits
enum {
enum EStatusBits {
kHasRange = BIT(6),
kCache = BIT(9),
kRepeat = BIT(10),
Expand All @@ -83,6 +83,21 @@ class TStreamerElement : public TNamed {
kWholeObject = BIT(14)
};

enum class EStatusBitsDupExceptions {
// This bit duplicates TObject::kInvalidObject. As the semantic of kDoNotDelete is a persistent,
// we can not change its value without breaking forward compatibility.
// Furthermore, TObject::kInvalidObject and its semantic is not (and should not be)
// used in TStreamerElement
kDoNotDelete = TStreamerElement::kDoNotDelete,

// This bit duplicates TObject::kCannotPick. As the semantic of kHasRange is a persistent,
// we can not change its value without breaking forward compatibility.
// Furthermore, TObject::kCannotPick and its semantic is not (and should not be)
// used in TStreamerElement
kHasRange = TStreamerElement::kHasRange
};


TStreamerElement();
TStreamerElement(const char *name, const char *title, Int_t offset, Int_t dtype, const char *typeName);
virtual ~TStreamerElement();
Expand Down Expand Up @@ -374,7 +389,7 @@ class TStreamerString : public TStreamerElement {
//________________________________________________________________________
class TStreamerSTL : public TStreamerElement {

enum {
enum EStatusBits {
kWarned = BIT(21)
};

Expand Down
23 changes: 16 additions & 7 deletions core/meta/inc/TVirtualStreamerInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,22 @@ class TVirtualStreamerInfo : public TNamed {
public:

//status bits
enum { kCannotOptimize = BIT(12),
kIgnoreTObjectStreamer = BIT(13), // eventhough BIT(13) is taken up by TObject (to preserve forward compatibility)
kRecovered = BIT(14),
kNeedCheck = BIT(15),
kIsCompiled = BIT(16),
kBuildOldUsed = BIT(17),
kBuildRunning = BIT(18)
enum EStatusBits {
kCannotOptimize = BIT(12),
kIgnoreTObjectStreamer = BIT(13), // eventhough BIT(13) is taken up by TObject (to preserve forward compatibility)
kRecovered = BIT(14),
kNeedCheck = BIT(15),
kIsCompiled = BIT(16),
kBuildOldUsed = BIT(17),
kBuildRunning = BIT(18)
};

enum class EStatusBitsDupExceptions {
// This bit duplicates TObject::kInvalidObject. As the semantic of kIgnoreTObjectStreamer is a persistent,
// we can not change its value without breaking forward compatibility.
// Furthermore, TObject::kInvalidObject and its semantic is not (and should not be)
// used in TVirtualStreamerInfo
kIgnoreTObjectStreamer = TVirtualStreamerInfo::kIgnoreTObjectStreamer,
};

enum EReadWrite {
Expand Down
Loading