ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ExpressionParsing::MethodAccessorFactory::MethodAccessorKit< T_src > Class Template Reference

Auxiliary class to create a specific accessor which calls a method of an AuxElement or AuxVectorBase. More...

Inheritance diagram for ExpressionParsing::MethodAccessorFactory::MethodAccessorKit< T_src >:
Collaboration diagram for ExpressionParsing::MethodAccessorFactory::MethodAccessorKit< T_src >:

Public Member Functions

 MethodAccessorKit (ExpressionParsing::IProxyLoader::VariableType scalar_type, ExpressionParsing::IProxyLoader::VariableType vector_type)
 
virtual std::unique_ptr< IAccessorcreate (const SG::ReadHandleKey< SG::AuxVectorBase > &key, RootUtils::TSMethodCall &&method_call, TVirtualCollectionProxy *proxy) const override
 create an accessor which called the specified method of an AuxVectorBase. More...
 
virtual std::unique_ptr< IAccessorcreate (const SG::ReadHandleKey< SG::AuxElement > &key, RootUtils::TSMethodCall &&method_call, TVirtualCollectionProxy *proxy=nullptr) const override
 create an accessor which called the specified method of an AuxElement. More...
 

Private Member Functions

template<class T_Aux , class T_ScalarVectorHelper >
std::unique_ptr< IAccessorcreateAccessor (const SG::ReadHandleKey< T_Aux > &key, RootUtils::TSMethodCall &&method_call, TVirtualCollectionProxy *proxy, ExpressionParsing::IProxyLoader::VariableType variable_type) const
 

Private Attributes

ExpressionParsing::IProxyLoader::VariableType m_scalarType
 
ExpressionParsing::IProxyLoader::VariableType m_vectorType
 

Detailed Description

template<class T_src>
class ExpressionParsing::MethodAccessorFactory::MethodAccessorKit< T_src >

Auxiliary class to create a specific accessor which calls a method of an AuxElement or AuxVectorBase.

Definition at line 159 of file MethodAccessor.h.

Constructor & Destructor Documentation

◆ MethodAccessorKit()

Definition at line 161 of file MethodAccessor.h.

163  : m_scalarType(scalar_type),
164  m_vectorType(vector_type)
165  {}

Member Function Documentation

◆ create() [1/2]

template<class T_src >
virtual std::unique_ptr<IAccessor> ExpressionParsing::MethodAccessorFactory::MethodAccessorKit< T_src >::create ( const SG::ReadHandleKey< SG::AuxElement > &  key,
RootUtils::TSMethodCall &&  method_call,
TVirtualCollectionProxy *  proxy = nullptr 
) const
inlineoverridevirtual

create an accessor which called the specified method of an AuxElement.

Implements ExpressionParsing::MethodAccessorFactory::IMethodAccessorKit.

Definition at line 180 of file MethodAccessor.h.

182  {
183  if (proxy) {
184  return createAccessor<SG::AuxElement,VectorHelper>(key,std::move(method_call),proxy, (!proxy ? m_scalarType : m_vectorType));
185  }
186  else {
187  return createAccessor<SG::AuxElement,ScalarHelper>(key,std::move(method_call),proxy, (!proxy ? m_scalarType : m_vectorType));
188  }
189  // @TODO really vectorType and GenScalarAccessor if collection proxy is given ?
190  }

◆ create() [2/2]

template<class T_src >
virtual std::unique_ptr<IAccessor> ExpressionParsing::MethodAccessorFactory::MethodAccessorKit< T_src >::create ( const SG::ReadHandleKey< SG::AuxVectorBase > &  key,
RootUtils::TSMethodCall &&  method_call,
TVirtualCollectionProxy *  proxy 
) const
inlineoverridevirtual

create an accessor which called the specified method of an AuxVectorBase.

Implements ExpressionParsing::MethodAccessorFactory::IMethodAccessorKit.

Definition at line 168 of file MethodAccessor.h.

170  {
171  if (!proxy) {
172  std::stringstream msg;
173  msg << "Cannot use method access of types SG::AuxVectorBase without a collection proxy.";
174  throw std::logic_error(msg.str());
175  }
176  return createAccessor<SG::AuxVectorBase, VectorHelper>(key,std::move(method_call),proxy,m_vectorType);
177  }

◆ createAccessor()

template<class T_src >
template<class T_Aux , class T_ScalarVectorHelper >
std::unique_ptr<IAccessor> ExpressionParsing::MethodAccessorFactory::MethodAccessorKit< T_src >::createAccessor ( const SG::ReadHandleKey< T_Aux > &  key,
RootUtils::TSMethodCall &&  method_call,
TVirtualCollectionProxy *  proxy,
ExpressionParsing::IProxyLoader::VariableType  variable_type 
) const
inlineprivate

Definition at line 193 of file MethodAccessor.h.

196  {
197  if (proxy) {
198  return std::make_unique<GenAccessor<T_Aux,
199  typename CollectionMethodHelper<T_Aux,T_src>::Kit,
200  T_ScalarVectorHelper> >(key,
201  typename CollectionMethodHelper<T_Aux,T_src>::Kit(std::move(method_call), *proxy),
202  variable_type);
203  }
204  else {
205  return std::make_unique<GenAccessor<T_Aux,
206  typename MethodHelper<T_Aux,T_src>::Kit,
207  T_ScalarVectorHelper> >(key,
208  typename MethodHelper<T_Aux,T_src>::Kit(std::move(method_call)),
209  variable_type);
210  }
211  }

Member Data Documentation

◆ m_scalarType

Definition at line 212 of file MethodAccessor.h.

◆ m_vectorType

Definition at line 213 of file MethodAccessor.h.


The documentation for this class was generated from the following file:
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
ExpressionParsing::MethodAccessorFactory::MethodAccessorKit::m_vectorType
ExpressionParsing::IProxyLoader::VariableType m_vectorType
Definition: MethodAccessor.h:213
ExpressionParsing::MethodAccessorFactory::MethodAccessorKit::m_scalarType
ExpressionParsing::IProxyLoader::VariableType m_scalarType
Definition: MethodAccessor.h:212
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37