41 if (!dtTypeName.
EndsWith(
"*"))
return 0;
50 void Inspect(
TClass *cl,
const char *parent,
const char *name,
const void *addr,
Bool_t isTransient);
51 Ssiz_t GetNumSet()
const {
return fNumSet; }
64 fDMInfo(dmInfo), fOutputList(output), fNumSet(0), fOwner(owner)
78 while (name[0] ==
'*') ++
name;
83 PDB(kOutput,1) fOwner.
Info("SetDataMembers()",
84 "data member `%s%s::%s' maps to
output list
object `%s'",
85 cl->GetName(), parent, name, mapping->GetTitle());
87 TObject* outputObj = fOutputList->FindObject(mapping->GetTitle());
89 PDB(kOutput,1) fOwner.
Warning("SetDataMembers()",
90 "
object `%s' not found in
output list!",
97 TClass* cldt = IsSettableDataMember(dm);
99 PDB(kOutput,1) fOwner.
Warning("SetDataMembers()",
100 "unusable data member `%s' should have been detected by TCollectDataMembers!",
105 char *pointer = (
char*)addr;
106 char **ppointer = (
char**)(pointer);
109 fOwner.Warning(
"SetDataMembers()",
"potential memory leak: replacing data member `%s' != 0. "
110 "Please initialize %s to 0 in constructor %s::%s()",
113 *ppointer = (
char*)outputObj;
122 ~TCollectDataMembers();
124 void Inspect(
TClass *cl,
const char *parent,
const char *name,
const void *addr,
Bool_t isTransient);
125 TExMap& GetMemberPointers() {
return fMap; }
144 if (!IsSettableDataMember(dm))
return;
146 char *pointer = (
char*)addr;
147 char **ppointer = (
char**)(pointer);
148 char **p3pointer = (
char**)(*ppointer);
156 fMap.Remove((
Long64_t)(ptrdiff_t)p3pointer);
168 if (name[0] ==
'*') ++
name;
169 PDB(kOutput,1) fOwner.
Info("Init()", "considering data member `%s'", name);
173 TCollectDataMembers::~TCollectDataMembers() {
180 while (iMembers.Next(key, value)) {
204 return "PROOF_TOutputListSelectorDataMap_object";
213 PDB(kOutput,1)
Warning(
"Init",
"Leave (no selector!)");
218 PDB(kOutput,1)
Info(
"Init()",
"Leave (no output)");
224 PDB(kOutput,1)
Warning(
"Init",
"Mapping already exists!");
232 TCollectDataMembers cdm(*
this);
243 Error(
"Init",
"failed to get TSelectorCint interpreted class!");
248 PDB(kOutput,1)
Warning(
"Init",
"Failed to determine mapping!");
251 PDB(kOutput,1)
Info(
"Init()",
"Found %d data members.",
252 cdm.GetMemberPointers().GetSize());
256 TIter iOutput(outList);
259 while ((output = iOutput())) {
268 addAllDM = (
TList*) obj;
274 PDB(kOutput,1)
Info(
"Init()",
"Data member `%s' corresponds to output `%s'",
275 dm->
GetName(), output->GetName());
293 TSetSelDataMembers ssdm(*
this,
fMap, output);
305 Error(
"Init",
"failed to get TSelectorCint interpreted class!");
310 PDB(kOutput,1)
Info(
"SetDataMembers()",
"%s, set %d data members.",
311 (res ?
"success" :
"failure"), ssdm.GetNumSet());
313 PDB(kOutput,1)
Warning(
"SetDataMembers",
"Failed to determine selector TClass!");
325 if (!other)
return kFALSE;
330 while ((mapping = (
TNamed*)iMapping())) {
335 if (strcmp(oldMap->
GetTitle(), mapping->GetTitle())) {
339 "contradicting mapping for data member `%s' (output list entry `%s' vs. `%s'). "
340 "Cancelling automatic TSelector data member setting!",
341 mapping->GetName(), oldMap->
GetTitle(), mapping->GetTitle());
358 while ((out = iOutput())) {
virtual void Clear(Option_t *option="")=0
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
virtual TList * GetOutputList() const
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.
Bool_t Merge(TObject *obj)
Merge another TOutputListSelectorDataMap object, check consistency.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Bool_t IsaPointer() const
Return true if data member is a pointer.
Abstract base class for accessing the data-members of a class.
const char * GetFullTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
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.
ClassImp(TOutputListSelectorDataMap)
THashTable implements a hash table to store TObject's.
The TNamed class is the base class for all named ROOT classes.
virtual Bool_t IsEmpty() const
if(pyself &&pyself!=Py_None)
void Info(const char *location, const char *msgfmt,...)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
const char * GetName() const
Return static name for TOutputListSelectorDataMap objects.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Collection abstract base class.
Bool_t SetDataMembers(TSelector *sel) const
Given an output list, set the data members of a TSelector.
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
TCollection * GetMap() const
void Warning(const char *location, const char *msgfmt,...)
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.
TString & Remove(Ssiz_t pos)
virtual TClass * GetInterpretedClass() const
Retrieve the TClass object for the interpreted class.
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.
TDataMember * GetDataMember(const char *datamember) const
Return pointer to datamember object with name "datamember".
Mother of all ROOT objects.
virtual void Inspect(TClass *cl, const char *parent, const char *name, const void *addr)
virtual void Add(TObject *obj)
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
This class is a special version of TSelector for user interpreted classes.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
static void output(int code)
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
virtual const char * GetTitle() const
Returns title of object.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual TSelector * GetInterpretedSelector() const
This class stores a (key,value) pair using an external hash.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.