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