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
23
24namespace ROOT {
25namespace Internal {
26
27 //////////////////////////////////////////////////////////////////////////
28 /// Constructor
29
31 const char *aliasname,
32 Int_t index) :
34 fDuplicate(false),
35 fIndex(index)
36 {
37 }
38
39 //////////////////////////////////////////////////////////////////////////
40 /// Return true if this descriptor and the other are equivalent (describe the
41 /// same entity).
42
44 {
45 if ( !other ) return false;
46 if ( strcmp(GetName(),other->GetName()) ) return false;
47
50
51 if ( fListOfTopProxies.GetSize() != other->fListOfTopProxies.GetSize() ) return false;
53 TIter othnext(&other->fListOfTopProxies);
54 while ( (desc=(TBranchProxyDescriptor*)next()) ) {
56 if (!desc->IsEquivalent(othdesc) ) return false;
57 }
58 return true;
59 }
60
61 //////////////////////////////////////////////////////////////////////////
62 /// Print the declaration needed for this descriptor.
63
65 {
66 fprintf(hf,"%-*sstruct TFriendPx_%s : public TFriendProxy {\n", offset," ", GetName() );
67 fprintf(hf,"%-*s TFriendPx_%s(TBranchProxyDirector *director,TTree *tree,Int_t index) :\n",
68 offset," ", GetName() );
69 fprintf(hf,"%-*s %-*s(director,tree,index)",offset," ",maxVarname,"TFriendProxy");
72 while ( (data = (TBranchProxyDescriptor*)next()) ) {
73 fprintf(hf,",\n%-*s %-*s(&fDirector,\"%s\")",
74 offset," ",maxVarname, data->GetDataName(), data->GetBranchName());
75 }
76 fprintf(hf,"\n%-*s { }\n",offset," ");
77
78 fprintf(hf, "\n%-*s // Proxy for each of the branches and leaves of the tree\n",offset," ");
79 next.Reset();
80 while ( (data = (TBranchProxyDescriptor*)next()) ) {
81 data->OutputDecl(hf, offset+3, maxVarname);
82 }
83 fprintf(hf,"%-*s};\n",offset," ");
84 }
85
86 //////////////////////////////////////////////////////////////////////////
87 /// Print the declaration needed for this descriptor.
88
90 {
91 TString typeName = "TFriendPx_";
92 typeName += GetName();
93 fprintf(hf,"%-*s%-*s %s;\n",
94 offset," ",maxVarname,typeName.Data(),GetTitle());
95 }
96
97} // namespace Internal
98} // namespace ROOT
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 offset
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:49
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
Basic string class.
Definition TString.h:138
const char * Data() const
Definition TString.h:384