Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:16:11

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    void SavePrimitiveNameTitle(std::ostream &out, const char *variable_name);
0036 
0037 public:
0038    TNamed(): fName(), fTitle() { } // NOLINT: not allowed to use = default because of TObject::kIsOnHeap detection, see ROOT-10300
0039    TNamed(const char *name, const char *title) : fName(name), fTitle(title) { }
0040    TNamed(const TString &name, const TString &title) : fName(name), fTitle(title) { }
0041    TNamed(const TNamed &named);
0042    TNamed& operator=(const TNamed& rhs);
0043    virtual ~TNamed();
0044             void     Clear(Option_t *option ="") override;
0045             TObject *Clone(const char *newname="") const override;
0046             Int_t    Compare(const TObject *obj) const override;
0047             void     Copy(TObject &named) const override;
0048    virtual  void     FillBuffer(char *&buffer);
0049             const char  *GetName() const override { return fName; }
0050             const char  *GetTitle() const override { return fTitle; }
0051             ULong_t  Hash() const override { return fName.Hash(); }
0052             Bool_t   IsSortable() const override { return kTRUE; }
0053    virtual  void     SetName(const char *name); // *MENU*
0054    virtual  void     SetNameTitle(const char *name, const char *title);
0055    virtual  void     SetTitle(const char *title=""); // *MENU*
0056             void     ls(Option_t *option="") const override;
0057             void     Print(Option_t *option="") const override;
0058    virtual  Int_t    Sizeof() const;
0059 
0060    ClassDefOverride(TNamed,1)  //The basis for a named object (name, title)
0061 };
0062 
0063 #endif