CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
27 namespace catapult {
namespace validators {
30 template<
typename... TArgs>
52 template<
typename TDispatcher>
62 #pragma clang diagnostic push
64 #pragma clang diagnostic ignored "-Wunused-lambda-capture"
68 template<
typename... TCurryArgs>
72 auto forwardedArgs = std::make_tuple(std::forward<TCurryArgs>(args)...);
74 validationFunctions.emplace_back([&pValidator, forwardedArgs](
const auto& entityInfo) {
75 return pValidator->validate(entityInfo, std::get<TArgs>(forwardedArgs)...);
83 #pragma clang diagnostic pop
87 std::vector<std::string>
names()
const {
std::vector< std::string > ExtractNames(const TNamedObjects &namedObjects)
Extracts all names from namedObjects.
Definition: NamedObject.h:46
std::vector< std::string > names() const
Gets the names of all sub validators.
Definition: AggregateEntityValidator.h:87
auto dispatch(const TDispatcher &dispatcher, const model::WeakEntityInfos &entityInfos) const
Dispatches validation of entityInfos to dispatcher.
Definition: AggregateEntityValidator.h:53
DispatchForwarder(ValidationFunctions &&validationFunctions)
Creates a forwarder around validators.
Definition: AggregateEntityValidator.h:46
Helper for invoking curried validators.
Definition: AggregateEntityValidator.h:43
ValidationFunctions m_validationFunctions
Definition: AggregateEntityValidator.h:58
ValidatorVector m_validators
Definition: AggregateEntityValidator.h:92
AggregateEntityValidatorT(ValidatorVector &&validators)
Creates an aggregate validator around validators.
Definition: AggregateEntityValidator.h:37
An aggregate validator.
Definition: AggregateEntityValidator.h:31
std::vector< std::unique_ptr< const EntityValidatorT< TArgs... > >> ValidatorVectorT
A vector of validators.
Definition: ValidatorTypes.h:46
Definition: AddressExtractionExtension.cpp:28
ValidatorVectorT< TArgs... > ValidatorVector
Definition: AggregateEntityValidator.h:33
DispatchForwarder curry(TCurryArgs &&... args) const
Prepares the invocation of sub validators by currying args to invocations made on the returned forwar...
Definition: AggregateEntityValidator.h:69
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