The Gaudi Framework
v26r4
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
implements.h
Go to the documentation of this file.
1
#ifndef GAUDIKERNEL_IMPLEMENTS_H
2
#define GAUDIKERNEL_IMPLEMENTS_H
3
4
#include "GaudiKernel/IInterface.h"
5
7
template
<
typename
... Interfaces>
8
struct
GAUDI_API
implements
:
virtual
public
extend_interfaces
<Interfaces...> {
10
using
base_class =
implements
<Interfaces...>;
12
using
extend_interfaces_base =
extend_interfaces
<Interfaces...>;
13
using
iids =
typename
extend_interfaces_base::ext_iids;
14
15
public
:
17
void
*i_cast(
const
InterfaceID
&tid)
const override
{
18
return
Gaudi::iid_cast
(tid,iids{},
this
);
19
}
21
StatusCode
queryInterface(
const
InterfaceID
&ti,
void
**
pp
)
override
{
22
if
(!pp)
return
StatusCode::FAILURE
;
23
*pp =
Gaudi::iid_cast
(ti,iids{},
this
);
24
if
(!*pp)
return
StatusCode::FAILURE
;
/* cast failed */
25
this->addRef();
26
return
StatusCode::SUCCESS
;
27
}
29
std::vector<std::string>
getInterfaceNames
()
const override
{
30
return
Gaudi::getInterfaceNames
( iids{} );
31
}
33
implements
() =
default
;
35
implements
(
const
implements
&
/*other*/
) : m_refCount{0} {}
37
implements
& operator=(
const
implements
&
/*other*/
) {
return
*
this
; }
39
~
implements
()
override
=
default
;
40
41
public
:
43
unsigned
long
addRef()
override
{
return
++m_refCount; }
45
unsigned
long
release()
override
{
46
/* Avoid to decrement 0 */
47
auto
count = ( m_refCount ? --m_refCount : m_refCount );
48
if
(count == 0)
delete
this
;
49
return
count;
50
}
52
unsigned
long
refCount()
const override
{
return
m_refCount; }
53
54
protected
:
56
unsigned
long
m_refCount = 0;
57
};
58
59
60
template
<
typename
I1>
using
implements1
=
implements<I1>
;
61
template
<
typename
I1,
62
typename
I2>
using
implements2
=
implements<I1,I2>
;
63
template
<
typename
I1,
64
typename
I2,
65
typename
I3>
using
implements3
=
implements<I1,I2,I3>
;
66
template
<
typename
I1,
67
typename
I2,
68
typename
I3,
69
typename
I4>
using
implements4
=
implements<I1,I2,I3,I4>
;
70
71
#endif
/* GAUDIKERNEL_IMPLEMENTS_H_ */
implements
Base class used to implement the interfaces.
Definition:
implements.h:8
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
Gaudi::iid_cast
void * iid_cast(const InterfaceID &tid, Gaudi::interface_list< Is...>, P *ptr)
Definition:
IInterface.h:182
GaudiKernel
GaudiKernel
implements.h
Generated on Mon Oct 12 2015 16:26:48 for The Gaudi Framework by
1.8.9.1