CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
27 namespace catapult {
namespace observers {
36 template<
typename TNotification>
38 auto predicate = [type = TNotification::Notification_Type](
const auto& notification) {
51 template<
typename TNotification>
60 const std::string&
name()
const override {
68 m_pObserver->notify(static_cast<const TNotification&>(notification), context);
ConditionalObserver(NotificationObserverPointerT< TNotification > &&pObserver, const NotificationObserverPredicate &predicate)
Definition: DemuxObserverBuilder.h:54
NotificationObserverPointerT< TNotification > m_pObserver
Definition: DemuxObserverBuilder.h:72
Context passed to all the observers.
Definition: ObserverContext.h:78
std::function< bool(TArgs...)> predicate
A predicate function.
Definition: functions.h:31
predicate< const model::Notification & > NotificationObserverPredicate
Definition: DemuxObserverBuilder.h:32
Definition: DemuxObserverBuilder.h:52
DemuxObserverBuilder & add(NotificationObserverPointerT< TNotification > &&pObserver)
Adds an observer (pObserver) to the builder that is invoked only when matching notifications are proc...
Definition: DemuxObserverBuilder.h:37
A strongly typed aggregate notification observer builder.
Definition: AggregateObserverBuilder.h:30
const std::string & name() const override
Gets the observer name.
Definition: DemuxObserverBuilder.h:60
NotificationObserverPredicate m_predicate
Definition: DemuxObserverBuilder.h:73
std::unique_ptr< const AggregateNotificationObserverT< TNotification > > AggregateNotificationObserverPointerT
An aggregate notification observer (unique) pointer.
Definition: ObserverTypes.h:41
A strongly typed notification observer.
Definition: NotificationObserver.h:29
AggregateNotificationObserverPointerT< model::Notification > build()
Builds a demultiplexing observer.
Definition: DemuxObserverBuilder.h:46
std::unique_ptr< const NotificationObserverT< TNotification > > NotificationObserverPointerT
A notification observer (unique) pointer.
Definition: ObserverTypes.h:34
A basic notification.
Definition: Notifications.h:36
AggregateObserverBuilder< model::Notification > m_builder
Definition: DemuxObserverBuilder.h:77
Definition: AddressExtractionExtension.cpp:28
constexpr bool AreEqualExcludingChannel(NotificationType lhs, NotificationType rhs)
Returns true if lhs and rhs have the same source (facility and code).
Definition: NotificationType.h:78
A demultiplexing observer builder.
Definition: DemuxObserverBuilder.h:30
void notify(const model::Notification ¬ification, ObserverContext &context) const override
Definition: DemuxObserverBuilder.h:64