ATLAS Offline Software
Loading...
Searching...
No Matches
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
19#include <type_traits>
20
21
22namespace SG {
23
24
44template <class T>
45struct TopBase
46{
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
56template <>
58{
60};
61
62
63} // namespace SG
64
65
66#endif // not ATHENAKERNEL_TOPBASE_H
Provide an interface for finding inheritance information at run time.
Forward declaration.
constexpr CLID safe_clid()
Return the class ID of T, or CLID_NULL if it doesn't have one.
Find the class ID of a type, without triggering an error if it isn't defined.
NoBase Base1
Definition Bases.h:82
Marker to indicate a nonexistent base class.
Definition Bases.h:68
Calculate topmost base accessible via SG_BASES that also has a defined CLID.
Definition TopBase.h:46
typename std::conditional< has_base &&base_has_clid, typename TopBase< Base1 >::type, T >::type type
Definition TopBase.h:50
typename SG::Bases< T >::bases::Base1 Base1
Definition TopBase.h:47
static const bool has_base
Definition TopBase.h:48
static const bool base_has_clid
Definition TopBase.h:49