Logo ROOT   6.12/07
Reference Guide
TDisplayItem.cxx
Go to the documentation of this file.
1 /// \file TDisplayItem.cxx
2 /// \ingroup Base ROOT7
3 /// \author Sergey Linev
4 /// \date 2017-05-31
5 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6 /// is welcome!
7 
8 /*************************************************************************
9  * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
10  * All rights reserved. *
11  * *
12  * For the licensing terms see $ROOTSYS/LICENSE. *
13  * For the list of contributors see $ROOTSYS/README/CREDITS. *
14  *************************************************************************/
15 
16 #include "ROOT/TDisplayItem.hxx"
17 
18 #include "TString.h"
19 
20 ROOT::Experimental::TDisplayItem::TDisplayItem() : fObjectID(), fOption(), fKind(0)
21 {
22 }
23 
25  : fObjectID(rhs.fObjectID), fOption(rhs.fOption), fKind(rhs.fKind)
26 {
27 }
28 
29 // pin vtable
31 {
32 }
33 
35 {
36  UInt_t hash = TString::Hash(&ptr, sizeof(ptr));
37  TString res = TString::UItoa(hash, 10);
38  return std::string(res.Data());
39 }
40 
42 {
43  std::string id = MakeIDFromPtr(ptr);
44  SetObjectID(id.c_str());
45 }
46 
47 // =================
48 
50 {
51  Clear();
52 }
53 
55 {
56  for (unsigned n = 0; n < fPrimitives.size(); ++n) delete fPrimitives[n];
57  fPrimitives.clear();
58 }
static TString UItoa(UInt_t value, Int_t base)
Converts a UInt_t (twice the range of an Int_t) to a TString with respect to the base specified (2-36...
Definition: TString.cxx:2106
Basic string class.
Definition: TString.h:125
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:616
unsigned int UInt_t
Definition: RtypesCore.h:42
void SetObjectID(const char *id)
static std::string MakeIDFromPtr(void *ptr)
Base class for painting data for JS.
const Int_t n
Definition: legend1.C:16
const char * Data() const
Definition: TString.h:345