FrameworkEvent¶
-
std::ostream &operator<<(std::ostream &os, FrameworkEvent::Type eventType)¶
Writes a string representation of
eventType
to the streamos
.
-
std::ostream &operator<<(std::ostream &os, FrameworkEvent const &evt)¶
Writes a string representation of
evt
to the streamos
.
-
bool operator==(FrameworkEvent const &rhs, FrameworkEvent const &lhs)¶
Compares two framework events for equality.
-
class FrameworkEvent¶
- #include <cppmicroservices/FrameworkEvent.h>
An event from the Micro Services framework describing a Framework event.
FrameworkEvent
objects are delivered to listeners connected via BundleContext::AddFrameworkListener() when an event occurs within the Framework which a user would be interested in. AType
code is used to identify the event type for future extendability.See also
Public Types
-
enum Type¶
A type code used to identify the event type for future extendability.
Values:
-
enumerator FRAMEWORK_STARTED¶
The Framework has started.
This event is fired when the Framework has started after all installed bundles that are marked to be started have been started. The source of this event is the System Bundle.
-
enumerator FRAMEWORK_ERROR¶
An error has occurred.
There was an error associated with a bundle.
-
enumerator FRAMEWORK_WARNING¶
A warning has occurred.
There was a warning associated with a bundle.
-
enumerator FRAMEWORK_INFO¶
An informational event has occurred.
There was an informational event associated with a bundle.
-
enumerator FRAMEWORK_STOPPED¶
The Framework has been stopped.
This event is fired when the Framework has been stopped because of a stop operation on the system bundle. The source of this event is the System Bundle.
-
enumerator FRAMEWORK_STARTED¶
Public Functions
-
FrameworkEvent()¶
Creates an invalid instance.
-
explicit operator bool() const¶
Returns
false
if the FrameworkEvent is empty (i.e invalid) andtrue
if the FrameworkEvent is not null and contains valid data.- Returns:
true
if this event object is valid,false
otherwise.
-
FrameworkEvent(Type type, Bundle const &bundle, std::string const &message, const std::exception_ptr exception = nullptr)¶
Creates a Framework event of the specified type.
- Parameters:
type – The event type.
bundle – The bundle associated with the event. This bundle is also the source of the event.
message – The message associated with the event.
exception – The exception associated with this event. Should be nullptr if there is no exception.
-
Bundle GetBundle() const¶
Returns the bundle associated with the event.
- Returns:
The bundle associated with the event.
-
std::string GetMessage() const¶
Returns the message associated with the event.
- Returns:
the message associated with the event.
-
std::exception_ptr GetThrowable() const¶
Returns the exception associated with this event.
Remark
Use
std::rethrow_exception
to throw the exception returned.- Returns:
The exception. May be
nullptr
if there is no related exception.
-
enum Type¶