Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaNamedList.cxx
Go to the documentation of this file.
1//*-- Author : Ole Hansen 08/05/2000
2
3
5//
6// THaNamedList
7//
8// A list with a name. Used to store blocks of THaCuts (tests)
9// in a THashList, where the name of this list is the hash index.
10//
12
13#include "THaNamedList.h"
14#include "TNamed.h"
15#include "TClass.h"
16#include <iostream>
17
18using namespace std;
19
20
21//_____________________________________________________________________________
23{
24 // THaNamedList default constructor
25}
26
27//_____________________________________________________________________________
28THaNamedList::THaNamedList( const char* name ) :
29 fNamed(new TNamed(name,name))
30{
31 // Normal THaNamedList constructor with single argument
32}
33
34//_____________________________________________________________________________
35THaNamedList::THaNamedList( const char* name, const char* title ) :
36 fNamed(new TNamed(name,title))
37{
38 // Normal THaNamedList constructor with name and title
39}
40
41//_____________________________________________________________________________
43{
44 // THaNamed list destructor
45
46 delete fNamed;
47}
48
49//_____________________________________________________________________________
51{
52 // Print all objects in the list. Pass option 'opt' through to each object
53 // being printed. (This is the old ROOT 2,x behavior).
54
55 TIter next(this);
56 while( TObject* object = next() )
57 object->Print(opt);
58}
59
60//_____________________________________________________________________________
61void THaNamedList::ls( Option_t* opt ) const
62{
63 // List THaNamedList name and title.
64
65 // IndentLevel();
66 cout <<"OBJ: " << fNamed->IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
67 << Int_t(TestBit(kCanDelete)) << endl;
68 TList::ls( opt );
69}
70
71//_____________________________________________________________________________
72void THaNamedList::SetName( const Text_t* name )
73{
74 // Set the name of the object.
75 // Only set name if it is not set already.
76 // This avoids problems with hash tables.
77 // Should probably be changed to provide a means of rehashing.
78
79 if( !*fNamed->GetName() )
81}
82
83//_____________________________________________________________________________
84void THaNamedList::SetNameTitle( const Text_t* name, const Text_t* title )
85{
86 // Set name and title of the object, but only if the name is not yet
87 // initialized
88
89 if( !*fNamed->GetName() )
90 fNamed->SetNameTitle( name, title );
91}
92
93//_____________________________________________________________________________
int Int_t
char Text_t
const char Option_t
char name[80]
void ls(Option_t *option="") const override
const Text_t * GetTitle() const
TNamed * fNamed
virtual void PrintOpt(Option_t *opt="") const
virtual void SetNameTitle(const Text_t *name, const Text_t *title)
virtual void SetName(const Text_t *name)
virtual ~THaNamedList()
virtual void ls(Option_t *option="") const
const Text_t * GetName() const
const char * GetName() const override
virtual void SetName(const char *name)
TClass * IsA() const override
virtual void SetNameTitle(const char *name, const char *title)
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
STL namespace.
ClassImp(TPyArg)