interfaceMatch< T > Struct Template Reference

Helper class for the cast used in the MPL for_each algorithm in the implementation of queryInterface. More...

#include </scratch/z5/marcocle/GaudiDocs/lhcb-release/825/GAUDI/GAUDI_v26r3/InstallArea/x86_64-slc6-gcc48-opt/include/GaudiKernel/implements.h>

Collaboration diagram for interfaceMatch< T >:

Public Member Functions

 interfaceMatch (const T *_instance, const InterfaceID &_tid, void *&_ptr)
 
template<typename IID >
void operator() (IID)
 
 interfaceMatch (const T *_instance, const InterfaceID &_tid, void *&_ptr)
 
template<typename IID >
void operator() (IID)
 

Public Attributes

const InterfaceIDtarget
 InterfaceID for the requested interface. More...
 
void *& ptr
 Pointer to be filled. More...
 
const T * instance
 Value of this. More...
 

Detailed Description

template<typename T>
struct interfaceMatch< T >

Helper class for the cast used in the MPL for_each algorithm in the implementation of queryInterface.

Author
Marco Clemencic

Definition at line 11 of file implements.h.

Constructor & Destructor Documentation

template<typename T>
interfaceMatch< T >::interfaceMatch ( const T *  _instance,
const InterfaceID _tid,
void *&  _ptr 
)
inline

Definition at line 18 of file implements.h.

18  :
19  target(_tid),
20  ptr(_ptr),
const T * instance
Value of this.
Definition: implements.h:17
const InterfaceID & target
InterfaceID for the requested interface.
Definition: implements.h:13
void *& ptr
Pointer to be filled.
Definition: implements.h:15
template<typename T>
interfaceMatch< T >::interfaceMatch ( const T *  _instance,
const InterfaceID _tid,
void *&  _ptr 
)
inline

Definition at line 18 of file implements.h.

18  :
19  target(_tid),
20  ptr(_ptr),
const T * instance
Value of this.
Definition: implements.h:17
const InterfaceID & target
InterfaceID for the requested interface.
Definition: implements.h:13
void *& ptr
Pointer to be filled.
Definition: implements.h:15

Member Function Documentation

template<typename T>
template<typename IID >
void interfaceMatch< T >::operator() ( IID  )
inline

Definition at line 24 of file implements.h.

24  {
25  if ((!ptr) && target.versionMatch(IID::interfaceID())) {
26  ptr = const_cast<void*>(reinterpret_cast<const void*>(static_cast<const typename IID::iface_type*>(instance)));
27  }
28  }
const T * instance
Value of this.
Definition: implements.h:17
bool versionMatch(const InterfaceID &iid) const
check compatibility.
Definition: IInterface.h:86
const InterfaceID & target
InterfaceID for the requested interface.
Definition: implements.h:13
void *& ptr
Pointer to be filled.
Definition: implements.h:15
template<typename T>
template<typename IID >
void interfaceMatch< T >::operator() ( IID  )
inline

Definition at line 24 of file implements.h.

24  {
25  if ((!ptr) && target.versionMatch(IID::interfaceID())) {
26  ptr = const_cast<void*>(reinterpret_cast<const void*>(static_cast<const typename IID::iface_type*>(instance)));
27  }
28  }
const T * instance
Value of this.
Definition: implements.h:17
bool versionMatch(const InterfaceID &iid) const
check compatibility.
Definition: IInterface.h:86
const InterfaceID & target
InterfaceID for the requested interface.
Definition: implements.h:13
void *& ptr
Pointer to be filled.
Definition: implements.h:15

Member Data Documentation

template<typename T>
const T * interfaceMatch< T >::instance

Value of this.

Definition at line 17 of file implements.h.

template<typename T>
void *& interfaceMatch< T >::ptr

Pointer to be filled.

Definition at line 15 of file implements.h.

template<typename T>
const InterfaceID & interfaceMatch< T >::target

InterfaceID for the requested interface.

Definition at line 13 of file implements.h.


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