CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EDGetToken.h
Go to the documentation of this file.
1 #ifndef FWCore_Utilities_EDGetToken_h
2 #define FWCore_Utilities_EDGetToken_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Utilities
6 // Class : EDGetToken
7 //
20 //
21 // Original Author: Chris Jones
22 // Created: Wed, 03 Apr 2013 17:54:11 GMT
23 // $Id: EDGetToken.h,v 1.3 2013/06/04 15:07:14 wdd Exp $
24 //
25 
26 // system include files
27 
28 // user include files
29 
30 // forward declarations
31 namespace edm {
32  class EDConsumerBase;
33  template <typename T> class EDGetTokenT;
34 
35  class EDGetToken
36  {
37  friend class EDConsumerBase;
38 
39  public:
40 
42 
43  template<typename T>
45 
46  // ---------- const member functions ---------------------
47  unsigned int index() const {return m_value & s_indexMask;}
48  bool willSkipCurrentProcess() const { return 0 != (m_value & s_skipMask); }
49  bool isUnitialized() const { return m_value == s_uninitializedValue; }
50 
51  private:
52 
53  static const unsigned int s_uninitializedValue = 0xFFFFFFFF;
54  static const unsigned int s_indexMask = 0x7FFFFFFF;
55  static const unsigned int s_skipMask = 1U << 31;
56 
57  explicit EDGetToken(unsigned int iValue, bool skipCurrentProcess) : m_value{(iValue & s_indexMask) | (skipCurrentProcess ? s_skipMask : 0)} { }
58 
59  // ---------- member data --------------------------------
60  unsigned int m_value;
61  };
62 
63  template<typename T>
64  class EDGetTokenT
65  {
66  friend class EDConsumerBase;
67  friend class EDGetToken;
68 
69  public:
70 
72 
73  // ---------- const member functions ---------------------
74  unsigned int index() const {return m_value & s_indexMask;}
75  bool willSkipCurrentProcess() const { return 0 != (m_value & s_skipMask); }
76  bool isUnitialized() const { return m_value == s_uninitializedValue; }
77 
78  private:
79 
80  static const unsigned int s_uninitializedValue = 0xFFFFFFFF;
81  static const unsigned int s_indexMask = 0x7FFFFFFF;
82  static const unsigned int s_skipMask = 1U << 31;
83 
84  explicit EDGetTokenT(unsigned int iValue, bool skipCurrentProcess) : m_value{(iValue & s_indexMask) | (skipCurrentProcess ? s_skipMask : 0)} { }
85 
86  // ---------- member data --------------------------------
87  unsigned int m_value;
88  };
89 }
90 
91 #endif
static const unsigned int s_uninitializedValue
Definition: EDGetToken.h:53
unsigned int index() const
Definition: EDGetToken.h:74
bool willSkipCurrentProcess() const
Definition: EDGetToken.h:75
static const unsigned int s_indexMask
Definition: EDGetToken.h:54
static const unsigned int s_uninitializedValue
Definition: EDGetToken.h:80
static const unsigned int s_indexMask
Definition: EDGetToken.h:81
bool isUnitialized() const
Definition: EDGetToken.h:76
bool willSkipCurrentProcess() const
Definition: EDGetToken.h:48
unsigned int m_value
Definition: EDGetToken.h:60
EDGetToken(EDGetTokenT< T > iOther)
Definition: EDGetToken.h:44
unsigned int m_value
Definition: EDGetToken.h:87
static const unsigned int s_skipMask
Definition: EDGetToken.h:55
bool isUnitialized() const
Definition: EDGetToken.h:49
EDGetTokenT(unsigned int iValue, bool skipCurrentProcess)
Definition: EDGetToken.h:84
EDGetToken(unsigned int iValue, bool skipCurrentProcess)
Definition: EDGetToken.h:57
static const unsigned int s_skipMask
Definition: EDGetToken.h:82
unsigned int index() const
Definition: EDGetToken.h:47