CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
31 namespace catapult {
namespace validators {
33 struct ValidatorContext;
35 template<
typename... TArgs>
36 class AggregateEntityValidatorT;
38 template<
typename... TArgs>
39 class DemuxValidatorBuilderT;
45 template<
typename... TArgs>
55 template<
typename TResult>
59 template<
typename TNotification>
62 template<
typename TNotification>
65 template<
typename TNotification>
77 template<
typename TNotification>
80 template<
typename TNotification>
83 template<
typename TNotification>
96 #define DECLARE_STATELESS_VALIDATOR(NAME, NOTIFICATION_TYPE) \
97 stateless::NotificationValidatorPointerT<NOTIFICATION_TYPE> Create##NAME##Validator
101 #define MAKE_STATELESS_VALIDATOR(NAME, HANDLER) \
102 std::make_unique<stateless::FunctionalNotificationValidatorT<validators::Notification>>(#NAME "Validator", HANDLER);
106 #define DEFINE_STATELESS_VALIDATOR(NAME, HANDLER) \
107 DECLARE_STATELESS_VALIDATOR(NAME, validators::Notification)() { \
108 return MAKE_STATELESS_VALIDATOR(NAME, HANDLER); \
112 #define DEFINE_STATELESS_VALIDATOR_WITH_TYPE(NAME, NOTIFICATION_TYPE, HANDLER) \
113 DECLARE_STATELESS_VALIDATOR(NAME, NOTIFICATION_TYPE)() { \
114 return std::make_unique<stateless::FunctionalNotificationValidatorT<NOTIFICATION_TYPE>>(#NAME "Validator", HANDLER); \
118 #define DECLARE_STATEFUL_VALIDATOR(NAME, NOTIFICATION_TYPE) \
119 stateful::NotificationValidatorPointerT<NOTIFICATION_TYPE> Create##NAME##Validator
123 #define MAKE_STATEFUL_VALIDATOR(NAME, HANDLER) \
124 std::make_unique<stateful::FunctionalNotificationValidatorT<validators::Notification>>(#NAME "Validator", HANDLER);
128 #define DEFINE_STATEFUL_VALIDATOR(NAME, HANDLER) \
129 DECLARE_STATEFUL_VALIDATOR(NAME, validators::Notification)() { \
130 return MAKE_STATEFUL_VALIDATOR(NAME, HANDLER); \
134 #define DEFINE_STATEFUL_VALIDATOR_WITH_TYPE(NAME, NOTIFICATION_TYPE, HANDLER) \
135 DECLARE_STATEFUL_VALIDATOR(NAME, NOTIFICATION_TYPE)() { \
136 return std::make_unique<stateful::FunctionalNotificationValidatorT<NOTIFICATION_TYPE>>(#NAME "Validator", HANDLER); \
std::function< ValidationResult(const model::WeakEntityInfo &)> ValidationFunction
A validation function.
Definition: ValidatorTypes.h:49
A demultiplexing validator builder.
Definition: DemuxValidatorBuilder.h:31
Notification validator that wraps a function.
Definition: FunctionalNotificationValidator.h:29
std::function< TResult(const model::WeakEntityInfos &, const ValidationFunctions &)> ValidationPolicyFunc
Function signature for validation policies.
Definition: ValidatorTypes.h:56
std::function< bool(TArgs...)> predicate
A predicate function.
Definition: functions.h:31
A strongly typed notification validator.
Definition: NotificationValidator.h:30
ValidationResult
Enumeration of all possible validation results.
Definition: ValidationResult.h:51
std::unique_ptr< const NotificationValidatorT< TNotification > > NotificationValidatorPointerT
Definition: ValidatorTypes.h:63
Wrapper around a strongly typed entity and its associated metadata.
Definition: WeakEntityInfo.h:33
Definition: EntityValidator.h:31
A strongly typed aggregate notification validator.
Definition: AggregateNotificationValidator.h:29
An aggregate validator.
Definition: AggregateEntityValidator.h:31
predicate< ValidationResult > ValidationResultPredicate
Validation result predicate.
Definition: ValidatorTypes.h:42
std::vector< std::unique_ptr< const EntityValidatorT< TArgs... > >> ValidatorVectorT
A vector of validators.
Definition: ValidatorTypes.h:46
Definition: AddressExtractionExtension.cpp:28
std::unique_ptr< const NotificationValidatorT< TNotification > > NotificationValidatorPointerT
Definition: ValidatorTypes.h:81
std::vector< ValidationFunction > ValidationFunctions
A vector of validation functions.
Definition: ValidatorTypes.h:52
std::vector< WeakEntityInfo > WeakEntityInfos
A container of weak entity infos.
Definition: WeakEntityInfo.h:144