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