Belle II Software  release-05-01-25
Named.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jonas Wagner, Sebastian Racs *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <vector>
14 
15 namespace Belle2 {
21  template <typename T>
23  class Named {
24  public:
26  Named(const std::string& name, T value):
27  m_name(name), m_value(value)
28  {};
29 
31  std::string getName() const {return m_name;}
32 
34  void setName(const std::string& name)
35  {
36  m_name = name;
37  }
38 
40  T getValue()
41  {
42  return m_value;
43  }
44 
45  protected:
47  std::string m_name;
49  T m_value;
50  };
52 }
Belle2::Named::m_name
std::string m_name
name associated with object m_value
Definition: Named.h:55
Belle2::Named::m_value
T m_value
object to be associated with name
Definition: Named.h:57
Belle2::Named::getName
std::string getName() const
get name of the object
Definition: Named.h:39
Belle2::Named::getValue
T getValue()
get the object
Definition: Named.h:48
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Named::setName
void setName(const std::string &name)
set name of the object
Definition: Named.h:42
Belle2::Named::Named
Named(const std::string &name, T value)
Constructor taking the name and the desired value.
Definition: Named.h:34