ATLAS Offline Software
supportsThinning.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-2019 CERN for the benefit of the ATLAS collaboration
4  */
22 #ifndef ATHCONTAINERS_SUPPORTSTHINNING_H
23 #define ATHCONTAINERS_SUPPORTSTHINNING_H
24 
25 
29 #include <type_traits>
30 
31 
32 namespace SG {
33 
34 
43 template <class T>
44 inline constexpr bool is_xAODInterfaceObject_v =
45  std::is_base_of_v<SG::AuxVectorBase, T> || std::is_base_of_v<SG::AuxElement, T>;
46 template <class T,
47  typename std::enable_if_t<is_xAODInterfaceObject_v<T> >* = nullptr>
48 bool constexpr xAODInterfaceSupportingThinning () { return T::supportsThinning; }
49 template <class T,
50  typename std::enable_if_t<!is_xAODInterfaceObject_v<T> >* = nullptr>
51 bool constexpr xAODInterfaceSupportingThinning () { return false; }
52 
53 
62 template <class T>
63 inline constexpr bool is_xAODStoreObject_v =
64  std::is_base_of_v<SG::IAuxStore, T>;
65 template <class T,
66  typename std::enable_if_t<is_xAODStoreObject_v<T> >* = nullptr>
67 bool constexpr xAODStoreSupportingThinning () { return T::supportsThinning; }
68 template <class T,
69  typename std::enable_if_t<!is_xAODStoreObject_v<T> >* = nullptr>
70 bool constexpr xAODStoreSupportingThinning () { return false; }
71 
72 
73 } // namespace SG
74 
75 
76 #endif // not ATHCONTAINERS_SUPPORTSTHINNING_H
SG::is_xAODStoreObject_v
constexpr bool is_xAODStoreObject_v
Test for an xAOD auxiliary store class supporting thinning.
Definition: supportsThinning.h:63
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
AuxVectorBase.h
Manage index tracking and synchronization of auxiliary data.
SG::xAODInterfaceSupportingThinning
constexpr bool xAODInterfaceSupportingThinning()
Definition: supportsThinning.h:48
SG::xAODStoreSupportingThinning
constexpr bool xAODStoreSupportingThinning()
Definition: supportsThinning.h:67
SG::is_xAODInterfaceObject_v
constexpr bool is_xAODInterfaceObject_v
Test for an xAOD interface class supporting thinning.
Definition: supportsThinning.h:44
IAuxStore.h
Interface for non-const operations on an auxiliary store.
AuxElement.h
Base class for elements of a container that can have aux data.