emcNamed.h

Go to the documentation of this file.
00001 #ifndef __EMCNAMED_H__
00002 #define __EMCNAMED_H__
00003 
00004 #include <string>
00005 #include <iosfwd>
00006 
00010 class emcNamed
00011 {
00012 public:
00013 
00015   emcNamed(const char* name="", 
00016            const char* title="", 
00017            const char* classname="");
00018 
00019   emcNamed(const emcNamed&);
00020 
00021   emcNamed& operator=(const emcNamed&);
00022 
00023   virtual ~emcNamed();
00024   
00026   virtual const char* GetClassName(void) const { return fClassName.c_str(); }
00028   virtual const char* GetName(void) const { return fName.c_str(); }
00030   virtual const char* GetTitle(void) const { return fTitle.c_str(); }
00031 
00032   virtual void NameIt(const std::string& name, 
00033                       const std::string& title, 
00034                       const std::string& classname);
00035 
00037   virtual void SetClassName(const std::string& s) { fClassName = s; }
00039   virtual void SetTitle(const std::string& s) { fTitle = s; }
00041   virtual void SetName(const std::string& s) { fName = s; }
00042 
00043  protected:
00044   void Copy(emcNamed&) const;
00045 
00046  private:
00047   std::string fName;
00048   std::string fTitle;
00049   std::string fClassName;
00050 };
00051 
00052 std::ostream& operator << (std::ostream&, const emcNamed&);
00053 
00054 #endif