Belle II Software  release-06-02-00
SoftwareTriggerVariableManager.cc
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 #include <hlt/softwaretrigger/core/SoftwareTriggerVariableManager.h>
9 
10 #include <memory>
11 
12 namespace Belle2 {
17  namespace SoftwareTrigger {
19  {
20  static SoftwareTriggerVariableManager instance;
21  return instance;
22  }
23 
25  const std::string& variableName)
26  {
27  auto lowerBoundIterator = m_variableNameToVariable.lower_bound(variableName);
28  if (lowerBoundIterator == m_variableNameToVariable.end() or lowerBoundIterator->first != variableName) {
29  lowerBoundIterator = m_variableNameToVariable.insert(lowerBoundIterator,
30  {variableName, std::shared_ptr<SoftwareTriggerVariable>(new SoftwareTriggerVariable(variableName))});
31  }
32  return lowerBoundIterator->second.get();
33  }
34  }
36 }
Class which represents an abstract variable in the SoftwareTriggerVariableManager.
std::map< std::string, std::shared_ptr< SoftwareTriggerVariable > > m_variableNameToVariable
Internal storage of the variables with their name.
static SoftwareTriggerVariableManager & Instance()
Make this variable manager a singleton and get the only single instance of the manager.
SoftwareTriggerVariable * getVariable(const std::string &variableName)
Get the variable with the given name.
Abstract base class for different kinds of events.