Belle II Software development
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
13namespace 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
43 const Connection& operator=(const Connection& connection);
44 const Connection& operator=(const std::string& msg);
45 const Connection& operator=(const char* msg);
46 const Connection& operator=(int i);
47
48 };
49
50 inline bool Connection::operator==(const Connection& st) const
51 {
52 return (getId() == st.getId());
53 }
54
55 inline bool Connection::operator!=(const Connection& st) const
56 {
57 return (getId() != st.getId());
58 }
59
61}
62
63#endif
const Connection & operator=(const Connection &connection)
Operator =.
Definition: Connection.cc:43
Abstract base class for different kinds of events.