38 if (!dtTypeName.
EndsWith(
"*"))
return 0;
48 Ssiz_t GetNumSet()
const {
return fNumSet; }
61 fDMInfo(dmInfo), fOutputList(
output), fNumSet(0), fOwner(owner)
73void TSetSelDataMembers::Inspect(
TClass *cl,
const char* parent,
const char *
name,
const void *addr,
Bool_t )
80 PDB(kOutput,1) fOwner.
Info("SetDataMembers()",
81 "
data member `%s%s::%s' maps to
output list
object `%s'",
82 cl->GetName(), parent,
name, mapping->GetTitle());
84 TObject* outputObj = fOutputList->FindObject(mapping->GetTitle());
86 PDB(kOutput,1) fOwner.
Warning("SetDataMembers()",
87 "
object `%s' not found in
output list!",
94 TClass* cldt = IsSettableDataMember(dm);
96 PDB(kOutput,1) fOwner.
Warning("SetDataMembers()",
97 "unusable
data member `%s' should have been detected by TCollectDataMembers!",
102 char *pointer = (
char*)addr;
103 char **ppointer = (
char**)(pointer);
106 fOwner.
Warning(
"SetDataMembers()",
"potential memory leak: replacing data member `%s' != 0. "
107 "Please initialize %s to 0 in constructor %s::%s()",
110 *ppointer = (
char*)outputObj;
119 ~TCollectDataMembers()
override;
122 TExMap& GetMemberPointers() {
return fMap; }
138void TCollectDataMembers::Inspect(
TClass *cl,
const char* ,
const char *
name,
const void *addr,
Bool_t )
141 if (!IsSettableDataMember(dm))
return;
143 char *pointer = (
char*)addr;
144 char **ppointer = (
char**)(pointer);
145 char **p3pointer = (
char**)(*ppointer);
153 fMap.Remove((
Long64_t)(ptrdiff_t)p3pointer);
166 PDB(kOutput,1) fOwner.
Info("Init()", "considering
data member `%s'",
name);
170TCollectDataMembers::~TCollectDataMembers() {
177 while (iMembers.Next(key,
value)) {
201 return "PROOF_TOutputListSelectorDataMap_object";
210 PDB(kOutput,1)
Warning(
"Init",
"Leave (no selector!)");
215 PDB(kOutput,1)
Info(
"Init()",
"Leave (no output)");
221 PDB(kOutput,1)
Warning(
"Init",
"Mapping already exists!");
229 TCollectDataMembers cdm(*
this);
230 if (!
sel->IsA()->CallShowMembers(
sel, cdm)) {
232 PDB(kOutput,1)
Warning(
"Init",
"Failed to determine mapping!");
235 PDB(kOutput,1)
Info(
"Init()",
"Found %d data members.",
236 cdm.GetMemberPointers().GetSize());
240 TIter iOutput(outList);
243 while ((
output = iOutput())) {
252 addAllDM = (
TList*) obj;
258 PDB(kOutput,1)
Info(
"Init()",
"Data member `%s' corresponds to output `%s'",
278 PDB(kOutput,1)
Info(
"SetDataMembers()",
"%s, set %d data members.",
279 (res ?
"success" :
"failure"), ssdm.GetNumSet());
290 if (!other)
return kFALSE;
295 while ((mapping = (
TNamed*)iMapping())) {
304 "contradicting mapping for data member `%s' (output list entry `%s' vs. `%s'). "
305 "Cancelling automatic TSelector data member setting!",
323 while ((out = iOutput())) {
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
TClass instances represent classes, structs and namespaces in the ROOT type system.
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Collection abstract base class.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual void Add(TObject *obj)=0
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
void Clear(Option_t *option="") override=0
All ROOT classes may have RTTI (run time type identification) support added.
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
Bool_t IsaPointer() const
Return true if data member is a pointer.
const char * GetFullTypeName() const
Get the concrete type name of this data member, including const and volatile qualifiers.
This class stores a (key,value) pair using an external hash.
THashTable implements a hash table to store TObject's.
void Clear(Option_t *option="") override
Remove all objects from the list.
void Add(TObject *obj) override
Abstract base class for accessing the data-members of a class.
virtual void Inspect(TClass *cl, const char *parent, const char *name, const void *addr)
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual const char * GetTitle() const
Returns title of object.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Set the selector's data members to the corresponding elements of the output list.
Bool_t Merge(TObject *obj)
Merge another TOutputListSelectorDataMap object, check consistency.
static TOutputListSelectorDataMap * FindInList(TCollection *coll)
Find a TOutputListSelectorDataMap in a collection.
TOutputListSelectorDataMap(TSelector *sel=0)
Create a mapper between output list items and TSelector data members.
Bool_t SetDataMembers(TSelector *sel) const
Given an output list, set the data members of a TSelector.
TCollection * GetMap() const
const char * GetName() const override
Return static name for TOutputListSelectorDataMap objects.
Bool_t Init(TSelector *sel)
Initialize the data member <-> output list mapping from a selector.
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TString & Remove(Ssiz_t pos)