Belle II Software development
Named.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <vector>
12
13namespace Belle2 {
20 template <typename T>
21 class Named {
22 public:
24 Named(const std::string& name, T value):
25 m_name(name), m_value(value)
26 {};
27
29 std::string getName() const {return m_name;}
30
32 void setName(const std::string& name)
33 {
34 m_name = name;
35 }
36
39 {
40 return m_value;
41 }
42
43 protected:
45 std::string m_name;
48 };
50}
A mixin class to attach a name to an object. Based on class with same name in CDC package.
Definition: Named.h:21
std::string getName() const
get name of the object
Definition: Named.h:29
void setName(const std::string &name)
set name of the object
Definition: Named.h:32
std::string m_name
name associated with object m_value
Definition: Named.h:45
Named(const std::string &name, T value)
Constructor taking the name and the desired value.
Definition: Named.h:24
T getValue()
get the object
Definition: Named.h:38
T m_value
object to be associated with name
Definition: Named.h:47
Abstract base class for different kinds of events.