The Gaudi Framework
v27r0
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
public
:
14
using
base_class =
extends
;
16
using
extend_interfaces_base =
extend_interfaces
<Interfaces...>;
18
using
BASE::BASE;
19
21
void
*i_cast(
const
InterfaceID
&tid)
const override
{
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
}
26
28
StatusCode
queryInterface(
const
InterfaceID
&ti,
void
**
pp
)
override
{
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
}
37
39
std::vector<std::string>
getInterfaceNames
()
const override
{
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(),
45
std::make_move_iterator(vi.begin()),
46
std::make_move_iterator(vi.end()) );
47
return
vb;
48
}
49
51
~
extends
()
override
=
default
;
52
};
53
54
template
<
typename
BASE,
typename
I1>
using
extends1
=
extends<BASE,I1>
;
55
template
<
typename
BASE,
typename
I1,
56
typename
I2>
using
extends2
=
extends<BASE,I1,I2>
;
57
template
<
typename
BASE,
typename
I1,
58
typename
I2,
59
typename
I3>
using
extends3
=
extends<BASE,I1,I2,I3>
;
60
template
<
typename
BASE,
typename
I1,
61
typename
I2,
62
typename
I3,
63
typename
I4>
using
extends4
=
extends<BASE,I1,I2,I3,I4>
;
64
65
#endif
/* GAUDIKERNEL_EXTENDS_H */
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:107
Gaudi::getInterfaceNames
std::vector< std::string > getInterfaceNames(Gaudi::interface_list< Is...>)
Definition:
IInterface.h:177
compareOutputFiles.pp
tuple pp
Definition:
compareOutputFiles.py:417
InterfaceID
Interface ID class.
Definition:
IInterface.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition:
StatusCode.h:26
extend_interfaces
Base class to be used to extend an interface.
Definition:
extend_interfaces.h:11
StatusCode::FAILURE
Definition:
StatusCode.h:29
StatusCode::SUCCESS
Definition:
StatusCode.h:30
extends
Base class used to extend a class implementing other interfaces.
Definition:
extends.h:10
Gaudi::iid_cast
void * iid_cast(const InterfaceID &tid, Gaudi::interface_list< Is...>, P *ptr)
Definition:
IInterface.h:182
GaudiKernel
GaudiKernel
extends.h
Generated on Thu Feb 4 2016 16:42:11 for The Gaudi Framework by
1.8.9.1