CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
27 namespace catapult {
namespace validators {
30 template<
typename TNotification,
typename... TArgs>
46 return std::make_unique<DefaultAggregateNotificationValidator>(std::move(
m_validators), isSuppressedFailure);
61 const std::string&
name()
const override {
65 std::vector<std::string>
names()
const override {
72 auto result = pValidator->validate(notification, std::forward<TArgs>(args)...);
85 return aggregateResult;
AggregateValidatorBuilder & add(NotificationValidatorPointer &&pValidator)
Adds pValidator to the builder and allows chaining.
Definition: AggregateValidatorBuilder.h:39
NotificationValidatorPointerVector m_validators
Definition: AggregateValidatorBuilder.h:89
std::vector< std::string > ExtractNames(const TNamedObjects &namedObjects)
Extracts all names from namedObjects.
Definition: NamedObject.h:46
ValidationResultPredicate m_isSuppressedFailure
Definition: AggregateValidatorBuilder.h:90
std::unique_ptr< const AggregateNotificationValidatorT< catapult::model::Notification, TArgs... > > AggregateValidatorPointer
Definition: AggregateValidatorBuilder.h:35
A strongly typed notification validator.
Definition: NotificationValidator.h:30
std::string m_name
Definition: AggregateValidatorBuilder.h:91
ValidationResult
Enumeration of all possible validation results.
Definition: ValidationResult.h:51
std::string ReduceNames(const std::vector< std::string > &names)
Reduces names into a single string.
Definition: NamedObject.h:56
NotificationValidatorPointerVector m_validators
Definition: AggregateValidatorBuilder.h:95
AggregateValidatorPointer build(const ValidationResultPredicate &isSuppressedFailure)
Builds a strongly typed notification validator that ignores suppressed failures according to isSuppre...
Definition: AggregateValidatorBuilder.h:45
A strongly typed aggregate notification validator builder.
Definition: AggregateValidatorBuilder.h:31
const std::string & name() const override
Gets the validator name.
Definition: AggregateValidatorBuilder.h:61
void AggregateValidationResult(std::atomic< ValidationResult > &aggregate, ValidationResult value)
Aggregates result into aggregate.
Definition: AggregateValidationResult.cpp:62
ValidationResult validate(const TNotification ¬ification, TArgs &&... args) const override
Validates a single notification with contextual information args.
Definition: AggregateValidatorBuilder.h:69
A strongly typed aggregate notification validator.
Definition: AggregateNotificationValidator.h:29
std::vector< std::string > names() const override
Gets the names of all sub validators.
Definition: AggregateValidatorBuilder.h:65
DefaultAggregateNotificationValidator(NotificationValidatorPointerVector &&validators, const ValidationResultPredicate &isSuppressedFailure)
Definition: AggregateValidatorBuilder.h:52
Definition: AggregateValidatorBuilder.h:50
predicate< ValidationResult > ValidationResultPredicate
Validation result predicate.
Definition: ValidatorTypes.h:42
std::vector< NotificationValidatorPointer > NotificationValidatorPointerVector
Definition: AggregateValidatorBuilder.h:34
Definition: AddressExtractionExtension.cpp:28
constexpr bool IsValidationResultFailure(ValidationResult result)
Returns a value indicating whether the validation result is a failure.
Definition: ValidationResult.h:95
std::unique_ptr< const NotificationValidatorT< catapult::model::Notification, TArgs... > > NotificationValidatorPointer
Definition: AggregateValidatorBuilder.h:33