00001 00002 // $Id: ConsumerID.h,v 1.4 2011/03/07 15:31:31 mommsen Exp $ 00004 00005 #ifndef EventFilter_StorageManager_ConsumerID_h 00006 #define EventFilter_StorageManager_ConsumerID_h 00007 00008 #include <cstddef> 00009 #include <iostream> 00010 00011 #include "EventFilter/StorageManager/interface/EnquingPolicyTag.h" 00012 00013 namespace stor { 00014 00023 struct ConsumerID 00024 { 00025 unsigned int value; 00026 00027 explicit ConsumerID(unsigned int id = 0) : value(id) { } 00028 00029 00034 bool isValid() const { return value != 0; } 00035 00040 bool operator< (ConsumerID other) const { return value < other.value; } 00041 00045 bool operator==(ConsumerID other) const { return value == other.value; } 00046 00050 bool operator!=(ConsumerID other) const { return value != other.value; } 00051 00056 ConsumerID& operator++() { ++value; return *this; } 00057 00062 ConsumerID operator++(int) {ConsumerID ret(*this); ++value; return ret;} 00063 }; 00064 00065 00066 00067 inline 00068 std::ostream& 00069 operator<< ( std::ostream& os, ConsumerID id) 00070 { 00071 return os << id.value; 00072 } 00073 00074 } // namespace stor 00075 00076 #endif // EventFilter_StorageManager_ConsumerID_h 00077 00078