Go to the documentation of this file.00001 #ifndef FWCore_Utilities_EDGetToken_h
00002 #define FWCore_Utilities_EDGetToken_h
00003
00004
00005
00006
00007
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 namespace edm {
00032 class EDConsumerBase;
00033 template <typename T> class EDGetTokenT;
00034
00035 class EDGetToken
00036 {
00037 friend class EDConsumerBase;
00038
00039 public:
00040
00041 EDGetToken() : m_value{s_uninitializedValue} {}
00042
00043 template<typename T>
00044 EDGetToken(EDGetTokenT<T> iOther): m_value{iOther.m_value} {}
00045
00046
00047 unsigned int index() const {return m_value & s_indexMask;}
00048 bool willSkipCurrentProcess() const { return 0 != (m_value & s_skipMask); }
00049 bool isUnitialized() const { return m_value == s_uninitializedValue; }
00050
00051 private:
00052
00053 static const unsigned int s_uninitializedValue = 0xFFFFFFFF;
00054 static const unsigned int s_indexMask = 0x7FFFFFFF;
00055 static const unsigned int s_skipMask = 1U << 31;
00056
00057 explicit EDGetToken(unsigned int iValue, bool skipCurrentProcess) : m_value{(iValue & s_indexMask) | (skipCurrentProcess ? s_skipMask : 0)} { }
00058
00059
00060 unsigned int m_value;
00061 };
00062
00063 template<typename T>
00064 class EDGetTokenT
00065 {
00066 friend class EDConsumerBase;
00067 friend class EDGetToken;
00068
00069 public:
00070
00071 EDGetTokenT() : m_value{s_uninitializedValue} {}
00072
00073
00074 unsigned int index() const {return m_value & s_indexMask;}
00075 bool willSkipCurrentProcess() const { return 0 != (m_value & s_skipMask); }
00076 bool isUnitialized() const { return m_value == s_uninitializedValue; }
00077
00078 private:
00079
00080 static const unsigned int s_uninitializedValue = 0xFFFFFFFF;
00081 static const unsigned int s_indexMask = 0x7FFFFFFF;
00082 static const unsigned int s_skipMask = 1U << 31;
00083
00084 explicit EDGetTokenT(unsigned int iValue, bool skipCurrentProcess) : m_value{(iValue & s_indexMask) | (skipCurrentProcess ? s_skipMask : 0)} { }
00085
00086
00087 unsigned int m_value;
00088 };
00089 }
00090
00091 #endif