/usr/include/ThePEG/Utilities/Named.h is in libthepeg-dev 1.8.0-3build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | // -*- C++ -*-
//
// Named.h is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef ThePEG_Named_H
#define ThePEG_Named_H
// This is the declaration of the Named class.
#include <string>
namespace ThePEG {
/**
* The <code>Named</code> class is a simple concrete base class to
* used by classes of objects with a name. It just defines a string
* member variable with corresponding (protected) set and get
* functions.
*/
class Named {
public:
/**
* Constructor with name.
*/
Named(const string & newName = string())
: theName(newName) {}
/**
* Return name.
*/
const string & name() const { return theName; }
/**
* Test for equality.
*/
bool operator == (const Named & other) const
{
return theName == other.name();
}
/**
* Lexicographical comparison.
*/
bool operator < (const Named & other) const
{
return theName < other.name();
}
protected:
/**
* Assignment.
*/
const Named & operator = (const Named & other)
{
if (this != &other)
theName = other.name();
return *this;
}
/**
* Set new name.
*/
const string & name(const string & newName)
{
return theName = newName;
}
private:
/**
* The string containing the name.
*/
string theName;
};
}
#endif /* ThePEG_Named_H */
|