ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaKernel
AthenaKernel
TopBase.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
/*
3
* Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration.
4
*/
11
12
13
#ifndef ATHENAKERNEL_TOPBASE_H
14
#define ATHENAKERNEL_TOPBASE_H
15
16
17
#include "
AthenaKernel/BaseInfo.h
"
18
#include "
AthenaKernel/tools/safe_clid.h
"
19
#include <type_traits>
20
21
22
namespace
SG
{
23
24
44
template
<
class
T>
45
struct
TopBase
46
{
47
using
Base1
=
typename
SG::Bases<T>::bases::Base1;
48
static
const
bool
has_base
= !std::is_same<Base1, SG::NoBase>::value;
49
static
const
bool
base_has_clid
=
SG::safe_clid<Base1>
();
50
using
type
=
typename
std::conditional<
has_base
&&
base_has_clid
,
51
typename
TopBase<Base1>::type
,
52
T>
::type
;
53
};
54
55
56
template
<>
57
struct
TopBase
<
SG
::
NoBase
>
58
{
59
using
type
= SG::NoBase;
60
};
61
62
63
}
// namespace SG
64
65
66
#endif
// not ATHENAKERNEL_TOPBASE_H
BaseInfo.h
Provide an interface for finding inheritance information at run time.
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::safe_clid
constexpr CLID safe_clid()
Return the class ID of T, or CLID_NULL if it doesn't have one.
safe_clid.h
Find the class ID of a type, without triggering an error if it isn't defined.
NoBase
Marker to indicate a nonexistent base class.
Definition
Bases.h:68
SG::TopBase< SG::NoBase >::type
SG::NoBase type
Definition
TopBase.h:59
SG::TopBase
Calculate topmost base accessible via SG_BASES that also has a defined CLID.
Definition
TopBase.h:46
SG::TopBase::Base1
typename SG::Bases< T >::bases::Base1 Base1
Definition
TopBase.h:47
SG::TopBase::type
typename std::conditional< has_base &&base_has_clid, typename TopBase< Base1 >::type, T >::type type
Definition
TopBase.h:50
SG::type::has_base
static const bool has_base
Definition
TopBase.h:48
SG::type::base_has_clid
static const bool base_has_clid
Definition
TopBase.h:49
Generated on
for ATLAS Offline Software by
1.17.0