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

Auxiliary class to handle method calls of vector containers (AuxVectorBase) More...

#include <MethodAccessor.h>

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

Classes

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

Public Member Functions

 CollectionMethodHelper (const RootUtils::TSMethodCall &method_call, const TVirtualCollectionProxy &collection_proxy, const void *data, [[maybe_unused]] unsigned int n_elements)
 
std::size_t size (const T_Cont &) const
 
T_src get (const T_Cont &) const
 Get the scalar provided by the container. More...
 
T_src get (const T_Cont &, 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
 
std::unique_ptr< TVirtualCollectionProxy > m_collectionProxy
 

Detailed Description

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

Auxiliary class to handle method calls of vector containers (AuxVectorBase)

Definition at line 30 of file MethodAccessor.h.

Constructor & Destructor Documentation

◆ CollectionMethodHelper()

template<class T_Cont , typename T_src >
ExpressionParsing::CollectionMethodHelper< T_Cont, T_src >::CollectionMethodHelper ( const RootUtils::TSMethodCall method_call,
const TVirtualCollectionProxy &  collection_proxy,
const void *  data,
[[maybe_unused] ] unsigned int  n_elements 
)
inline

Definition at line 32 of file MethodAccessor.h.

33  : m_methodCall( method_call),
34  m_collectionProxy( collection_proxy.Generate())
35  {
36  // cppcheck-suppress assertWithSideEffect
37  assert( m_methodCall.call() != nullptr );
38  void* data_nc ATLAS_THREAD_SAFE = const_cast<void *>(data); // required by TVirtualCollectionProxy
39  m_collectionProxy->PushProxy(data_nc);
40  assert( m_collectionProxy->Size() == n_elements);
41  }

Member Function Documentation

◆ get() [1/2]

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

Get the scalar provided by the container.

Definition at line 48 of file MethodAccessor.h.

48  {
49  T_src ret;
50  assert( m_collectionProxy->Size() == 1);
51  m_methodCall.call()->Execute((*m_collectionProxy)[0], ret);
52  return ret;
53  }

◆ get() [2/2]

template<class T_Cont , typename T_src >
T_src ExpressionParsing::CollectionMethodHelper< T_Cont, T_src >::get ( const T_Cont &  ,
std::size_t  idx 
) const
inline

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

Definition at line 56 of file MethodAccessor.h.

56  {
57  T_src ret;
58  void *element_data=(*m_collectionProxy)[idx];
59  m_methodCall.call()->Execute(element_data, ret);
60  return ret;
61  }

◆ size()

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

Definition at line 43 of file MethodAccessor.h.

43  {
44  return m_collectionProxy->Size();
45  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

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

Definition at line 84 of file MethodAccessor.h.

◆ m_collectionProxy

template<class T_Cont , typename T_src >
std::unique_ptr<TVirtualCollectionProxy> ExpressionParsing::CollectionMethodHelper< T_Cont, T_src >::m_collectionProxy
private

Definition at line 85 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::CollectionMethodHelper::m_collectionProxy
std::unique_ptr< TVirtualCollectionProxy > m_collectionProxy
Definition: MethodAccessor.h:85
ret
T ret(T t)
Definition: rootspy.cxx:260
ExpressionParsing::CollectionMethodHelper::ATLAS_THREAD_SAFE
RootUtils::TSMethodCall m_methodCall ATLAS_THREAD_SAFE
Definition: MethodAccessor.h:84
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69