ATLAS Offline Software
Loading...
Searching...
No Matches
TestProxyLoader.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// TestProxyLoader.cxx, (c) ATLAS Detector software
8// Author: Thomas Gillam (thomas.gillam@cern.ch)
9// ExpressionParsing library
11
13
14#include <stdexcept>
15
16namespace ExpressionParsing {
20
22 {
24 }
25
27 {
28 if (varname == "intTEST") return VT_INT;
29 else if (varname == "int_TEST") return VT_INT;
30 else if (varname == "doubleTEST") return VT_DOUBLE;
31 else if (varname == "vectorIntTEST") return VT_VECINT;
32 else if (varname == "vectorDoubleTEST") return VT_VECDOUBLE;
33 else return VT_UNK;
34 }
35
36 int TestProxyLoader::loadIntVariableFromString(const std::string &varname) const
37 {
38 if (varname == "intTEST") { ++m_intAccessCount; return (42+(m_intAccessCount-1)); }
39 else if (varname == "int_TEST") { return 24; }
40 else throw std::runtime_error("Unknown proxy: " + varname);
41 }
42
43 double TestProxyLoader::loadDoubleVariableFromString(const std::string &varname) const
44 {
45 if (varname == "doubleTEST") return 42.42;
46 else throw std::runtime_error("Unknown proxy: " + varname);
47 }
48
49 std::vector<int> TestProxyLoader::loadVecIntVariableFromString(const std::string &varname) const
50 {
51 if (varname == "vectorIntTEST") return std::vector<int>(2, 42);
52 else throw std::runtime_error("Unknown proxy: " + varname);
53 }
54
55 std::vector<double> TestProxyLoader::loadVecDoubleVariableFromString(const std::string &varname) const
56 {
57 if (varname == "vectorDoubleTEST") return std::vector<double>(2, 42.42);
58 else throw std::runtime_error("Unknown proxy: " + varname);
59 }
60}
virtual double loadDoubleVariableFromString(const std::string &varname) const
virtual int loadIntVariableFromString(const std::string &varname) const
std::atomic< unsigned int > m_intAccessCount
virtual std::vector< int > loadVecIntVariableFromString(const std::string &varname) const
virtual IProxyLoader::VariableType variableTypeFromString(const std::string &varname) const
virtual std::vector< double > loadVecDoubleVariableFromString(const std::string &varname) const
Namespace holding all the expression evaluation code.