ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RanSeed.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RanSeed.h
1 
2 #ifndef RanSeed_h
3 #define RanSeed_h
4 
5 extern "C" { void* ranseed_address_(void); }
6 
12 class RanSeed
13 {
14 public:
15  RanSeed();
16  ~RanSeed();
17 
18  int& nseed (void);
19 
20 private:
21 
22  struct RANSEED;
23  friend struct RANSEED;
24 
25  struct RANSEED
26  {
27  int nseed;
28  };
29 
30  static RANSEED* _ranseed;
31 };
32 
33 // set pointer to zero at start
35 
36 inline
38 {}
39 
40 inline
42 {}
43 
44 inline int&
46 {
47  if (!_ranseed) _ranseed = static_cast<RANSEED*>(ranseed_address_());
48  return _ranseed->nseed;
49 }
50 
51 #endif