ATLAS Offline Software
Loading...
Searching...
No Matches
ExpressionParsing::MethodAccessorFactory Class Reference

Class to create accessor which call methods of an AuxElement of an AuxVectorBase container (singleton). More...

#include <MethodAccessor.h>

Inheritance diagram for ExpressionParsing::MethodAccessorFactory:
Collaboration diagram for ExpressionParsing::MethodAccessorFactory:

Classes

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

Public Member Functions

 MethodAccessorFactory ()
std::unique_ptr< IAccessorcreate (const SG::ReadHandleKey< SG::AuxElement > &key, RootUtils::ClingCallWrapperUncheckedReturnValue<> &&method_wrapper, TVirtualCollectionProxy *proxy=nullptr) const
 Create an accessor which calls the specified method of an AuxElement.
std::unique_ptr< IAccessorcreate (const SG::ReadHandleKey< SG::AuxVectorBase > &key, RootUtils::ClingCallWrapperUncheckedReturnValue<> &&method_wrapper, TVirtualCollectionProxy *proxy=nullptr) const
 Create an accessor which calls the specified method of an AuxVectorBase.

Static Public Member Functions

static MethodAccessorFactoryinstance ()

Private Member Functions

const IMethodAccessorKitgetKit (const RootUtils::ClingCallWrapperUncheckedReturnValue<> &method_wrapper) const
 Get an specific class which creates the accessor for the given method.

Static Private Member Functions

template<typename T>
static std::pair< std::string, std::pair< std::unique_ptr< IMethodAccessorKit >, TInterpreter::EReturnType > > keyAndIntMethodKit ()
template<typename T>
static std::pair< std::string, std::pair< std::unique_ptr< IMethodAccessorKit >, TInterpreter::EReturnType > > keyAndDoubleMethodKit ()

Private Attributes

std::map< std::string, std::pair< std::unique_ptr< IMethodAccessorKit >, TInterpreter::EReturnType > > m_kits

Static Private Attributes

static CxxUtils::CachedUniquePtrT< MethodAccessorFactory > s_instance ATLAS_THREAD_SAFE

Detailed Description

Class to create accessor which call methods of an AuxElement of an AuxVectorBase container (singleton).

Definition at line 142 of file MethodAccessor.h.

Constructor & Destructor Documentation

◆ MethodAccessorFactory()

ExpressionParsing::MethodAccessorFactory::MethodAccessorFactory ( )
inline

Definition at line 231 of file MethodAccessor.h.

231 {
243 }
std::map< std::string, std::pair< std::unique_ptr< IMethodAccessorKit >, TInterpreter::EReturnType > > m_kits
static std::pair< std::string, std::pair< std::unique_ptr< IMethodAccessorKit >, TInterpreter::EReturnType > > keyAndIntMethodKit()
static std::pair< std::string, std::pair< std::unique_ptr< IMethodAccessorKit >, TInterpreter::EReturnType > > keyAndDoubleMethodKit()

Member Function Documentation

◆ create() [1/2]

std::unique_ptr< IAccessor > ExpressionParsing::MethodAccessorFactory::create ( const SG::ReadHandleKey< SG::AuxElement > & key,
RootUtils::ClingCallWrapperUncheckedReturnValue<> && method_wrapper,
TVirtualCollectionProxy * proxy = nullptr ) const
inline

Create an accessor which calls the specified method of an AuxElement.

Definition at line 247 of file MethodAccessor.h.

249 {
250 return getKit(method_wrapper).create(key,std::move(method_wrapper), proxy);
251 }
virtual std::unique_ptr< IAccessor > create(const SG::ReadHandleKey< SG::AuxVectorBase > &key, RootUtils::ClingCallWrapperUncheckedReturnValue<> &&method_wrapper, TVirtualCollectionProxy *proxy=nullptr) const =0
const IMethodAccessorKit & getKit(const RootUtils::ClingCallWrapperUncheckedReturnValue<> &method_wrapper) const
Get an specific class which creates the accessor for the given method.

◆ create() [2/2]

std::unique_ptr< IAccessor > ExpressionParsing::MethodAccessorFactory::create ( const SG::ReadHandleKey< SG::AuxVectorBase > & key,
RootUtils::ClingCallWrapperUncheckedReturnValue<> && method_wrapper,
TVirtualCollectionProxy * proxy = nullptr ) const
inline

Create an accessor which calls the specified method of an AuxVectorBase.

Definition at line 255 of file MethodAccessor.h.

257 {
258 return getKit(method_wrapper).create(key,std::move(method_wrapper), proxy);
259 }

◆ getKit()

const IMethodAccessorKit & ExpressionParsing::MethodAccessorFactory::getKit ( const RootUtils::ClingCallWrapperUncheckedReturnValue<> & method_wrapper) const
inlineprivate

Get an specific class which creates the accessor for the given method.

Definition at line 265 of file MethodAccessor.h.

265 {
266
267 std::map<std::string, std::pair<std::unique_ptr<IMethodAccessorKit>, TInterpreter::EReturnType> >::const_iterator
268 iter = m_kits.find(method_wrapper.getReturnTypeNormalizedName());
269 if (iter == m_kits.end()) {
270 const std::string amsg = "ExpressionParsing::MethodAccessorFactory: no kit for return type " + method_wrapper.getReturnTypeNormalizedName()
271 + " wrapper " + typeid(method_wrapper).name();
272 throw std::runtime_error(amsg);
273 }
274 return *(iter->second.first);
275 }
std::string getReturnTypeNormalizedName() const
the normalized name of the function return type.

◆ instance()

◆ keyAndDoubleMethodKit()

template<typename T>
std::pair< std::string, std::pair< std::unique_ptr< IMethodAccessorKit >, TInterpreter::EReturnType > > ExpressionParsing::MethodAccessorFactory::keyAndDoubleMethodKit ( )
inlinestaticprivate

Definition at line 225 of file MethodAccessor.h.

225 {
226 return std::make_pair(RootUtils::getNormalizedTypeName<T>(),
228 TInterpreter::EReturnType::kDouble));
229 }
Auxiliary class to create a specific accessor which calls a method of an AuxElement or AuxVectorBase.
std::string getNormalizedTypeName()

◆ keyAndIntMethodKit()

template<typename T>
std::pair< std::string, std::pair< std::unique_ptr< IMethodAccessorKit >, TInterpreter::EReturnType > > ExpressionParsing::MethodAccessorFactory::keyAndIntMethodKit ( )
inlinestaticprivate

Definition at line 219 of file MethodAccessor.h.

219 {
220 return std::make_pair(RootUtils::getNormalizedTypeName<T>(),
221 std::make_pair(std::make_unique<MethodAccessorKit<T> >(IProxyLoader::VT_INT,IProxyLoader::VT_VECINT),
222 TInterpreter::EReturnType::kLong));
223 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

◆ m_kits

std::map<std::string, std::pair<std::unique_ptr<IMethodAccessorKit>, TInterpreter::EReturnType> > ExpressionParsing::MethodAccessorFactory::m_kits
private

Definition at line 276 of file MethodAccessor.h.


The documentation for this class was generated from the following file: