Belle II Software development
Named< T > Class Template Reference

A mixin class to attach a name to an object. More...

#include <Named.h>

Inheritance diagram for Named< T >:

Public Member Functions

 Named (const std::string &name, T t)
 Constructor taking the name and the desired value.
 
bool operator< (const Named< T > &other) const
 Comparison operator establishing an ordering considering the name and the object.
 
std::string getName () const
 Getter for the name.
 
void setName (const std::string &name)
 Setter for the name of the object.
 

Private Types

using Super = ScalarToClass< T >
 Type of the base class.
 

Private Attributes

std::string m_name = ""
 Memory for the name.
 

Detailed Description

template<class T>
class Belle2::TrackFindingCDC::Named< T >

A mixin class to attach a name to an object.

Definition at line 23 of file Named.h.

Member Typedef Documentation

◆ Super

using Super = ScalarToClass<T>
private

Type of the base class.

Definition at line 27 of file Named.h.

Constructor & Destructor Documentation

◆ Named()

Named ( const std::string &  name,
t 
)
inline

Constructor taking the name and the desired value.

Definition at line 34 of file Named.h.

35 : Super(std::move(t))
36 , m_name(name)
37 {
38 }
ScalarToClass< T > Super
Type of the base class.
Definition: Named.h:27
std::string m_name
Memory for the name.
Definition: Named.h:64

Member Function Documentation

◆ getName()

std::string getName ( ) const
inline

Getter for the name.

Definition at line 51 of file Named.h.

52 {
53 return m_name;
54 }

◆ operator<()

bool operator< ( const Named< T > &  other) const
inline

Comparison operator establishing an ordering considering the name and the object.

Definition at line 41 of file Named.h.

42 {
43 // cppcheck-suppress constVariable
44 const T& t(*this);
45 // cppcheck-suppress constVariable
46 const T& otherT(other);
47 return getName() < other.getName() or (not(other.getName() < getName()) and t < otherT);
48 }
std::string getName() const
Getter for the name.
Definition: Named.h:51

◆ setName()

void setName ( const std::string &  name)
inline

Setter for the name of the object.

Definition at line 57 of file Named.h.

58 {
59 m_name = name;
60 }

Member Data Documentation

◆ m_name

std::string m_name = ""
private

Memory for the name.

Definition at line 64 of file Named.h.


The documentation for this class was generated from the following file: