Belle II Software  release-08-01-10
ERRORNo.cc
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 #include "daq/slc/base/ERRORNo.h"
9 
10 using namespace Belle2;
11 
12 const ERRORNo ERRORNo::UNKNOWN(0, "UNKNOWN");
13 const ERRORNo ERRORNo::NSMONLINE(11, "NSMONLINE");
14 const ERRORNo ERRORNo::NSMSENDREQ(12, "NSMSENDREQ");
15 const ERRORNo ERRORNo::NSMMEMOPEN(13, "SENOPEN");
16 const ERRORNo ERRORNo::NSMINIT(14, "NSMINIT");
17 const ERRORNo ERRORNo::DATABASE(31, "DATABASE");
18 
19 const ERRORNo& ERRORNo::operator=(const std::string& label)
20 {
21  if (label == NSMSENDREQ.getLabel()) {
22  return NSMSENDREQ;
23  } else if (label == NSMONLINE.getLabel()) {
24  return NSMONLINE;
25  } else if (label == NSMMEMOPEN.getLabel()) {
26  return NSMMEMOPEN;
27  } else if (label == NSMINIT.getLabel()) {
28  return NSMINIT;
29  } else if (label == DATABASE.getLabel()) {
30  return DATABASE;
31  } else {
32  return UNKNOWN;
33  }
34 }
35 
36 const ERRORNo& ERRORNo::operator=(int id)
37 {
38  if (id == NSMSENDREQ.getId()) {
39  return NSMSENDREQ;
40  } else if (id == NSMONLINE.getId()) {
41  return NSMONLINE;
42  } else if (id == NSMMEMOPEN.getId()) {
43  return NSMMEMOPEN;
44  } else if (id == NSMINIT.getId()) {
45  return NSMINIT;
46  } else if (id == DATABASE.getId()) {
47  return DATABASE;
48  }
49  return UNKNOWN;
50 }
51 
52 const ERRORNo& ERRORNo::operator=(const char* label)
53 {
54  if (label != nullptr) *this = std::string(label);
55  else *this = Enum::UNKNOWN;
56  return *this;
57 }
58 
Abstract base class for different kinds of events.