ATLAS Offline Software
Loading...
Searching...
No Matches
RanSeed.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#ifndef RanSeed_h
7#define RanSeed_h
8
9#include <cstdint>
10
11extern "C" { uintptr_t ranseed_address_(); }
12
19{
20public:
21 RanSeed();
22 ~RanSeed();
23
24 int& nseed (void);
25
26private:
27
28 struct RANSEED;
29 friend struct RANSEED;
30
31 struct RANSEED
32 {
33 int nseed;
34 };
35
37};
38
39// set pointer to zero at start
41
42inline
45
46inline
49
50inline int&
52{
53 if (!s_ranseed) s_ranseed = reinterpret_cast<RANSEED*>(ranseed_address_());
54 return s_ranseed->nseed;
55}
56
57#endif
uintptr_t ranseed_address_()
RanSeed()
Definition RanSeed.h:43
~RanSeed()
Definition RanSeed.h:47
int & nseed(void)
Definition RanSeed.h:51
static RANSEED * s_ranseed
Definition RanSeed.h:36