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 {
18
19 class Connection : public Enum {
20
21 public:
22 static const Connection ONLINE;
23 static const Connection OFFLINE;
24
25 public:
26 Connection();
27 // cppcheck-suppress noExplicitConstructor ; implicit conversion is part of the Enum-style API
28 Connection(const Enum& st) ;
29 Connection(const Connection& st) ;
30 explicit Connection(const std::string& st) { *this = st; }
31 explicit Connection(int id) { *this = id; }
32 ~Connection() ;
33
34 private:
35 Connection(int id, const char* label);
36
37 public:
38 bool operator==(const Connection& st) const;
39 bool operator!=(const Connection& st) const;
40
44 const Connection& operator=(const Connection& connection);
45 const Connection& operator=(const std::string& msg);
46 const Connection& operator=(const char* msg);
47 const Connection& operator=(int i);
48
49 };
50
51 inline bool Connection::operator==(const Connection& st) const
52 {
53 return (getId() == st.getId());
54 }
55
56 inline bool Connection::operator!=(const Connection& st) const
57 {
58 return (getId() != st.getId());
59 }
60
62}
63
64#endif
const Connection & operator=(const Connection &connection)
Operator =.
Definition Connection.cc:43
Abstract base class for different kinds of events.