LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ScheduleContext.h
Go to the documentation of this file.
1
#ifndef art_Framework_Services_System_ScheduleContext_h
2
#define art_Framework_Services_System_ScheduleContext_h
3
4
#include "
art/Framework/Services/Registry/ServiceMacros.h
"
5
#include "
art/Utilities/ScheduleID.h
"
6
7
#include <atomic>
8
9
namespace
art
{
10
class
ScheduleContext;
11
12
namespace
detail {
13
class
ScheduleContextSetter;
// Forward declaration for friendship.
14
}
15
}
16
17
extern
int
main
();
// Forward declaration for friendship of test.
18
19
class
art::ScheduleContext
{
20
public
:
21
explicit
ScheduleContext
() noexcept =
default
;
22
ScheduleID
currentScheduleID()
const
;
23
24
friend
class
detail::ScheduleContextSetter
;
25
friend
int ::main
();
26
27
private
:
28
bool
setContext();
29
bool
resetContext();
30
31
using
flag_type
=
unsigned
char;
32
std::atomic<flag_type> in_context_{
false
};
33
};
34
35
inline
bool
36
art::ScheduleContext::setContext
()
37
{
38
return
in_context_.fetch_or(
true
);
39
}
40
41
inline
bool
42
art::ScheduleContext::resetContext
()
43
{
44
return
in_context_.fetch_and(
false
);
45
}
46
47
DECLARE_ART_SYSTEM_SERVICE
(
art::ScheduleContext
,
GLOBAL
)
48
#endif
/* art_Framework_Services_System_ScheduleContext_h */
49
50
// Local Variables:
51
// mode: c++
52
// End:
DECLARE_ART_SYSTEM_SERVICE
#define DECLARE_ART_SYSTEM_SERVICE(svc, scope)
Definition:
ServiceMacros.h:141
art::detail::ScheduleContextSetter
Definition:
ScheduleContextSetter.h:13
art::ScheduleContext::flag_type
unsigned char flag_type
Definition:
ScheduleContext.h:31
main
int main()
Definition:
example_main.cc:17
art::ServiceScope::GLOBAL
ServiceMacros.h
art::ScheduleContext
Definition:
ScheduleContext.h:19
art
HLT enums.
Definition:
ServiceProviderWrappers.h:36
art::ScheduleID
Definition:
ScheduleID.h:20
art::ScheduleContext::setContext
bool setContext()
Definition:
ScheduleContext.h:36
art::ScheduleContext::resetContext
bool resetContext()
Definition:
ScheduleContext.h:42
ScheduleID.h
art
Framework
Services
System
ScheduleContext.h
Generated on Thu Jul 26 2018 13:09:43 for LArSoft by
1.8.11