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 #ifndef ROOT_TObject 26 #include "TObject.h" 27 #endif 28 #ifndef ROOT_TString 29 #include "TString.h" 30 #endif 31 32 33 class TNamed : public TObject { 34 35 protected: 36 TString fName; //object identifier 37 TString fTitle; //object title 38 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; 61 62 ClassDef(TNamed,1) //The basis for a named object (name, title) 63 }; 64 65 #endif 66