ATLAS Offline Software
MultipleProxyLoader.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // MultipleProxyLoader.h, (c) ATLAS Detector software
8 // Author: Thomas Gillam (thomas.gillam@cern.ch)
9 // ExpressionParsing library
11 
12 #ifndef MULTIPLE_PROXY_LOADER_H
13 #define MULTIPLE_PROXY_LOADER_H
14 
17 #include "CxxUtils/SimpleUpdater.h"
19 
20 #include <vector>
21 #include <map>
22 
23 namespace ExpressionParsing {
25  public:
27  virtual ~MultipleProxyLoader();
28 
29  void push_back(IProxyLoader *proxyLoader);
30 
31  virtual void reset();
32 
33  virtual IProxyLoader::VariableType variableTypeFromString(const std::string &varname) const;
34 
35  virtual int loadIntVariableFromString(const std::string &varname) const;
36  virtual double loadDoubleVariableFromString(const std::string &varname) const;
37  virtual std::vector<int> loadVecIntVariableFromString(const std::string &varname) const;
38  virtual std::vector<double> loadVecDoubleVariableFromString(const std::string &varname) const;
39 
40  private:
41  std::vector<IProxyLoader *> m_proxyLoaders;
42 
43  using proxyCache_t = CxxUtils::ConcurrentStrMap<IProxyLoader*, CxxUtils::SimpleUpdater>;
44  mutable proxyCache_t m_varnameToProxyLoader ATLAS_THREAD_SAFE;
45  };
46 }
47 
48 #endif // MULTIPLE_PROXY_LOADER_H
ExpressionParsing::MultipleProxyLoader::ATLAS_THREAD_SAFE
proxyCache_t m_varnameToProxyLoader ATLAS_THREAD_SAFE
Definition: MultipleProxyLoader.h:44
ExpressionParsing::MultipleProxyLoader::loadIntVariableFromString
virtual int loadIntVariableFromString(const std::string &varname) const
Definition: MultipleProxyLoader.cxx:72
ExpressionParsing::MultipleProxyLoader::variableTypeFromString
virtual IProxyLoader::VariableType variableTypeFromString(const std::string &varname) const
Definition: MultipleProxyLoader.cxx:42
ConcurrentStrMap.h
Hash map from strings allowing concurrent, lockless reads.
ExpressionParsing::MultipleProxyLoader::loadDoubleVariableFromString
virtual double loadDoubleVariableFromString(const std::string &varname) const
Definition: MultipleProxyLoader.cxx:77
ExpressionParsing::IProxyLoader
Definition: IProxyLoader.h:19
ExpressionParsing::IProxyLoader::VariableType
VariableType
Definition: IProxyLoader.h:21
ExpressionParsing::MultipleProxyLoader::proxyCache_t
CxxUtils::ConcurrentStrMap< IProxyLoader *, CxxUtils::SimpleUpdater > proxyCache_t
Definition: MultipleProxyLoader.h:43
ExpressionParsing::MultipleProxyLoader::~MultipleProxyLoader
virtual ~MultipleProxyLoader()
Definition: MultipleProxyLoader.cxx:25
ExpressionParsing::MultipleProxyLoader::reset
virtual void reset()
Definition: MultipleProxyLoader.cxx:35
ExpressionParsing
Namespace holding all the expression evaluation code.
Definition: ExpressionParser.h:26
ExpressionParsing::MultipleProxyLoader::push_back
void push_back(IProxyLoader *proxyLoader)
Definition: MultipleProxyLoader.cxx:30
ExpressionParsing::MultipleProxyLoader::MultipleProxyLoader
MultipleProxyLoader()
Definition: MultipleProxyLoader.cxx:20
ExpressionParsing::MultipleProxyLoader::loadVecIntVariableFromString
virtual std::vector< int > loadVecIntVariableFromString(const std::string &varname) const
Definition: MultipleProxyLoader.cxx:82
ExpressionParsing::MultipleProxyLoader::loadVecDoubleVariableFromString
virtual std::vector< double > loadVecDoubleVariableFromString(const std::string &varname) const
Definition: MultipleProxyLoader.cxx:87
LArG4AODNtuplePlotter.varname
def varname(hname)
Definition: LArG4AODNtuplePlotter.py:37
SimpleUpdater.h
Simple (non-deleting) Updater implementation.
checker_macros.h
Define macros for attributes used to control the static checker.
IProxyLoader.h
ExpressionParsing::MultipleProxyLoader::m_proxyLoaders
std::vector< IProxyLoader * > m_proxyLoaders
Definition: MultipleProxyLoader.h:41
ExpressionParsing::MultipleProxyLoader
Definition: MultipleProxyLoader.h:24