thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Utilities
Named.h
1
// -*- C++ -*-
2
//
3
// Named.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef ThePEG_Named_H
10
#define ThePEG_Named_H
11
// This is the declaration of the Named class.
12
13
14
#include <string>
15
16
namespace
ThePEG
{
17
24
class
Named
{
25
26
public
:
27
31
Named
(
const
string
& newName =
string
())
32
:
theName
(newName) {}
33
37
Named
(
const
Named
& ) =
default
;
38
42
const
string
&
name
()
const
{
return
theName
; }
43
47
bool
operator ==
(
const
Named
& other)
const
{
48
return
theName
== other.
name
();
49
}
50
54
bool
operator <
(
const
Named
& other)
const
{
55
return
theName
< other.
name
();
56
}
57
58
protected
:
59
63
const
Named
&
operator =
(
const
Named
& other) {
64
if
(
this
!= &other)
65
theName
= other.
name
();
66
return
*
this
;
67
}
68
72
const
string
&
name
(
const
string
& newName) {
73
return
theName
= newName;
74
}
75
76
private
:
77
81
string
theName
;
82
83
};
84
85
}
86
87
#endif
/* ThePEG_Named_H */
ThePEG::Named
The Named class is a simple concrete base class to used by classes of objects with a name.
Definition:
Named.h:24
ThePEG::Named::operator<
bool operator<(const Named &other) const
Lexicographical comparison.
Definition:
Named.h:54
ThePEG::Named::operator==
bool operator==(const Named &other) const
Test for equality.
Definition:
Named.h:47
ThePEG::Named::name
const string & name() const
Return name.
Definition:
Named.h:42
ThePEG::Named::operator=
const Named & operator=(const Named &other)
Assignment.
Definition:
Named.h:63
ThePEG::Named::Named
Named(const Named &)=default
Explicit default copy-constructor (too avoid compiler warnings)
ThePEG::Named::Named
Named(const string &newName=string())
Constructor with name.
Definition:
Named.h:31
ThePEG::Named::theName
string theName
The string containing the name.
Definition:
Named.h:81
ThePEG::Named::name
const string & name(const string &newName)
Set new name.
Definition:
Named.h:72
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
Generated on Thu Jun 20 2024 14:47:02 for ThePEG by
1.9.6