CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConnectionID.h
Go to the documentation of this file.
1 // $Id: ConnectionID.h,v 1.2 2011/03/07 15:41:54 mommsen Exp $
3 
4 #ifndef EventFilter_StorageManager_ConnectionID_h
5 #define EventFilter_StorageManager_ConnectionID_h
6 
7 #include <cstddef>
8 #include <iostream>
9 
10 namespace smproxy {
11 
20  struct ConnectionID
21  {
22  unsigned int value;
23 
24  explicit ConnectionID(unsigned int id = 0) : value(id) { }
25 
26 
30  bool isValid() const { return value != 0; }
31 
36  bool operator< (ConnectionID other) const { return value < other.value; }
37 
41  bool operator==(ConnectionID other) const { return value == other.value; }
42 
46  bool operator!=(ConnectionID other) const { return value != other.value; }
47 
52  ConnectionID& operator++() { ++value; return *this; }
53 
58  ConnectionID operator++(int) {ConnectionID ret(*this); ++value; return ret;}
59  };
60 
61 
62 
63  inline
64  std::ostream&
65  operator<< ( std::ostream& os, ConnectionID id)
66  {
67  return os << id.value;
68  }
69 
70 } // namespace smproxy
71 
72 #endif // EventFilter_StorageManager_ConnectionID_h
73 
74 
std::ostream & operator<<(std::ostream &os, ConnectionID id)
Definition: ConnectionID.h:65
ConnectionID operator++(int)
Definition: ConnectionID.h:58
ConnectionID(unsigned int id=0)
Definition: ConnectionID.h:24
bool operator!=(ConnectionID other) const
Definition: ConnectionID.h:46
bool operator==(ConnectionID other) const
Definition: ConnectionID.h:41
unsigned int value
Definition: ConnectionID.h:22
ConnectionID & operator++()
Definition: ConnectionID.h:52
bool isValid() const
Definition: ConnectionID.h:30
bool operator<(ConnectionID other) const
Definition: ConnectionID.h:36