00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_Named_H
00010 #define ThePEG_Named_H
00011
00012
00013
00014 #include <string>
00015
00016 namespace ThePEG {
00017
00024 class Named {
00025
00026 public:
00027
00031 Named(const string & newName = string())
00032 : theName(newName) {}
00033
00037 const string & name() const { return theName; }
00038
00042 bool operator == (const Named & other) const
00043 {
00044 return theName == other.name();
00045 }
00046
00050 bool operator < (const Named & other) const
00051 {
00052 return theName < other.name();
00053 }
00054
00055 protected:
00056
00060 const Named & operator = (const Named & other)
00061 {
00062 if (this != &other)
00063 theName = other.name();
00064 return *this;
00065 }
00066
00070 const string & name(const string & newName)
00071 {
00072 return theName = newName;
00073 }
00074
00075 private:
00076
00080 string theName;
00081
00082 };
00083
00084 }
00085
00086 #endif