Belle II Software development
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
10using namespace Belle2;
11
12const ERRORNo ERRORNo::UNKNOWN(0, "UNKNOWN");
13const ERRORNo ERRORNo::NSMONLINE(11, "NSMONLINE");
14const ERRORNo ERRORNo::NSMSENDREQ(12, "NSMSENDREQ");
15const ERRORNo ERRORNo::NSMMEMOPEN(13, "SENOPEN");
16const ERRORNo ERRORNo::NSMINIT(14, "NSMINIT");
17const ERRORNo ERRORNo::DATABASE(31, "DATABASE");
18
19const 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
36const 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
52const 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.