|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef _ExpressionParserUser_H_
6 #define _ExpressionParserUser_H_
12 #include <type_traits>
15 #include "GaudiKernel/StatusCode.h"
16 #include "GaudiKernel/DataHandle.h"
23 class SGxAODProxyLoader;
24 class MultipleProxyLoader;
29 template <
unsigned short NUM_PARSER>
34 std::array< std::unique_ptr<ExpressionParsing::ExpressionParser>, NUM_PARSER >
36 const std::vector< std::string> &selection_string,
37 unsigned short num_parser);
49 std::unique_ptr<ExpressionParsing::ExpressionParser>
51 const std::string &selection_string,
52 unsigned short num_parser);
56 std::vector<std::string>
getVariables(
const std::unique_ptr<ExpressionParsing::ExpressionParser> &
parser);
61 template <
unsigned short NUM_PARSER>
62 using ParserHelper =
typename std::conditional< NUM_PARSER == 1, class SingleParserHelper, class MultiParserHelper<NUM_PARSER> >
::type;
65 template <
unsigned short NUM_PARSER>
66 using SelectionArg =
typename std::conditional< NUM_PARSER == 1, std::string, std::vector< std::string > >
::type;
70 template <
class T_Base,
unsigned short const NUM_PARSER>
76 template <
typename...Args>
84 const std::vector<const DataObjID*> &output_data_in,
85 std::vector<Gaudi::DataHandle *> &new_input_handles,
86 std::vector<Gaudi::DataHandle *> &new_output_handles)
override;
98 typename std::conditional< NUM_PARSER == 1,
99 std::unique_ptr<ExpressionParsing::ExpressionParser>,
100 std::array< std::unique_ptr<ExpressionParsing::ExpressionParser>, NUM_PARSER> >
::type m_parser;
105 template <
class T_Base,
unsigned short const NUM_PARSER = 1>
109 template <
typename...Args>
StatusCode finalizeParser()
std::function< StatusCode(ExpressionParsing::MultipleProxyLoader &)> AppendLoaderFunc
typename std::conditional< NUM_PARSER==1, std::string, std::vector< std::string > >::type SelectionArg
type to be used for expression string(s) for a single or multiple expression parsers
std::conditional< NUM_PARSER==1, std::unique_ptr< ExpressionParsing::ExpressionParser >, std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, NUM_PARSER > >::type m_parser
ExpressionParserUser(Args...args)
ExpressionParsing::SGxAODProxyLoader * m_xAODProxyLoader
The expression parser.
static std::unique_ptr< ExpressionParsing::ExpressionParser > createParser(ExpressionParsing::IProxyLoader &proxy_loader, const std::string &selection_string, unsigned short num_parser)
Create a single expression parser for the given expression.
virtual bool renounceInput(const DataObjID &output_data_id) override
StatusCode _initializeParser(const ExpressionParsing::SelectionArg< NUM_PARSER > &selection_string, ExpressionParsing::AppendLoaderFunc pre_xaod_loader=ExpressionParsing::NoLoaderFunc, ExpressionParsing::AppendLoaderFunc post_xaod_loader=ExpressionParsing::NoLoaderFunc)
std::vector< std::string > m_renounce
virtual bool updateDataNeeds(const std::vector< const DataObjID * > &input_data_in, const std::vector< const DataObjID * > &output_data_in, std::vector< Gaudi::DataHandle * > &new_input_handles, std::vector< Gaudi::DataHandle * > &new_output_handles) override
Inform a dynamic data consumer about all consumed or produced data.
ExpressionParserUserBase(Args...args)
::StatusCode StatusCode
StatusCode definition for legacy code.
Namespace holding all the expression evaluation code.
StatusCode initializeParser(const ExpressionParsing::SelectionArg< NUM_PARSER > &selection_string)
virtual ~ExpressionParserUserBase()=default
typename std::conditional< NUM_PARSER==1, class SingleParserHelper, class MultiParserHelper< NUM_PARSER > >::type ParserHelper
type of a helper class to create n-parser for the given expression or list of expressions.
static std::vector< std::string > getVariables(const std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, NUM_PARSER > &parser)
get the union of all variables used by the given list of expression parsers.
static std::vector< std::string > getVariables(const std::unique_ptr< ExpressionParsing::ExpressionParser > &parser)
Get the variables from used by the given expression parser.
Auxiliary class to access content of xAOD objects referred to by variables of an expressions handled ...
static std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, NUM_PARSER > createParser(ExpressionParsing::IProxyLoader &proxy_loader, const std::vector< std::string > &selection_string, unsigned short num_parser)
create an expression parser for each of the given expression strings
std::unique_ptr< ExpressionParsing::IProxyLoader > m_proxyLoaders
StatusCode NoLoaderFunc(ExpressionParsing::MultipleProxyLoader &)
Helper class to handle an array expression parsers to be used in the generic code.
Helper class to handle a single expression parser to be used in the generic code.