Logo ROOT   6.08/07
Reference Guide
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Rene Brun 26/12/94
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
12 #ifndef ROOT_TNamed
13 #define ROOT_TNamed
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TNamed //
19 // //
20 // The basis for a named object (name, title). //
21 // //
22 //////////////////////////////////////////////////////////////////////////
25 #ifndef ROOT_TObject
26 #include "TObject.h"
27 #endif
28 #ifndef ROOT_TString
29 #include "TString.h"
30 #endif
33 class TNamed : public TObject {
35 protected:
36  TString fName; //object identifier
37  TString fTitle; //object title
39 public:
40  TNamed(): fName(), fTitle() { }
41  TNamed(const char *name, const char *title) : fName(name), fTitle(title) { }
42  TNamed(const TString &name, const TString &title) : fName(name), fTitle(title) { }
43  TNamed(const TNamed &named);
44  TNamed& operator=(const TNamed& rhs);
45  virtual ~TNamed() { }
46  virtual void Clear(Option_t *option ="");
47  virtual TObject *Clone(const char *newname="") const;
48  virtual Int_t Compare(const TObject *obj) const;
49  virtual void Copy(TObject &named) const;
50  virtual void FillBuffer(char *&buffer);
51  virtual const char *GetName() const { return fName; }
52  virtual const char *GetTitle() const { return fTitle; }
53  virtual ULong_t Hash() const { return fName.Hash(); }
54  virtual Bool_t IsSortable() const { return kTRUE; }
55  virtual void SetName(const char *name); // *MENU*
56  virtual void SetNameTitle(const char *name, const char *title);
57  virtual void SetTitle(const char *title=""); // *MENU*
58  virtual void ls(Option_t *option="") const;
59  virtual void Print(Option_t *option="") const;
60  virtual Int_t Sizeof() const;
62  ClassDef(TNamed,1) //The basis for a named object (name, title)
63 };
65 #endif
TString fTitle
Definition: TNamed.h:37
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
TNamed(const TString &name, const TString &title)
Definition: TNamed.h:42
virtual ~TNamed()
Definition: TNamed.h:45
virtual Int_t Compare(const TObject *obj) const
Compare two TNamed objects.
Definition: TNamed.cxx:76
const char Option_t
Definition: RtypesCore.h:62
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:131
Basic string class.
Definition: TString.h:137
virtual Int_t Sizeof() const
Return size of the TNamed part of the TObject.
Definition: TNamed.cxx:164
int Int_t
Definition: RtypesCore.h:41
virtual void FillBuffer(char *&buffer)
Encode TNamed into output buffer.
Definition: TNamed.cxx:95
bool Bool_t
Definition: RtypesCore.h:59
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Definition: TNamed.cxx:145
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:606
virtual void Clear(Option_t *option="")
Set name and title to empty strings ("").
Definition: TNamed.cxx:55
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual void Print(Option_t *option="") const
Print TNamed name and title.
Definition: TNamed.cxx:119
virtual void ls(Option_t *option="") const
List TNamed name and title.
Definition: TNamed.cxx:104
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
Definition: TNamed.cxx:42
TString fName
Definition: TNamed.h:36
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TNamed.h:53
Definition: TNamed.h:40
unsigned long ULong_t
Definition: RtypesCore.h:51
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Definition: TNamed.cxx:65
Mother of all ROOT objects.
Definition: TObject.h:37
TNamed(const char *name, const char *title)
Definition: TNamed.h:41
virtual void Copy(TObject &named) const
Copy this to obj.
Definition: TNamed.cxx:85
virtual Bool_t IsSortable() const
Definition: TNamed.h:54
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:155
char name[80]
Definition: TGX11.cxx:109
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52