39 if (!dtTypeName.
EndsWith(
"*"))
return 0;
49 Ssiz_t GetNumSet()
const {
return fNumSet; }
62 fDMInfo(dmInfo), fOutputList(output), fNumSet(0), fOwner(owner)
74 void TSetSelDataMembers::Inspect(
TClass *cl,
const char* parent,
const char *
name,
const void *addr,
Bool_t )
76 while (name[0] ==
'*') ++
name;
81 PDB(kOutput,1) fOwner.
Info("SetDataMembers()",
82 "
data member `%s%s::%s' maps to
output list
object `%s'",
87 PDB(kOutput,1) fOwner.
Warning("SetDataMembers()",
88 "
object `%s' not found in
output list!",
95 TClass* cldt = IsSettableDataMember(dm);
97 PDB(kOutput,1) fOwner.
Warning("SetDataMembers()",
98 "unusable
data member `%s' should have been detected by TCollectDataMembers!",
103 char *pointer = (
char*)addr;
104 char **ppointer = (
char**)(pointer);
107 fOwner.Warning(
"SetDataMembers()",
"potential memory leak: replacing data member `%s' != 0. " 108 "Please initialize %s to 0 in constructor %s::%s()",
111 *ppointer = (
char*)outputObj;
120 ~TCollectDataMembers();
122 void Inspect(
TClass *cl,
const char *parent,
const char *name,
const void *addr,
Bool_t isTransient);
123 TExMap& GetMemberPointers() {
return fMap; }
139 void TCollectDataMembers::Inspect(
TClass *cl,
const char* ,
const char *name,
const void *addr,
Bool_t )
142 if (!IsSettableDataMember(dm))
return;
144 char *pointer = (
char*)addr;
145 char **ppointer = (
char**)(pointer);
146 char **p3pointer = (
char**)(*ppointer);
154 fMap.Remove((
Long64_t)(ptrdiff_t)p3pointer);
166 if (name[0] ==
'*') ++
name;
167 PDB(kOutput,1) fOwner.
Info("
Init()", "considering
data member `%s'", name);
171 TCollectDataMembers::~TCollectDataMembers() {
178 while (iMembers.Next(key, value)) {
202 return "PROOF_TOutputListSelectorDataMap_object";
211 PDB(kOutput,1)
Warning(
"Init",
"Leave (no selector!)");
216 PDB(kOutput,1)
Info(
"Init()",
"Leave (no output)");
222 PDB(kOutput,1)
Warning(
"Init",
"Mapping already exists!");
230 TCollectDataMembers cdm(*
this);
241 Error(
"Init",
"failed to get TSelectorCint interpreted class!");
246 PDB(kOutput,1)
Warning(
"Init",
"Failed to determine mapping!");
249 PDB(kOutput,1)
Info(
"Init()",
"Found %d data members.",
250 cdm.GetMemberPointers().GetSize());
254 TIter iOutput(outList);
257 while ((output = iOutput())) {
266 addAllDM = (
TList*) obj;
272 PDB(kOutput,1)
Info(
"Init()",
"Data member `%s' corresponds to output `%s'",
273 dm->
GetName(), output->GetName());
291 TSetSelDataMembers ssdm(*
this,
fMap, output);
303 Error(
"Init",
"failed to get TSelectorCint interpreted class!");
308 PDB(kOutput,1)
Info(
"SetDataMembers()",
"%s, set %d data members.",
309 (res ?
"success" :
"failure"), ssdm.GetNumSet());
311 PDB(kOutput,1)
Warning(
"SetDataMembers",
"Failed to determine selector TClass!");
323 if (!other)
return kFALSE;
328 while ((mapping = (
TNamed*)iMapping())) {
333 if (strcmp(oldMap->
GetTitle(), mapping->GetTitle())) {
337 "contradicting mapping for data member `%s' (output list entry `%s' vs. `%s'). " 338 "Cancelling automatic TSelector data member setting!",
339 mapping->GetName(), oldMap->
GetTitle(), mapping->GetTitle());
356 while ((out = iOutput())) {
virtual const char * GetName() const
Returns name of object.
virtual void Clear(Option_t *option="")=0
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual TClass * GetInterpretedClass() const
Retrieve the TClass object for the interpreted class.
const char * GetFullTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
All ROOT classes may have RTTI (run time type identification) support added.
TOutputListSelectorDataMap(TSelector *sel=0)
Create a mapper between output list items and TSelector data members.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual TSelector * GetInterpretedSelector() const
Bool_t Merge(TObject *obj)
Merge another TOutputListSelectorDataMap object, check consistency.
Abstract base class for accessing the data-members of a class.
TCollection * GetMap() const
Bool_t Init(TSelector *sel)
Initialize the data member <-> output list mapping from a selector.
static TOutputListSelectorDataMap * FindInList(TCollection *coll)
Find a TOutputListSelectorDataMap in a collection.
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
THashTable implements a hash table to store TObject's.
The TNamed class is the base class for all named ROOT classes.
void Init(TClassEdit::TInterpreterLookupHelper *helper)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Bool_t SetDataMembers(TSelector *sel) const
Given an output list, set the data members of a TSelector.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
const char * GetName() const
Return static name for TOutputListSelectorDataMap objects.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Inspect() const
Dump contents of this object in a graphics canvas.
Collection abstract base class.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
The ROOT global object gROOT contains a list of all defined classes.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
TString & Remove(Ssiz_t pos)
Bool_t CallShowMembers(const void *obj, TMemberInspector &insp, Bool_t isTransient=kFALSE) const
Call ShowMembers() on the obj of this class type, passing insp and parent.
virtual Bool_t IsEmpty() const
Set the selector's data members to the corresponding elements of the output list. ...
virtual void Add(TObject *obj)=0
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.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Mother of all ROOT objects.
virtual void Inspect(TClass *cl, const char *parent, const char *name, const void *addr)
virtual const char * GetTitle() const
Returns title of object.
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
This class is a special version of TSelector for user interpreted classes.
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
virtual const char * GetName() const
Returns name of object.
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Bool_t IsaPointer() const
Return true if data member is a pointer.
This class stores a (key,value) pair using an external hash.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual TList * GetOutputList() const
if(line.BeginsWith("/*"))