CatapultServer
v0.5.0.1 (Elephant)
|
const NotificationObserver & m_observer
Definition: NotificationObserverAdapter.cpp:44
constexpr bool IsValidationResultSuccess(ValidationResult result)
Returns a value indicating whether the validation result is a success.
Definition: ValidationResult.h:90
Context passed to all the observers.
Definition: ObserverContext.h:78
A notification subscriber.
Definition: NotificationSubscriber.h:27
Publish notification on observer channel.
constexpr bool IsSet(NotificationType type, NotificationChannel channel)
Checks if type has channel set.
Definition: NotificationType.h:61
virtual void notify(const TNotification ¬ification, ObserverContext &context) const =0
Notifies the observer with a notification to process and an observer context.
A strongly typed notification validator.
Definition: NotificationValidator.h:30
ValidationResult
Enumeration of all possible validation results.
Definition: ValidationResult.h:51
ProcessingNotificationSubscriber(const validators::stateful::NotificationValidator &validator, const validators::ValidatorContext &validatorContext, const observers::NotificationObserver &observer, observers::ObserverContext &observerContext)
Creates a subscriber around validator, validatorContext, observer and observerContext.
Definition: ProcessingNotificationSubscriber.cpp:26
void enableUndo()
Enables subsequent notifications to be undone.
Definition: ProcessingNotificationSubscriber.cpp:44
A notification subscriber that processes notifications.
Definition: ProcessingNotificationSubscriber.h:29
void notify(const model::Notification ¬ification) override
Notifies the subscriber of notification.
Definition: ProcessingNotificationSubscriber.cpp:55
observers::ObserverContext & m_observerContext
Definition: ProcessingNotificationSubscriber.h:60
validators::ValidationResult m_aggregateResult
Definition: ProcessingNotificationSubscriber.h:63
const validators::stateful::NotificationValidator & m_validator
Definition: ProcessingNotificationSubscriber.h:57
Contextual information passed to stateful validators.
Definition: ValidatorContext.h:32
void AggregateValidationResult(std::atomic< ValidationResult > &aggregate, ValidationResult value)
Aggregates result into aggregate.
Definition: AggregateValidationResult.cpp:62
A notification subscriber that captures notifications and allows them to be undone.
Definition: ProcessingUndoNotificationSubscriber.h:28
NotificationType Type
Notification type.
Definition: Notifications.h:46
void undo()
Undoes all executions since enableUndo was first called.
Definition: ProcessingNotificationSubscriber.cpp:48
const observers::NotificationObserver & m_observer
Definition: ProcessingNotificationSubscriber.h:59
void notify(const model::Notification ¬ification) override
Notifies the subscriber of notification.
Definition: ProcessingUndoNotificationSubscriber.cpp:49
ProcessingUndoNotificationSubscriber m_undoNotificationSubscriber
Definition: ProcessingNotificationSubscriber.h:62
const validators::ValidatorContext & m_validatorContext
Definition: ProcessingNotificationSubscriber.h:58
bool m_isUndoEnabled
Definition: ProcessingNotificationSubscriber.h:64
A strongly typed notification observer.
Definition: NotificationObserver.h:29
All cosigners are eligible and sufficient.
validators::ValidationResult result() const
Gets the aggregate result of processed notifications.
Definition: ProcessingNotificationSubscriber.cpp:40
#define CATAPULT_THROW_RUNTIME_ERROR(MESSAGE)
Macro used to throw a catapult runtime error.
Definition: exceptions.h:167
void validate(const model::Notification ¬ification)
Definition: ProcessingNotificationSubscriber.cpp:69
A basic notification.
Definition: Notifications.h:36
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
Definition: AddressExtractionExtension.cpp:28
size_t Size
Notification size.
Definition: Notifications.h:49
virtual ValidationResult validate(const TNotification ¬ification, TArgs &&... args) const =0
Validates a single notification with contextual information args.
std::atomic< ValidationResult > m_aggregateResult
Definition: ParallelValidationPolicy.cpp:60
Publish notification on validator channel.
void observe(const model::Notification ¬ification)
Definition: ProcessingNotificationSubscriber.cpp:77
void undo()
Undoes all executions.
Definition: ProcessingUndoNotificationSubscriber.cpp:32