File indexing completed on 2026-08-06 09:38:32
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ThePEG_Named_H
0010 #define ThePEG_Named_H
0011
0012
0013
0014 #include <string>
0015
0016 namespace ThePEG {
0017
0018
0019
0020
0021
0022
0023
0024 class Named {
0025
0026 public:
0027
0028
0029
0030
0031 Named(const string & newName = string())
0032 : theName(newName) {}
0033
0034
0035
0036
0037 Named(const Named & ) = default;
0038
0039
0040
0041
0042 const string & name() const { return theName; }
0043
0044
0045
0046
0047 bool operator == (const Named & other) const {
0048 return theName == other.name();
0049 }
0050
0051
0052
0053
0054 bool operator < (const Named & other) const {
0055 return theName < other.name();
0056 }
0057
0058 protected:
0059
0060
0061
0062
0063 const Named & operator = (const Named & other) {
0064 if (this != &other)
0065 theName = other.name();
0066 return *this;
0067 }
0068
0069
0070
0071
0072 const string & name(const string & newName) {
0073 return theName = newName;
0074 }
0075
0076 private:
0077
0078
0079
0080
0081 string theName;
0082
0083 };
0084
0085 }
0086
0087 #endif