CatapultServer  v0.5.0.1 (Elephant)
ValidatingNotificationSubscriber.h
Go to the documentation of this file.
1 
21 #pragma once
23 #include "ValidatorTypes.h"
25 
26 namespace catapult { namespace validators {
27 
30  public:
33  : m_validator(validator)
35  {}
36 
37  public:
40  return m_result;
41  }
42 
43  public:
44  void notify(const model::Notification& notification) override {
46  return;
47 
49  return;
50 
51  auto result = m_validator.validate(notification);
53  }
54 
55  private:
58  };
59 }}
catapult::validators::ValidatingNotificationSubscriber::notify
void notify(const model::Notification &notification) override
Notifies the subscriber of notification.
Definition: ValidatingNotificationSubscriber.h:44
catapult::model::NotificationSubscriber
A notification subscriber.
Definition: NotificationSubscriber.h:27
catapult::validators::NotificationValidatorT
A strongly typed notification validator.
Definition: NotificationValidator.h:30
catapult::validators::ValidationResult
ValidationResult
Enumeration of all possible validation results.
Definition: ValidationResult.h:51
NotificationSubscriber.h
catapult::validators::ResultSeverity::Success
Validation result is success.
catapult::validators::IsSet
constexpr bool IsSet(ValidationResult result, ResultFlags flags)
Checks if result has all flags set.
Definition: ValidationResult.h:85
catapult::validators::AggregateValidationResult
void AggregateValidationResult(std::atomic< ValidationResult > &aggregate, ValidationResult value)
Aggregates result into aggregate.
Definition: AggregateValidationResult.cpp:62
catapult::model::Notification::Type
NotificationType Type
Notification type.
Definition: Notifications.h:46
AggregateValidationResult.h
catapult::validators::ValidatingNotificationSubscriber
A notification subscriber that validates notifications.
Definition: ValidatingNotificationSubscriber.h:29
catapult::validators::ValidatingNotificationSubscriber::result
ValidationResult result() const
Gets the aggregate validation result.
Definition: ValidatingNotificationSubscriber.h:39
catapult::model::Notification
A basic notification.
Definition: Notifications.h:36
ValidatorTypes.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::validators::IsValidationResultFailure
constexpr bool IsValidationResultFailure(ValidationResult result)
Returns a value indicating whether the validation result is a failure.
Definition: ValidationResult.h:95
catapult::validators::ValidatingNotificationSubscriber::ValidatingNotificationSubscriber
ValidatingNotificationSubscriber(const stateless::NotificationValidator &validator)
Creates a validating notification subscriber around validator.
Definition: ValidatingNotificationSubscriber.h:32
catapult::validators::NotificationValidatorT::validate
virtual ValidationResult validate(const TNotification &notification, TArgs &&... args) const =0
Validates a single notification with contextual information args.
catapult::validators::ValidatingNotificationSubscriber::m_result
ValidationResult m_result
Definition: ValidatingNotificationSubscriber.h:57
catapult::model::NotificationChannel::Validator
Publish notification on validator channel.
catapult::validators::ValidatingNotificationSubscriber::m_validator
const stateless::NotificationValidator & m_validator
Definition: ValidatingNotificationSubscriber.h:56