CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
26 namespace catapult {
namespace observers {
29 template<
typename TNotification>
44 return std::make_unique<DefaultAggregateNotificationObserver>(std::move(
m_observers));
56 const std::string&
name()
const override {
60 std::vector<std::string>
names()
const override {
65 if (NotifyMode::Commit == context.
Mode)
72 template<
typename TIter>
74 for (
auto iter = begin; end != iter; ++iter)
75 (*iter)->notify(notification, context);
void notifyAll(TIter begin, TIter end, const TNotification ¬ification, ObserverContext &context) const
Definition: AggregateObserverBuilder.h:73
std::vector< std::string > ExtractNames(const TNamedObjects &namedObjects)
Extracts all names from namedObjects.
Definition: NamedObject.h:46
Context passed to all the observers.
Definition: ObserverContext.h:78
Definition: AggregateObserverBuilder.h:48
NotificationObserverPointerVector m_observers
Definition: AggregateObserverBuilder.h:84
AggregateObserverBuilder & add(NotificationObserverPointer &&pObserver)
Adds pObserver to the builder and allows chaining.
Definition: AggregateObserverBuilder.h:37
std::string ReduceNames(const std::vector< std::string > &names)
Reduces names into a single string.
Definition: NamedObject.h:56
AggregateNotificationObserverPointerT< TNotification > build()
Builds a strongly typed notification observer.
Definition: AggregateObserverBuilder.h:43
std::vector< std::string > names() const override
Gets the names of all sub observers.
Definition: AggregateObserverBuilder.h:60
A strongly typed aggregate notification observer builder.
Definition: AggregateObserverBuilder.h:30
const std::string & name() const override
Gets the observer name.
Definition: AggregateObserverBuilder.h:56
std::unique_ptr< const AggregateNotificationObserverT< TNotification > > AggregateNotificationObserverPointerT
An aggregate notification observer (unique) pointer.
Definition: ObserverTypes.h:41
void notify(const TNotification ¬ification, ObserverContext &context) const override
Notifies the observer with a notification to process and an observer context.
Definition: AggregateObserverBuilder.h:64
std::string m_name
Definition: AggregateObserverBuilder.h:80
NotificationObserverPointerT< catapult::model::Notification > NotificationObserverPointer
Definition: AggregateObserverBuilder.h:32
const NotifyMode Mode
Notification mode.
Definition: ObserverContext.h:95
std::unique_ptr< const NotificationObserverT< TNotification > > NotificationObserverPointerT
A notification observer (unique) pointer.
Definition: ObserverTypes.h:34
Definition: AddressExtractionExtension.cpp:28
A strongly typed aggregate notification observer.
Definition: AggregateNotificationObserver.h:29
std::vector< NotificationObserverPointer > NotificationObserverPointerVector
Definition: AggregateObserverBuilder.h:33
DefaultAggregateNotificationObserver(NotificationObserverPointerVector &&observers)
Definition: AggregateObserverBuilder.h:50
NotificationObserverPointerVector m_observers
Definition: AggregateObserverBuilder.h:79