ATLAS Offline Software
Classes | Public Member Functions | Private Attributes | List of all members
ExpressionParsing::MethodHelper< T_Cont, T_src > Class Template Reference

Auxiliary class to handle method calls of "scalar" containers (AuxElement). More...

#include <MethodAccessor.h>

Collaboration diagram for ExpressionParsing::MethodHelper< T_Cont, T_src >:

Classes

class  Kit
 Auxiliary class to create the corresponding auxiliary helper object. More...
 

Public Member Functions

 MethodHelper (const RootUtils::TSMethodCall &method_call, const void *data)
 
std::size_t size (const T_Cont &cont) const
 
T_src get (const T_Cont &) const
 Get the scalar provided by the container. More...
 
T_src get (const T_Cont &, [[maybe_unused]] std::size_t idx) const
 Get the specified element of the vector provided by the container. More...
 

Private Attributes

RootUtils::TSMethodCall m_methodCall ATLAS_THREAD_SAFE
 
const void * m_data
 

Detailed Description

template<class T_Cont, typename T_src>
class ExpressionParsing::MethodHelper< T_Cont, T_src >

Auxiliary class to handle method calls of "scalar" containers (AuxElement).

Definition at line 91 of file MethodAccessor.h.

Constructor & Destructor Documentation

◆ MethodHelper()

template<class T_Cont , typename T_src >
ExpressionParsing::MethodHelper< T_Cont, T_src >::MethodHelper ( const RootUtils::TSMethodCall method_call,
const void *  data 
)
inline

Definition at line 93 of file MethodAccessor.h.

94  : m_methodCall( method_call),
95  m_data(data)
96  {
97  // cppcheck-suppress assertWithSideEffect
98  assert( m_methodCall.call() != nullptr );
99  }

Member Function Documentation

◆ get() [1/2]

template<class T_Cont , typename T_src >
T_src ExpressionParsing::MethodHelper< T_Cont, T_src >::get ( const T_Cont &  ) const
inline

Get the scalar provided by the container.

Definition at line 106 of file MethodAccessor.h.

106  {
107  T_src ret;
108  void* data_nc ATLAS_THREAD_SAFE = const_cast<void *>(m_data); // required by TMethodCall
109  m_methodCall.call()->Execute(data_nc, ret);
110  return ret;
111  }

◆ get() [2/2]

template<class T_Cont , typename T_src >
T_src ExpressionParsing::MethodHelper< T_Cont, T_src >::get ( const T_Cont &  ,
[[maybe_unused] ] std::size_t  idx 
) const
inline

Get the specified element of the vector provided by the container.

Definition at line 114 of file MethodAccessor.h.

114  {
115  T_src ret;
116  assert( idx==0);
117  void* data_nc ATLAS_THREAD_SAFE = const_cast<void *>(m_data); // required by TMethodCall
118  m_methodCall.call()->Execute(data_nc, ret);
119  return ret;
120  }

◆ size()

template<class T_Cont , typename T_src >
std::size_t ExpressionParsing::MethodHelper< T_Cont, T_src >::size ( const T_Cont &  cont) const
inline

Definition at line 101 of file MethodAccessor.h.

101  {
102  return getContainerSize(cont); //@TODO correct ? or 1 ?
103  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

template<class T_Cont , typename T_src >
RootUtils::TSMethodCall m_methodCall ExpressionParsing::MethodHelper< T_Cont, T_src >::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 136 of file MethodAccessor.h.

◆ m_data

template<class T_Cont , typename T_src >
const void* ExpressionParsing::MethodHelper< T_Cont, T_src >::m_data
private

Definition at line 137 of file MethodAccessor.h.


The documentation for this class was generated from the following file:
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
ExpressionParsing::MethodHelper::m_data
const void * m_data
Definition: MethodAccessor.h:137
ExpressionParsing::MethodHelper::ATLAS_THREAD_SAFE
RootUtils::TSMethodCall m_methodCall ATLAS_THREAD_SAFE
Definition: MethodAccessor.h:136
RootUtils::TSMethodCall::call
TMethodCall * call()
Return a pointer to the thread-specific TMethodCall.
Definition: TSMethodCall.cxx:109
ExpressionParsing::getContainerSize
std::size_t getContainerSize(const T &cont)
Definition: PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/Utils.h:73
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69