CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConsumerID.h
Go to the documentation of this file.
1 
2 // $Id: ConsumerID.h,v 1.4 2011/03/07 15:31:31 mommsen Exp $
4 
5 #ifndef EventFilter_StorageManager_ConsumerID_h
6 #define EventFilter_StorageManager_ConsumerID_h
7 
8 #include <cstddef>
9 #include <iostream>
10 
12 
13 namespace stor {
14 
23  struct ConsumerID
24  {
25  unsigned int value;
26 
27  explicit ConsumerID(unsigned int id = 0) : value(id) { }
28 
29 
34  bool isValid() const { return value != 0; }
35 
40  bool operator< (ConsumerID other) const { return value < other.value; }
41 
45  bool operator==(ConsumerID other) const { return value == other.value; }
46 
50  bool operator!=(ConsumerID other) const { return value != other.value; }
51 
56  ConsumerID& operator++() { ++value; return *this; }
57 
62  ConsumerID operator++(int) {ConsumerID ret(*this); ++value; return ret;}
63  };
64 
65 
66 
67  inline
68  std::ostream&
69  operator<< ( std::ostream& os, ConsumerID id)
70  {
71  return os << id.value;
72  }
73 
74 } // namespace stor
75 
76 #endif // EventFilter_StorageManager_ConsumerID_h
77 
78 
unsigned int value
Definition: ConsumerID.h:25
ConsumerID(unsigned int id=0)
Definition: ConsumerID.h:27
std::ostream & operator<<(std::ostream &os, ConsumerID id)
Definition: ConsumerID.h:69
bool operator<(ConsumerID other) const
Definition: ConsumerID.h:40
ConsumerID operator++(int)
Definition: ConsumerID.h:62
bool operator!=(ConsumerID other) const
Definition: ConsumerID.h:50
bool operator==(ConsumerID other) const
Definition: ConsumerID.h:45
ConsumerID & operator++()
Definition: ConsumerID.h:56
bool isValid() const
Definition: ConsumerID.h:34