Belle II Software  release-08-01-10
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 #include <boost/algorithm/string.hpp>
10 
11 namespace Belle2 {
16  namespace SoftwareTrigger {
18  {
19  static SoftwareTriggerVariableManager instance;
20  return instance;
21  }
22 
24  const std::string& variableName)
25  {
26  auto lowerBoundIterator = m_variableNameToVariable.lower_bound(variableName);
27  if (lowerBoundIterator == m_variableNameToVariable.end() or lowerBoundIterator->first != variableName) {
28  lowerBoundIterator = m_variableNameToVariable.insert(lowerBoundIterator,
29  {variableName, std::shared_ptr<SoftwareTriggerVariable>(new SoftwareTriggerVariable(variableName))});
30  }
31  return lowerBoundIterator->second.get();
32  }
33 
35  const std::string& variableName, const std::vector<std::string>& arguments)
36  {
37  auto fullname = variableName + "(" + boost::algorithm::join(arguments, ", ") + ")";
39  }
40  }
42 }
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.