Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TFriendProxyDescriptor.cxx
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Philippe Canal 13/05/2003
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun, Fons Rademakers and al. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/** \class TFriendProxyDescriptor
13Hold the processed information about a Friend TTree while
14TTreeProxyGenerator is parsing the TTree information.
15Also contains the routine use to generate the appropriate code
16fragment in the result of MakeProxy.
17*/
18
21#include "TList.h"
22
24
25namespace ROOT {
26namespace Internal {
27
28 //////////////////////////////////////////////////////////////////////////
29 /// Constructor
30
32 const char *aliasname,
33 Int_t index) :
34 TNamed(treename,aliasname),
35 fDuplicate(false),
36 fIndex(index)
37 {
38 }
39
40 //////////////////////////////////////////////////////////////////////////
41 /// Return true if this descriptor and the other are equivalent (describe the
42 /// same entity).
43
45 {
46 if ( !other ) return false;
47 if ( strcmp(GetName(),other->GetName()) ) return false;
48
51
52 if ( fListOfTopProxies.GetSize() != other->fListOfTopProxies.GetSize() ) return false;
54 TIter othnext(&other->fListOfTopProxies);
55 while ( (desc=(TBranchProxyDescriptor*)next()) ) {
56 othdesc=(TBranchProxyDescriptor*)othnext();
57 if (!desc->IsEquivalent(othdesc) ) return false;
58 }
59 return true;
60 }
61
62 //////////////////////////////////////////////////////////////////////////
63 /// Print the declaration needed for this descriptor.
64
66 {
67 fprintf(hf,"%-*sstruct TFriendPx_%s : public TFriendProxy {\n", offset," ", GetName() );
68 fprintf(hf,"%-*s TFriendPx_%s(TBranchProxyDirector *director,TTree *tree,Int_t index) :\n",
69 offset," ", GetName() );
70 fprintf(hf,"%-*s %-*s(director,tree,index)",offset," ",maxVarname,"TFriendProxy");
73 while ( (data = (TBranchProxyDescriptor*)next()) ) {
74 fprintf(hf,",\n%-*s %-*s(&fDirector,\"%s\")",
75 offset," ",maxVarname, data->GetDataName(), data->GetBranchName());
76 }
77 fprintf(hf,"\n%-*s { }\n",offset," ");
78
79 fprintf(hf, "\n%-*s // Proxy for each of the branches and leaves of the tree\n",offset," ");
80 next.Reset();
81 while ( (data = (TBranchProxyDescriptor*)next()) ) {
82 data->OutputDecl(hf, offset+3, maxVarname);
83 }
84 fprintf(hf,"%-*s};\n",offset," ");
85 }
86
87 //////////////////////////////////////////////////////////////////////////
88 /// Print the declaration needed for this descriptor.
89
90 void TFriendProxyDescriptor::OutputDecl(FILE *hf, int offset, UInt_t maxVarname)
91 {
92 TString typeName = "TFriendPx_";
93 typeName += GetName();
94 fprintf(hf,"%-*s%-*s %s;\n",
95 offset," ",maxVarname,typeName.Data(),GetTitle());
96 }
97
98} // namespace Internal
99} // namespace ROOT
#define ClassImp(name)
Definition Rtypes.h:377
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 offset
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 index
bool IsEquivalent(const TBranchProxyDescriptor *other, bool inClass=false)
Return true if this description is the 'same' as the other description.
bool IsEquivalent(const TFriendProxyDescriptor *other)
Return true if this descriptor and the other are equivalent (describe the same entity).
void OutputDecl(FILE *hf, int offset, UInt_t maxVarname)
Print the declaration needed for this descriptor.
void OutputClassDecl(FILE *hf, int offset, UInt_t maxVarname)
Print the declaration needed for this descriptor.
TFriendProxyDescriptor(const TFriendProxyDescriptor &b)
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
void Reset()
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...