ATLAS Offline Software
Loading...
Searching...
No Matches
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, 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.
T_src get (const T_Cont &, std::size_t idx) const
 Get the specified element of the vector provided by the container.

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,
unsigned int n_elements )
inline

Definition at line 32 of file MethodAccessor.h.

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);
41 }
Auxiliary class to handle method calls of vector containers (AuxVectorBase)
std::unique_ptr< TVirtualCollectionProxy > m_collectionProxy
RootUtils::TSMethodCall m_methodCall ATLAS_THREAD_SAFE

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: