Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
29 class TNamed : public TObject {
30 
31 protected:
32  TString fName; //object identifier
33  TString fTitle; //object title
34 
35 public:
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