31 #include <boost/format.hpp>
33 #include <rsc/runtime/ContainerIO.h>
34 #include <rsc/misc/IllegalStateException.h>
41 using namespace boost;
68 d(new
Impl(*event.d)) {
73 const string& type,
const string& method) :
82 const string& method) :
84 d->scope.reset(
new Scope(scope));
102 stream <<
"UNSPECIFIED";
104 stream <<
", type = " <<
d->type <<
", scope = ";
108 stream <<
"UNSPECIFIED";
110 stream <<
", metaData = " <<
d->metaData <<
", method = " <<
d->method;
111 stream <<
", causes = " <<
d->causes;
114 boost::uint64_t Event::getSequenceNumber()
const {
118 rsc::misc::UUID Event::getId()
const {
124 throw rsc::misc::IllegalStateException(
125 "The event does not contain id information.");
131 const boost::uint32_t& sequenceNumber) {
132 d->id.reset(
new EventId(senderId, sequenceNumber));
133 d->metaData.setSenderId(senderId);
169 return d->causes.insert(
id).second;
173 return d->causes.erase(
id) > 0;
177 return d->causes.count(
id) > 0;
201 d->metaData = metaData;
std::set< EventId > causes
boost::shared_ptr< Scope > ScopePtr
boost::shared_ptr< void > VoidPtr
void setType(const std::string &type)
void setEventId(const rsc::misc::UUID &senderId, const boost::uint32_t &sequenceNumber)
Sets all information necessary to generate an id for this event.
boost::uint32_t getSequenceNumber() const
MetaData getMetaData() const
Returns a copy of the current meta-data state of this event.
ScopePtr getScopePtr() const
MetaData & mutableMetaData()
Returns an in-place mutable version of the event's meta-data.
Basic message that is exchanged between informers and listeners.
EventId getEventId() const
Returns the id of this event.
bool addCause(const EventId &id)
Adds the id of one event to the causes of this event.
std::string getType() const
void setScope(const Scope &scope)
boost::shared_ptr< EventId > EventIdPtr
void setScopePtr(ScopePtr scope)
rsc::misc::UUID getAsUUID() const
boost::scoped_ptr< Impl > d
std::string getClassName() const
std::set< EventId > getCauses() const
Returns all causing events marked so far.
std::string getMethod() const
Returns the method associated with this event.
void setMethod(const std::string &method)
Sets the method associated with this event.
bool removeCause(const EventId &id)
Removes a causing event from the set of causes for this event.
bool isCause(const EventId &id) const
Tells whether the id of one event is already marked as a cause of this event.
void setMetaData(const MetaData &metaData)
Replaces the event's meta-data with a new instance.
A unique ID for events in RSB.
Scope is a descriptor for a hierarchical channel of the unified bus.
void printContents(std::ostream &stream) const