The Gaudi Framework  v31r0 (aeb156f0)
extends< BASE, Interfaces > Class Template Reference

Base class used to extend a class implementing other interfaces. More...

#include <GaudiKernel/extends.h>

Inheritance diagram for extends< BASE, Interfaces >:
Collaboration diagram for extends< BASE, Interfaces >:

Public Types

using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces... >
 Typedef to the base of this class. More...
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
 take union of the ext_iids of all Interfaces... More...
 

Public Member Functions

void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 

Detailed Description

template<typename BASE, typename... Interfaces>
class extends< BASE, Interfaces >

Base class used to extend a class implementing other interfaces.

Version for one interface.

Author
Marco Clemencic

Definition at line 10 of file extends.h.

Member Typedef Documentation

template<typename BASE, typename... Interfaces>
using extends< BASE, Interfaces >::base_class = extends

Typedef to this class.

Definition at line 14 of file extends.h.

template<typename BASE, typename... Interfaces>
using extends< BASE, Interfaces >::extend_interfaces_base = extend_interfaces<Interfaces...>

Typedef to the base of this class.

Definition at line 16 of file extends.h.

Member Function Documentation

template<typename BASE, typename... Interfaces>
std::vector<std::string> extends< BASE, Interfaces >::getInterfaceNames ( ) const
inlineoverride

Implementation of IInterface::getInterfaceNames.

Definition at line 39 of file extends.h.

39  {
40  using iids = typename extend_interfaces_base::ext_iids;
41  auto vb = BASE::getInterfaceNames();
42  auto vi = Gaudi::getInterfaceNames( iids{} );
43  // start with base, and move the rest...
44  vb.insert( vb.end(), std::make_move_iterator( vi.begin() ), std::make_move_iterator( vi.end() ) );
45  return vb;
46  }
typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type ext_iids
take union of the ext_iids of all Interfaces...
T make_move_iterator(T...args)
T insert(T...args)
std::vector< std::string > getInterfaceNames(Gaudi::interface_list< Is... >)
Definition: IInterface.h:180
template<typename BASE, typename... Interfaces>
void* extends< BASE, Interfaces >::i_cast ( const InterfaceID tid) const
inlineoverride

Implementation of IInterface::i_cast.

Definition at line 21 of file extends.h.

21  {
22  using iids = typename extend_interfaces_base::ext_iids;
23  void* ptr = Gaudi::iid_cast( tid, iids{}, this );
24  return ptr ? ptr : BASE::i_cast( tid );
25  }
typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type ext_iids
take union of the ext_iids of all Interfaces...
void * iid_cast(const InterfaceID &tid, Gaudi::interface_list< Is... >, P *ptr)
Definition: IInterface.h:185
template<typename BASE, typename... Interfaces>
StatusCode extends< BASE, Interfaces >::queryInterface ( const InterfaceID ti,
void **  pp 
)
inlineoverride

Implementation of IInterface::queryInterface.

Definition at line 28 of file extends.h.

28  {
29  if ( !pp ) return StatusCode::FAILURE;
30  using iids = typename extend_interfaces_base::ext_iids;
31  *pp = Gaudi::iid_cast( ti, iids{}, this );
32  // if cast failed, try the base class
33  if ( !*pp ) return BASE::queryInterface( ti, pp );
34  this->addRef();
35  return StatusCode::SUCCESS;
36  }
typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type ext_iids
take union of the ext_iids of all Interfaces...
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
constexpr static const auto FAILURE
Definition: StatusCode.h:86
StatusCode queryInterface(const InterfaceID &iid, void **pinterface) override
void * iid_cast(const InterfaceID &tid, Gaudi::interface_list< Is... >, P *ptr)
Definition: IInterface.h:185

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