Belle II Software  release-06-00-14
Connection.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #ifndef _Belle2_Connection_hh
9 #define _Belle2_Connection_hh
10 
11 #include "daq/slc/base/Enum.h"
12 
13 namespace Belle2 {
19  class Connection : public Enum {
20 
21  public:
22  static const Connection ONLINE;
23  static const Connection OFFLINE;
24 
25  public:
26  Connection();
27  Connection(const Enum& st) ;
28  Connection(const Connection& st) ;
29  Connection(const std::string& st) { *this = st; }
30  Connection(int id) { *this = id; }
31  ~Connection() ;
32 
33  private:
34  Connection(int id, const char* label);
35 
36  public:
37  bool operator==(const Connection& st) const;
38  bool operator!=(const Connection& st) const;
39  const Connection& operator=(const std::string& msg);
40  const Connection& operator=(const char* msg);
41  const Connection& operator=(int i);
42 
43  };
44 
45  inline bool Connection::operator==(const Connection& st) const
46  {
47  return (getId() == st.getId());
48  }
49 
50  inline bool Connection::operator!=(const Connection& st) const
51  {
52  return (getId() != st.getId());
53  }
54 
56 }
57 
58 #endif
Abstract base class for different kinds of events.