Logo ROOT  
Reference Guide
TNamed.h
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Rene Brun 26/12/94
3
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 *************************************************************************/
11
12#ifndef ROOT_TNamed
13#define ROOT_TNamed
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TNamed //
19// //
20// The basis for a named object (name, title). //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24
25#include "TObject.h"
26#include "TString.h"
27
28
29class TNamed : public TObject {
30
31protected:
32 TString fName; //object identifier
33 TString fTitle; //object title
34
35public:
36 TNamed(): fName(), fTitle() { }
37 TNamed(const char *name, const char *title) : fName(name), fTitle(title) { }
38 TNamed(const TString &name, const TString &title) : fName(name), fTitle(title) { }
39 TNamed(const TNamed &named);
40 TNamed& operator=(const TNamed& rhs);
41 virtual ~TNamed();
42 virtual void Clear(Option_t *option ="");
43 virtual TObject *Clone(const char *newname="") const;
44 virtual Int_t Compare(const TObject *obj) const;
45 virtual void Copy(TObject &named) const;
46 virtual void FillBuffer(char *&buffer);
47 virtual const char *GetName() const { return fName; }
48 virtual const char *GetTitle() const { return fTitle; }
49 virtual ULong_t Hash() const { return fName.Hash(); }
50 virtual Bool_t IsSortable() const { return kTRUE; }
51 virtual void SetName(const char *name); // *MENU*
52 virtual void SetNameTitle(const char *name, const char *title);
53 virtual void SetTitle(const char *title=""); // *MENU*
54 virtual void ls(Option_t *option="") const;
55 virtual void Print(Option_t *option="") const;
56 virtual Int_t Sizeof() const;
57
58 ClassDef(TNamed,1) //The basis for a named object (name, title)
59};
60
61#endif
int Int_t
Definition: RtypesCore.h:43
unsigned long ULong_t
Definition: RtypesCore.h:53
bool Bool_t
Definition: RtypesCore.h:61
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
char name[80]
Definition: TGX11.cxx:109
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual void ls(Option_t *option="") const
List TNamed name and title.
Definition: TNamed.cxx:113
virtual void FillBuffer(char *&buffer)
Encode TNamed into output buffer.
Definition: TNamed.cxx:104
virtual Int_t Compare(const TObject *obj) const
Compare two TNamed objects.
Definition: TNamed.cxx:85
TNamed(const char *name, const char *title)
Definition: TNamed.h:37
virtual void Print(Option_t *option="") const
Print TNamed name and title.
Definition: TNamed.cxx:128
virtual void Copy(TObject &named) const
Copy this to obj.
Definition: TNamed.cxx:94
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
virtual ~TNamed()
TNamed destructor.
Definition: TNamed.cxx:42
TNamed(const TString &name, const TString &title)
Definition: TNamed.h:38
TString fTitle
Definition: TNamed.h:33
TNamed()
Definition: TNamed.h:36
virtual void Clear(Option_t *option="")
Set name and title to empty strings ("").
Definition: TNamed.cxx:64
TString fName
Definition: TNamed.h:32
virtual ULong_t Hash() const
Return hash value for this object.
Definition: TNamed.h:49
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Definition: TNamed.cxx:74
virtual Int_t Sizeof() const
Return size of the TNamed part of the TObject.
Definition: TNamed.cxx:173
virtual Bool_t IsSortable() const
Definition: TNamed.h:50
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
Definition: TNamed.cxx:51
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Definition: TNamed.cxx:154
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:131
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
Definition: TString.cxx:638