The Gaudi Framework
v30r3 (a5ef0a68)
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
extends.h
Go to the documentation of this file.
1
#ifndef GAUDIKERNEL_EXTENDS_H
2
#define GAUDIKERNEL_EXTENDS_H
3
4
#include "
GaudiKernel/IInterface.h
"
5
9
template
<
typename
BASE,
typename
... Interfaces>
10
class
GAUDI_API
extends
:
public
BASE,
virtual
public
extend_interfaces
<Interfaces...>
11
{
12
13
public
:
15
using
base_class
=
extends
;
17
using
extend_interfaces_base
=
extend_interfaces
<Interfaces...>;
19
using
BASE::BASE;
20
22
void
*
i_cast
(
const
InterfaceID
& tid )
const override
23
{
24
using
iids =
typename
extend_interfaces_base::ext_iids
;
25
void
* ptr =
Gaudi::iid_cast
( tid, iids{}, this );
26
return
ptr ? ptr : BASE::i_cast( tid );
27
}
28
30
StatusCode
queryInterface
(
const
InterfaceID
& ti,
void
**
pp
)
override
31
{
32
if
( !pp )
return
StatusCode::FAILURE
;
33
using
iids =
typename
extend_interfaces_base::ext_iids
;
34
*pp =
Gaudi::iid_cast
( ti, iids{}, this );
35
// if cast failed, try the base class
36
if
( !*pp )
return
BASE::queryInterface
( ti, pp );
37
this->addRef();
38
return
StatusCode::SUCCESS
;
39
}
40
42
std::vector<std::string>
getInterfaceNames
()
const override
43
{
44
using
iids =
typename
extend_interfaces_base::ext_iids
;
45
auto
vb =
BASE::getInterfaceNames
();
46
auto
vi =
Gaudi::getInterfaceNames
( iids{} );
47
// start with base, and move the rest...
48
vb.
insert
( vb.end(),
std::make_move_iterator
( vi.begin() ),
std::make_move_iterator
( vi.end() ) );
49
return
vb;
50
}
51
};
52
53
template
<
typename
BASE,
typename
I1>
54
using
extends1
=
extends<BASE, I1>
;
55
template
<
typename
BASE,
typename
I1,
typename
I2>
56
using
extends2
=
extends<BASE, I1, I2>
;
57
template
<
typename
BASE,
typename
I1,
typename
I2,
typename
I3>
58
using
extends3
=
extends<BASE, I1, I2, I3>
;
59
template
<
typename
BASE,
typename
I1,
typename
I2,
typename
I3,
typename
I4>
60
using
extends4
=
extends<BASE, I1, I2, I3, I4>
;
61
62
#endif
/* GAUDIKERNEL_EXTENDS_H */
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition:
StatusCode.h:88
extend_interfaces< Interfaces... >::ext_iids
typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type ext_iids
take union of the ext_iids of all Interfaces...
Definition:
extend_interfaces.h:16
std::make_move_iterator
T make_move_iterator(T...args)
InterfaceID
Interface ID class.
Definition:
IInterface.h:29
extends::queryInterface
StatusCode queryInterface(const InterfaceID &ti, void **pp) override
Implementation of IInterface::queryInterface.
Definition:
extends.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition:
StatusCode.h:51
extend_interfaces
Base class to be used to extend an interface.
Definition:
extend_interfaces.h:5
extends::getInterfaceNames
std::vector< std::string > getInterfaceNames() const override
Implementation of IInterface::getInterfaceNames.
Definition:
extends.h:42
extends::i_cast
void * i_cast(const InterfaceID &tid) const override
Implementation of IInterface::i_cast.
Definition:
extends.h:22
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition:
StatusCode.h:87
std::vector::insert
T insert(T...args)
std::vector< std::string >
extends
Base class used to extend a class implementing other interfaces.
Definition:
extends.h:10
AlgTool
Base class from which all the concrete tool classes should be derived.
Definition:
AlgTool.h:47
compareOutputFiles.pp
pp
Definition:
compareOutputFiles.py:471
Gaudi::getInterfaceNames
std::vector< std::string > getInterfaceNames(Gaudi::interface_list< Is... >)
Definition:
IInterface.h:206
queryInterface
StatusCode queryInterface(const InterfaceID &iid, void **pinterface) override
Gaudi::iid_cast
void * iid_cast(const InterfaceID &tid, Gaudi::interface_list< Is... >, P *ptr)
Definition:
IInterface.h:212
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:104
IInterface.h
GaudiKernel
GaudiKernel
extends.h
Generated on Wed Aug 1 2018 23:21:02 for The Gaudi Framework by
1.8.11