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()) *this = NSMSENDREQ;
22 else if (label == NSMONLINE.getLabel()) *this = NSMONLINE;
23 else if (label == NSMMEMOPEN.getLabel()) *this = NSMMEMOPEN;
24 else if (label == NSMINIT.getLabel()) *this = NSMINIT;
25 else if (label == DATABASE.getLabel()) *this = DATABASE;
26 else *this = UNKNOWN;
27 return *this;
28}
29
30const ERRORNo& ERRORNo::operator=(int id)
31{
32 if (id == NSMSENDREQ.getId()) *this = NSMSENDREQ;
33 else if (id == NSMONLINE.getId()) *this = NSMONLINE;
34 else if (id == NSMMEMOPEN.getId()) *this = NSMMEMOPEN;
35 else if (id == NSMINIT.getId()) *this = NSMINIT;
36 else if (id == DATABASE.getId()) *this = DATABASE;
37 else *this = UNKNOWN;
38 return *this;
39}
40
41const ERRORNo& ERRORNo::operator=(const char* label)
42{
43 if (label != nullptr) *this = std::string(label);
44 else *this = Enum::UNKNOWN;
45 return *this;
46}
47
Abstract base class for different kinds of events.