ATLAS Offline Software
Loading...
Searching...
No Matches
ToTransient.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 ATHCONTAINERSINTERFACES_TOTRANSIENT_H
14#define ATHCONTAINERSINTERFACES_TOTRANSIENT_H
15
16
17class EventContext;
18
19
20namespace SG {
21
22
38template <class T>
40{
41public:
44 using noToTransient = int;
45
46
47 /*
48 * @brief Do post-read processing for object @c o.
49 * @param o The object that was just read.
50 *
51 * The default implementation is a no-op.
52 */
53 static void toTransient (T& /*o*/)
54 {
55 }
56
57
58 /*
59 * @brief Do post-read processing for object @c o.
60 * @param o The object that was just read.
61 * @param ctx The current event context.
62 *
63 * The default implementation is a no-op.
64 */
65 static void toTransient (T& /*o*/, const EventContext& /*ctx*/)
66 {
67 }
68};
69
70
71template <class T, class U>
72constexpr
73bool noToTransient1 (U) { return false; }
74template <class T>
75constexpr
76bool noToTransient1 (int, typename T::noToTransient = typename T::noToTransient()) { return true; }
77
78
82template <class T>
83constexpr
85
86
87} // namespace SG
88
89
90#endif // not ATHCONTAINERSINTERFACES_TOTRANSIENT_H
Define a hook for running code after an object has been read.
Definition ToTransient.h:40
static void toTransient(T &, const EventContext &)
Definition ToTransient.h:65
int noToTransient
This definition flags taht we can skip actually calling toTransient for this type.
Definition ToTransient.h:44
static void toTransient(T &)
Definition ToTransient.h:53
Forward declaration.
constexpr bool noToTransient()
Helper to test if T::noToTransient exists as a typedef.
Definition ToTransient.h:84
constexpr bool noToTransient1(U)
Definition ToTransient.h:73