LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
home
lsstsw
stack
Linux64
ctrl_events
11.0-2-g68503cd
src
EventFactory.cc
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
3
/*
4
* LSST Data Management System
5
* Copyright 2008-2015 AURA/LSST.
6
*
7
* This product includes software developed by the
8
* LSST Project (http://www.lsst.org/).
9
*
10
* This program is free software: you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation, either version 3 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
19
*
20
* You should have received a copy of the LSST License Statement and
21
* the GNU General Public License along with this program. If not,
22
* see <https://www.lsstcorp.org/LegalNotices/>.
23
*/
24
33
#include <iomanip>
34
#include <sstream>
35
#include <stdexcept>
36
37
#include "
lsst/daf/base/PropertySet.h
"
38
#include "
lsst/pex/exceptions.h
"
39
40
#include "
lsst/ctrl/events/Event.h
"
41
#include "
lsst/ctrl/events/StatusEvent.h
"
42
#include "
lsst/ctrl/events/CommandEvent.h
"
43
#include "
lsst/ctrl/events/LogEvent.h
"
44
#include "
lsst/ctrl/events/EventTypes.h
"
45
46
#include "
lsst/ctrl/events/EventFactory.h
"
47
#include "
lsst/ctrl/events/EventLibrary.h
"
48
49
namespace
pexExceptions =lsst::pex::exceptions;
50
51
using namespace
std;
52
53
namespace
lsst {
54
namespace
ctrl {
55
namespace
events {
56
57
EventFactory::EventFactory() {
58
}
59
60
EventFactory::~EventFactory() {
61
}
62
63
Event
* EventFactory::createEvent(cms::TextMessage* msg) {
64
vector<std::string> names = msg->getPropertyNames();
65
66
std::string _type = msg->getStringProperty(
"TYPE"
);
67
68
if
(_type ==
EventTypes::LOG
) {
69
return
new
LogEvent
(msg);
70
}
else
if
(_type == EventTypes::STATUS) {
71
return
new
StatusEvent
(msg);
72
}
else
if
(_type == EventTypes::COMMAND) {
73
return
new
CommandEvent
(msg);
74
}
75
return
new
Event
(msg);
76
}
77
78
}}}
exceptions.h
Include files required for standard LSST Exception handling.
LOG
#define LOG(logger, level, message...)
Definition:
Log.h:339
lsst::ctrl::events::LogEvent
Representation of an LSST Event.
Definition:
LogEvent.h:64
EventTypes.h
defines EventTypes
lsst::ctrl::events::StatusEvent
Representation of an LSST Event.
Definition:
StatusEvent.h:62
lsst::ctrl::events::CommandEvent
Representation of an LSST CommandEvent.
Definition:
CommandEvent.h:63
EventFactory.h
defines the EventFactory class
EventLibrary.h
defines the EventLibrary class
CommandEvent.h
defines the CommandEvent class
Event.h
defines the Event class
LogEvent.h
defines the LogEvent class
lsst::ctrl::events::Event
Representation of an LSST Event.
Definition:
Event.h:62
StatusEvent.h
defines the StatusEvent class
PropertySet.h
Interface for PropertySet class.
Generated on Thu Sep 24 2015 02:29:18 for LSSTApplications by
1.8.5