CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace validators {
28 template<
typename TNotification,
typename... TArgs>
41 const std::string&
name()
const override {
46 return m_func(notification, std::forward<TArgs>(args)...);
Notification validator that wraps a function.
Definition: FunctionalNotificationValidator.h:29
FunctionType m_func
Definition: FunctionalNotificationValidator.h:51
A strongly typed notification validator.
Definition: NotificationValidator.h:30
ValidationResult validate(const TNotification ¬ification, TArgs &&... args) const override
Validates a single notification with contextual information args.
Definition: FunctionalNotificationValidator.h:45
ValidationResult
Enumeration of all possible validation results.
Definition: ValidationResult.h:51
std::string m_name
Definition: FunctionalNotificationValidator.h:50
const std::string & name() const override
Gets the validator name.
Definition: FunctionalNotificationValidator.h:41
std::function< ValidationResult(const TNotification &, TArgs &&...)> FunctionType
Definition: FunctionalNotificationValidator.h:31
Definition: AddressExtractionExtension.cpp:28
FunctionalNotificationValidatorT(const std::string &name, const FunctionType &func)
Creates a functional notification validator around func with name.
Definition: FunctionalNotificationValidator.h:35