CatapultServer
v0.5.0.1 (Elephant)
ObserverTypes.h
Go to the documentation of this file.
1
21
#pragma once
22
#include "
AggregateNotificationObserver.h
"
23
#include "
EntityObserver.h
"
24
#include "
FunctionalNotificationObserver.h
"
25
#include <memory>
26
27
namespace
catapult
{
namespace
observers {
28
30
using
NotificationObserver
=
NotificationObserverT<model::Notification>
;
31
33
template
<
typename
TNotification>
34
using
NotificationObserverPointerT
= std::unique_ptr<const NotificationObserverT<TNotification>>;
35
37
using
AggregateNotificationObserver
=
AggregateNotificationObserverT<model::Notification>
;
38
40
template
<
typename
TNotification>
41
using
AggregateNotificationObserverPointerT
= std::unique_ptr<const AggregateNotificationObserverT<TNotification>>;
42
44
#define DECLARE_OBSERVER(NAME, NOTIFICATION_TYPE) observers::NotificationObserverPointerT<NOTIFICATION_TYPE> Create##NAME##Observer
45
47
#define MAKE_OBSERVER(NAME, NOTIFICATION_TYPE, HANDLER) \
48
std::make_unique<observers::FunctionalNotificationObserverT<NOTIFICATION_TYPE>>(#NAME "Observer", HANDLER);
49
51
#define DEFINE_OBSERVER(NAME, NOTIFICATION_TYPE, HANDLER) \
52
DECLARE_OBSERVER(NAME, NOTIFICATION_TYPE)() { \
53
return MAKE_OBSERVER(NAME, NOTIFICATION_TYPE, HANDLER); \
54
}
55
}}
EntityObserver.h
catapult::observers::AggregateNotificationObserverPointerT
std::unique_ptr< const AggregateNotificationObserverT< TNotification > > AggregateNotificationObserverPointerT
An aggregate notification observer (unique) pointer.
Definition:
ObserverTypes.h:41
catapult::observers::NotificationObserverT
A strongly typed notification observer.
Definition:
NotificationObserver.h:29
AggregateNotificationObserver.h
catapult::observers::NotificationObserverPointerT
std::unique_ptr< const NotificationObserverT< TNotification > > NotificationObserverPointerT
A notification observer (unique) pointer.
Definition:
ObserverTypes.h:34
catapult
Definition:
AddressExtractionExtension.cpp:28
catapult::observers::AggregateNotificationObserverT
A strongly typed aggregate notification observer.
Definition:
AggregateNotificationObserver.h:29
FunctionalNotificationObserver.h
catapult-server
src
catapult
observers
ObserverTypes.h
Generated by
1.8.16