Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:57:44

0001 // @(#)root/base:$Id$
0002 // Author: Rene Brun   26/12/94
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TNamed
0013 #define ROOT_TNamed
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TNamed                                                               //
0019 //                                                                      //
0020 // The basis for a named object (name, title).                          //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 
0025 #include "TObject.h"
0026 #include "TString.h"
0027 
0028 
0029 class TNamed : public TObject {
0030 
0031 protected:
0032    TString   fName;            //object identifier
0033    TString   fTitle;           //object title
0034 
0035 public:
0036    TNamed(): fName(), fTitle() { }
0037    TNamed(const char *name, const char *title) : fName(name), fTitle(title) { }
0038    TNamed(const TString &name, const TString &title) : fName(name), fTitle(title) { }
0039    TNamed(const TNamed &named);
0040    TNamed& operator=(const TNamed& rhs);
0041    virtual ~TNamed();
0042             void     Clear(Option_t *option ="") override;
0043             TObject *Clone(const char *newname="") const override;
0044             Int_t    Compare(const TObject *obj) const override;
0045             void     Copy(TObject &named) const override;
0046    virtual  void     FillBuffer(char *&buffer);
0047             const char  *GetName() const override { return fName; }
0048             const char  *GetTitle() const override { return fTitle; }
0049             ULong_t  Hash() const override { return fName.Hash(); }
0050             Bool_t   IsSortable() const override { return kTRUE; }
0051    virtual  void     SetName(const char *name); // *MENU*
0052    virtual  void     SetNameTitle(const char *name, const char *title);
0053    virtual  void     SetTitle(const char *title=""); // *MENU*
0054             void     ls(Option_t *option="") const override;
0055             void     Print(Option_t *option="") const override;
0056    virtual  Int_t    Sizeof() const;
0057 
0058    ClassDefOverride(TNamed,1)  //The basis for a named object (name, title)
0059 };
0060 
0061 #endif