Belle II Software  release-05-01-25
NSMCommand.cc
1 #include "daq/slc/nsm/NSMCommand.h"
2 
3 using namespace Belle2;
4 
5 const NSMCommand NSMCommand::OK(1, "OK");
6 const NSMCommand NSMCommand::ERROR(2, "ERROR");
7 const NSMCommand NSMCommand::FATAL(3, "FATAL");
8 const NSMCommand NSMCommand::STATE(4, "STATE");
9 const NSMCommand NSMCommand::LOG(5, "LOG");
10 const NSMCommand NSMCommand::LOGSET(6, "LOGSET");
11 const NSMCommand NSMCommand::LOGGET(7, "LOGGET");
12 const NSMCommand NSMCommand::VGET(11, "VGET");
13 const NSMCommand NSMCommand::VSET(12, "VSET");
14 const NSMCommand NSMCommand::VREPLY(13, "VREPLY");
15 const NSMCommand NSMCommand::VLISTGET(14, "VLISTGET");
16 const NSMCommand NSMCommand::VLISTSET(15, "VLISTSET");
17 const NSMCommand NSMCommand::DATAGET(401, "DATAGET");
18 const NSMCommand NSMCommand::DATASET(402, "DATASET");
19 const NSMCommand NSMCommand::DBSET(403, "DBSET");
20 const NSMCommand NSMCommand::DBGET(404, "DBGET");
21 const NSMCommand NSMCommand::DBLISTSET(405, "DBLISTSET");
22 const NSMCommand NSMCommand::DBLISTGET(406, "DBLISTGET");
23 const NSMCommand NSMCommand::LOGLIST(407, "LOGLIST");
24 
25 const NSMCommand& NSMCommand::operator=(const std::string& label)
26 {
27  if (label == LOG.getLabel()) *this = LOG;
28  else if (label == OK.getLabel()) *this = OK;
29  else if (label == ERROR.getLabel()) *this = ERROR;
30  else if (label == FATAL.getLabel()) *this = FATAL;
31  else if (label == LOG.getLabel()) *this = LOG;
32  else if (label == LOGSET.getLabel()) *this = LOGSET;
33  else if (label == LOGGET.getLabel()) *this = LOGGET;
34  else if (label == STATE.getLabel()) *this = STATE;
35  else if (label == VGET.getLabel()) *this = VGET;
36  else if (label == VSET.getLabel()) *this = VSET;
37  else if (label == VREPLY.getLabel()) *this = VREPLY;
38  else if (label == VLISTGET.getLabel()) *this = VLISTGET;
39  else if (label == VLISTSET.getLabel()) *this = VLISTSET;
40  else if (label == DATAGET.getLabel()) *this = DATAGET;
41  else if (label == DATASET.getLabel()) *this = DATASET;
42  else if (label == DBSET.getLabel()) *this = DBSET;
43  else if (label == DBGET.getLabel()) *this = DBGET;
44  else if (label == DBLISTSET.getLabel()) *this = DBLISTSET;
45  else if (label == DBLISTGET.getLabel()) *this = DBLISTGET;
46  else if (label == LOGLIST.getLabel()) *this = LOGLIST;
47  else *this = Enum::UNKNOWN;
48  return *this;
49 }
50 
51 const NSMCommand& NSMCommand::operator=(int id)
52 {
53  if (id == LOG.getId()) *this = LOG;
54  else if (id == OK.getId()) *this = OK;
55  else if (id == ERROR.getId()) *this = ERROR;
56  else if (id == FATAL.getId()) *this = FATAL;
57  else if (id == LOG.getId()) *this = LOG;
58  else if (id == LOGSET.getId()) *this = LOGSET;
59  else if (id == LOGGET.getId()) *this = LOGGET;
60  else if (id == STATE.getId()) *this = STATE;
61  else if (id == VSET.getId()) *this = VSET;
62  else if (id == VGET.getId()) *this = VGET;
63  else if (id == VREPLY.getId()) *this = VREPLY;
64  else if (id == VLISTSET.getId()) *this = VLISTSET;
65  else if (id == VLISTGET.getId()) *this = VLISTGET;
66  else if (id == DATASET.getId()) *this = DATASET;
67  else if (id == DATAGET.getId()) *this = DATAGET;
68  else if (id == DBSET.getId()) *this = DBSET;
69  else if (id == DBGET.getId()) *this = DBGET;
70  else if (id == DBLISTSET.getId()) *this = DBLISTSET;
71  else if (id == DBLISTGET.getId()) *this = DBLISTGET;
72  else if (id == LOGLIST.getId()) *this = LOGLIST;
73  else *this = Enum::UNKNOWN;
74  return *this;
75 }
76 
77 const NSMCommand& NSMCommand::operator=(const char* label)
78 {
79  if (label != NULL) *this = std::string(label);
80  else *this = Enum::UNKNOWN;
81  return *this;
82 }
83 
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::NSMCommand
Definition: NSMCommand.h:12