LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
lsst::ctrl::events::StatusEvent Class Reference

Representation of an LSST Event. More...

#include <StatusEvent.h>

Inheritance diagram for lsst::ctrl::events::StatusEvent:
lsst::ctrl::events::Event

Public Member Functions

 StatusEvent ()
 Constructor to create a StatusEvent. More...
 
virtual ~StatusEvent ()
 
 StatusEvent (cms::TextMessage *msg)
 Constructor to convert a TextMessage into a StatusEvent. More...
 
 StatusEvent (LocationId const &originator, PropertySet const &ps)
 Constructor to create a StatusEvent. More...
 
 StatusEvent (LocationId const &originator, PropertySet const &ps, PropertySet const &filterable)
 Constructor to create a StatusEvent. More...
 
 StatusEvent (std::string const &runid, LocationId const &originator, PropertySet const &ps)
 Constructor to create a StatusEvent. More...
 
 StatusEvent (std::string const &runid, LocationId const &originator, PropertySet const &ps, PropertySet const &filterable)
 Constructor to create a StatusEvent. More...
 
 StatusEvent (std::string const &runid, LocationId const &originator, PropertySet::Ptr const psp)
 Constructor to create a StatusEvent. More...
 
 StatusEvent (std::string const &runid, LocationId const &originator, PropertySet::Ptr const psp, PropertySet const &filterable)
 Constructor to create a StatusEvent. More...
 
LocationIdgetOriginator ()
 accessor to get originator information More...
 
- Public Member Functions inherited from lsst::ctrl::events::Event
 Event ()
 Constructor for Event with no properties. More...
 
 Event (PropertySet const &properties)
 Constructor for Event. More...
 
 Event (PropertySet const &properties, PropertySet const &filterable)
 Constructor for Event. More...
 
 Event (std::string const &runid, PropertySet::Ptr const properties)
 Constructor for Event. More...
 
 Event (std::string const &runid, PropertySet const &properties)
 Constructor for Event. More...
 
 Event (std::string const &runid, PropertySet const &properties, PropertySet const &filterable)
 Constructor for Event. More...
 
 Event (cms::TextMessage *msg)
 Constructor for Event. More...
 
virtual ~Event ()
 destructor More...
 
PropertySet::Ptr getPropertySet () const
 retrieve the PropertySet for this Event More...
 
std::string getPubDate ()
 get the publication date of this Event, in ASCII More...
 
long long getPubTime ()
 get the publication time of this Event More...
 
void setPubTime (long long t)
 set the publication time of this Event More...
 
long long getEventTime ()
 get the event creation time More...
 
void setEventTime (long long nsecs)
 set the event creation time More...
 
void updateEventTime ()
 update the Event time to the current time More...
 
std::string getEventDate ()
 get the Event Date More...
 
std::string getRunId ()
 get the RunId for this Event More...
 
std::string getType ()
 get the Event type More...
 
std::string getStatus ()
 get the Event status More...
 
void setStatus (std::string status)
 set the Event status More...
 
void setTopic (std::string topic)
 set the Event topic More...
 
std::string getTopic ()
 get the Event topic More...
 
vector< std::string > getFilterablePropertyNames ()
 return all filterable property names More...
 
vector< std::string > getCustomPropertyNames ()
 return all custom property names More...
 
PropertySet::Ptr getCustomPropertySet () const
 return all custom property set More...
 
void marshall (cms::TextMessage *msg)
 marshall values in this event into a cms::TextMessage More...
 

Static Public Attributes

static std::string const ORIG_HOSTNAME = "ORIG_HOSTNAME"
 
static std::string const ORIG_PROCESSID = "ORIG_PROCESSID"
 
static std::string const ORIG_LOCALID = "ORIG_LOCALID"
 
- Static Public Attributes inherited from lsst::ctrl::events::Event
static const std::string TYPE = "TYPE"
 
static const std::string EVENTTIME = "EVENTTIME"
 
static const std::string RUNID = "RUNID"
 
static const std::string STATUS = "STATUS"
 
static const std::string TOPIC = "TOPIC"
 
static const std::string PUBTIME = "PUBTIME"
 
static const std::string UNINITIALIZED = "uninitialized"
 

Private Member Functions

void _init ()
 
void _constructor (LocationId const &originator)
 
virtual void populateHeader (cms::TextMessage *msg) const
 populate a cms::TextMessage header with properties More...
 

Additional Inherited Members

- Protected Member Functions inherited from lsst::ctrl::events::Event
void _init ()
 
void _constructor (std::string const &runid, PropertySet const &properties, PropertySet const &filterable)
 
template<typename T >
void add (std::string const &name, std::string const &tag, PropertySet const &properties, boost::property_tree::ptree &child)
 
- Protected Attributes inherited from lsst::ctrl::events::Event
PropertySet::Ptr _psp
 
PropertySet::Ptr _filterable
 
set< std::string > _keywords
 

Detailed Description

Representation of an LSST Event.

Definition at line 62 of file StatusEvent.h.

Constructor & Destructor Documentation

lsst::ctrl::events::StatusEvent::StatusEvent ( )

Constructor to create a StatusEvent.

Definition at line 67 of file StatusEvent.cc.

67  : Event() {
68  _init();
69 }
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::StatusEvent::~StatusEvent ( )
virtual

Definition at line 148 of file StatusEvent.cc.

148  {
149 }
lsst::ctrl::events::StatusEvent::StatusEvent ( cms::TextMessage *  msg)

Constructor to convert a TextMessage into a StatusEvent.

Definition at line 78 of file StatusEvent.cc.

78  : Event(msg) {
79  _init();
80 
81  _psp->set(ORIG_HOSTNAME, (std::string)msg->getStringProperty(ORIG_HOSTNAME));
82  _psp->set(ORIG_PROCESSID, (int)msg->getIntProperty(ORIG_PROCESSID));
83  _psp->set(ORIG_LOCALID, (int)msg->getIntProperty(ORIG_LOCALID));
84 }
PropertySet::Ptr _psp
Definition: Event.h:236
static std::string const ORIG_LOCALID
Definition: StatusEvent.h:67
static std::string const ORIG_PROCESSID
Definition: StatusEvent.h:66
static std::string const ORIG_HOSTNAME
Definition: StatusEvent.h:65
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::StatusEvent::StatusEvent ( LocationId const &  originator,
PropertySet const &  ps 
)

Constructor to create a StatusEvent.

Parameters
originatorthe LocationId of where this StatusEvent was created
psa PropertySet

Definition at line 86 of file StatusEvent.cc.

87  : Event(ps) {
88  _constructor(originatorID);
89 }
void _constructor(LocationId const &originator)
Definition: StatusEvent.cc:123
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::StatusEvent::StatusEvent ( LocationId const &  originator,
PropertySet const &  ps,
PropertySet const &  filterable 
)

Constructor to create a StatusEvent.

Parameters
originatorthe LocationId of where this StatusEvent was created
psa PropertySet
filterablea PropertySet that will be added to Event headers so they can be filtered using selectors.

Definition at line 91 of file StatusEvent.cc.

93  : Event(ps, filterable) {
94  _constructor(originatorID);
95 }
void _constructor(LocationId const &originator)
Definition: StatusEvent.cc:123
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::StatusEvent::StatusEvent ( std::string const &  runid,
LocationId const &  originator,
PropertySet const &  ps 
)

Constructor to create a StatusEvent.

Parameters
runida string identify for this Event
originatorthe LocationId of where this StatusEvent was created
psa PropertySet

Definition at line 110 of file StatusEvent.cc.

112  : Event(runID, ps) {
113  _constructor(originatorID);
114 }
void _constructor(LocationId const &originator)
Definition: StatusEvent.cc:123
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::StatusEvent::StatusEvent ( std::string const &  runid,
LocationId const &  originator,
PropertySet const &  ps,
PropertySet const &  filterable 
)

Constructor to create a StatusEvent.

Parameters
runida string identify for this Event
originatorthe LocationId of where this StatusEvent was created
psa PropertySet
filterablea PropertySet that will be added to Event headers so they can be filtered using selectors.

Definition at line 116 of file StatusEvent.cc.

119  : Event(runID, ps, filterable) {
120  _constructor(originatorID);
121 }
void _constructor(LocationId const &originator)
Definition: StatusEvent.cc:123
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::StatusEvent::StatusEvent ( std::string const &  runid,
LocationId const &  originator,
PropertySet::Ptr const  psp 
)

Constructor to create a StatusEvent.

Parameters
runida string identify for this Event
originatorthe LocationId of where this StatusEvent was created
pspa PropertySet::Ptr

Definition at line 97 of file StatusEvent.cc.

99  : Event(runID, *psp) {
100  _constructor(originatorID);
101 }
void _constructor(LocationId const &originator)
Definition: StatusEvent.cc:123
Event()
Constructor for Event with no properties.
Definition: Event.cc:81
lsst::ctrl::events::StatusEvent::StatusEvent ( std::string const &  runid,
LocationId const &  originator,
PropertySet::Ptr const  psp,
PropertySet const &  filterable 
)

Constructor to create a StatusEvent.

Parameters
runida string identify for this Event
originatorthe LocationId of where this StatusEvent was created
pspa PropertySet::Ptr
filterablea PropertySet that will be added to Event headers so they can be filtered using selectors.

Definition at line 103 of file StatusEvent.cc.

106  : Event(runID, *psp, filterable) {
107  _constructor(originatorID);
108 }
void _constructor(LocationId const &originator)
Definition: StatusEvent.cc:123
Event()
Constructor for Event with no properties.
Definition: Event.cc:81

Member Function Documentation

void lsst::ctrl::events::StatusEvent::_constructor ( LocationId const &  originator)
private

Definition at line 123 of file StatusEvent.cc.

123  {
124  _init();
125 
126  _psp->set(ORIG_HOSTNAME, originatorID.getHostName());
127  _psp->set(ORIG_PROCESSID, originatorID.getProcessID());
128  _psp->set(ORIG_LOCALID, originatorID.getLocalID());
130 
131 }
PropertySet::Ptr _psp
Definition: Event.h:236
static std::string const ORIG_LOCALID
Definition: StatusEvent.h:67
static std::string const ORIG_PROCESSID
Definition: StatusEvent.h:66
static std::string const ORIG_HOSTNAME
Definition: StatusEvent.h:65
static const std::string TYPE
Definition: Event.h:66
static const std::string STATUS
Definition: EventTypes.h:48
void lsst::ctrl::events::StatusEvent::_init ( )
private

Definition at line 72 of file StatusEvent.cc.

72  {
73  _keywords.insert(ORIG_HOSTNAME);
74  _keywords.insert(ORIG_PROCESSID);
75  _keywords.insert(ORIG_LOCALID);
76 }
static std::string const ORIG_LOCALID
Definition: StatusEvent.h:67
static std::string const ORIG_PROCESSID
Definition: StatusEvent.h:66
static std::string const ORIG_HOSTNAME
Definition: StatusEvent.h:65
set< std::string > _keywords
Definition: Event.h:238
LocationId * lsst::ctrl::events::StatusEvent::getOriginator ( )

accessor to get originator information

Returns
a LocationId containing the Originator information

Definition at line 141 of file StatusEvent.cc.

141  {
142  std::string hostname = _psp->get<std::string>(ORIG_HOSTNAME);
143  int pid = _psp->get<int>(ORIG_PROCESSID);
144  int local = _psp->get<int>(ORIG_LOCALID);
145  return new LocationId(hostname, pid, local);
146 }
PropertySet::Ptr _psp
Definition: Event.h:236
static std::string const ORIG_LOCALID
Definition: StatusEvent.h:67
static std::string const ORIG_PROCESSID
Definition: StatusEvent.h:66
static std::string const ORIG_HOSTNAME
Definition: StatusEvent.h:65
void lsst::ctrl::events::StatusEvent::populateHeader ( cms::TextMessage *  msg) const
privatevirtual

populate a cms::TextMessage header with properties

Parameters
[in]msga cms::TextMessage

Reimplemented from lsst::ctrl::events::Event.

Definition at line 133 of file StatusEvent.cc.

133  {
135 
136  msg->setStringProperty(ORIG_HOSTNAME, _psp->get<std::string>(ORIG_HOSTNAME));
137  msg->setIntProperty(ORIG_PROCESSID, _psp->get<int>(ORIG_PROCESSID));
138  msg->setIntProperty(ORIG_LOCALID, _psp->get<int>(ORIG_LOCALID));
139 }
PropertySet::Ptr _psp
Definition: Event.h:236
static std::string const ORIG_LOCALID
Definition: StatusEvent.h:67
static std::string const ORIG_PROCESSID
Definition: StatusEvent.h:66
virtual void populateHeader(cms::TextMessage *msg) const
populate a cms::TextMessage header with properties
Definition: Event.cc:241
static std::string const ORIG_HOSTNAME
Definition: StatusEvent.h:65

Member Data Documentation

std::string const lsst::ctrl::events::StatusEvent::ORIG_HOSTNAME = "ORIG_HOSTNAME"
static

Definition at line 65 of file StatusEvent.h.

std::string const lsst::ctrl::events::StatusEvent::ORIG_LOCALID = "ORIG_LOCALID"
static

Definition at line 67 of file StatusEvent.h.

std::string const lsst::ctrl::events::StatusEvent::ORIG_PROCESSID = "ORIG_PROCESSID"
static

Definition at line 66 of file StatusEvent.h.


The documentation for this class was generated from the following files: