The Gaudi Framework
master (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
extends.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
#include <
GaudiKernel/IInterface.h
>
14
18
template
<
typename
BASE,
typename
... Interfaces>
19
class
GAUDI_API
extends
:
public
BASE,
virtual
public
extend_interfaces
<Interfaces...> {
20
21
public
:
23
using
base_class
=
extends
;
25
using
extend_interfaces_base
=
extend_interfaces
<Interfaces...>;
27
using
BASE::BASE;
28
29
using
extend_interfaces_base::i_cast;
30
32
void
const
*
i_cast
(
const
InterfaceID
& tid )
const override
{
33
using
iids =
typename
extend_interfaces_base::ext_iids
;
34
void
* ptr =
Gaudi::iid_cast
( tid, iids{}, this );
35
return
ptr ? ptr : BASE::i_cast( tid );
36
}
37
39
StatusCode
queryInterface
(
const
InterfaceID
& ti,
void
** pp )
override
{
40
if
( !pp )
return
StatusCode::FAILURE
;
41
*pp =
i_cast
( ti );
42
// if cast failed, try the base class
43
if
( !*pp )
return
BASE::queryInterface( ti, pp );
44
this->addRef();
45
return
StatusCode::SUCCESS
;
46
}
47
49
std::vector<std::string>
getInterfaceNames
()
const override
{
50
using
iids =
typename
extend_interfaces_base::ext_iids
;
51
auto
vb = BASE::getInterfaceNames();
52
auto
vi =
Gaudi::getInterfaceNames
( iids{} );
53
// start with base, and move the rest...
54
vb.insert( vb.end(), std::make_move_iterator( vi.begin() ), std::make_move_iterator( vi.end() ) );
55
return
vb;
56
}
57
};
58
59
template
<
typename
BASE,
typename
I1>
60
using
extends1
=
extends<BASE, I1>
;
61
template
<
typename
BASE,
typename
I1,
typename
I2>
62
using
extends2
=
extends<BASE, I1, I2>
;
63
template
<
typename
BASE,
typename
I1,
typename
I2,
typename
I3>
64
using
extends3
=
extends<BASE, I1, I2, I3>
;
65
template
<
typename
BASE,
typename
I1,
typename
I2,
typename
I3,
typename
I4>
66
using
extends4
=
extends<BASE, I1, I2, I3, I4>
;
IInterface.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
InterfaceID
Interface ID class.
Definition
IInterface.h:38
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition
StatusCode.h:99
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition
StatusCode.h:100
extends
Base class used to extend a class implementing other interfaces.
Definition
extends.h:19
extends::i_cast
void const * i_cast(const InterfaceID &tid) const override
Implementation of IInterface::i_cast.
Definition
extends.h:32
extends< BASE, IFSMCallbackHolder >::extend_interfaces_base
extend_interfaces< Interfaces... > extend_interfaces_base
Definition
extends.h:25
extends::queryInterface
StatusCode queryInterface(const InterfaceID &ti, void **pp) override
Implementation of IInterface::queryInterface.
Definition
extends.h:39
extends< BASE, IFSMCallbackHolder >::base_class
extends base_class
Definition
extends.h:23
extends::getInterfaceNames
std::vector< std::string > getInterfaceNames() const override
Implementation of IInterface::getInterfaceNames.
Definition
extends.h:49
extends3
extends< BASE, I1, I2, I3 > extends3
Definition
extends.h:64
extends2
extends< BASE, I1, I2 > extends2
Definition
extends.h:62
extends4
extends< BASE, I1, I2, I3, I4 > extends4
Definition
extends.h:66
extends1
extends< BASE, I1 > extends1
Definition
extends.h:60
Gaudi::iid_cast
void * iid_cast(const InterfaceID &tid, Gaudi::interface_list< Is... >, P *ptr)
Definition
IInterface.h:163
Gaudi::getInterfaceNames
std::vector< std::string > getInterfaceNames(Gaudi::interface_list< Is... >)
Definition
IInterface.h:158
extend_interfaces
Base class to be used to extend an interface.
Definition
extend_interfaces.h:23
extend_interfaces< Interfaces... >::ext_iids
typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type ext_iids
Definition
extend_interfaces.h:25
GaudiKernel
include
GaudiKernel
extends.h
Generated on
for The Gaudi Framework by
1.17.0