00001 // @(#)root/base:$Id: TNamed.h 20877 2007-11-19 11:17:07Z rdm $ 00002 // Author: Rene Brun 26/12/94 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TNamed 00013 #define ROOT_TNamed 00014 00015 00016 ////////////////////////////////////////////////////////////////////////// 00017 // // 00018 // TNamed // 00019 // // 00020 // The basis for a named object (name, title). // 00021 // // 00022 ////////////////////////////////////////////////////////////////////////// 00023 00024 00025 #ifndef ROOT_TObject 00026 #include "TObject.h" 00027 #endif 00028 #ifndef ROOT_TString 00029 #include "TString.h" 00030 #endif 00031 00032 00033 class TNamed : public TObject { 00034 00035 protected: 00036 TString fName; //object identifier 00037 TString fTitle; //object title 00038 00039 public: 00040 TNamed(): fName(), fTitle() { } 00041 TNamed(const char *name, const char *title) : fName(name), fTitle(title) { } 00042 TNamed(const TString &name, const TString &title) : fName(name), fTitle(title) { } 00043 TNamed(const TNamed &named); 00044 TNamed& operator=(const TNamed& rhs); 00045 virtual ~TNamed() { } 00046 virtual void Clear(Option_t *option =""); 00047 virtual TObject *Clone(const char *newname="") const; 00048 virtual Int_t Compare(const TObject *obj) const; 00049 virtual void Copy(TObject &named) const; 00050 virtual void FillBuffer(char *&buffer); 00051 virtual const char *GetName() const { return fName; } 00052 virtual const char *GetTitle() const { return fTitle; } 00053 virtual ULong_t Hash() const { return fName.Hash(); } 00054 virtual Bool_t IsSortable() const { return kTRUE; } 00055 virtual void SetName(const char *name); // *MENU* 00056 virtual void SetNameTitle(const char *name, const char *title); 00057 virtual void SetTitle(const char *title=""); // *MENU* 00058 virtual void ls(Option_t *option="") const; 00059 virtual void Print(Option_t *option="") const; 00060 virtual Int_t Sizeof() const; 00061 00062 ClassDef(TNamed,1) //The basis for a named object (name, title) 00063 }; 00064 00065 #endif