Logo ROOT  
Reference Guide
RDisplayItem.cxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
10
11#include "ROOT/RDrawable.hxx"
12
13#include "TString.h"
14
15////////////////////////////////////////////////////////////////////////////
16/// Assign id using arbitrary pointer value
17/// Typically drawable pointer should be used here
18
20{
22}
23
24void ROOT::Experimental::RDisplayItem::BuildFullId(const std::string &prefix)
25{
26 SetObjectID(prefix + std::to_string(GetIndex()) + "_" + GetObjectID());
27}
28
30{
31 auto hash = TString::Hash(&ptr, sizeof(ptr));
32 return std::to_string(hash);
33}
void SetObjectID(const std::string &id)
static std::string ObjectIDFromPtr(const void *ptr)
void SetObjectIDAsPtr(const void *ptr)
Assign id using arbitrary pointer value Typically drawable pointer should be used here.
virtual void BuildFullId(const std::string &prefix)
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:638