CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace thread {
class IoThreadPool; } }
27 namespace catapult {
namespace validators {
std::function< ValidationResult(const model::WeakEntityInfo &)> ValidationFunction
A validation function.
Definition: ValidatorTypes.h:49
model::WeakEntityInfos m_entityInfos
Definition: ParallelValidationPolicy.cpp:140
boost::asio::io_context & m_ioContext
Definition: ParallelValidationPolicy.cpp:186
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
TTraits m_impl
Definition: ParallelValidationPolicy.cpp:142
std::vector< ValidationResult > m_results
Definition: ParallelValidationPolicy.cpp:89
std::shared_ptr< const thread::IoThreadPool > m_pPool
Definition: ParallelValidationPolicy.cpp:185
ValidationResult
Enumeration of all possible validation results.
Definition: ValidationResult.h:51
auto compose(future< TSeed > &&startFuture, TCreateNextFuture createNextFuture)
Definition: FutureUtils.h:102
Validation result is success.
ValidationFunctions m_validationFunctions
Definition: ParallelValidationPolicy.cpp:139
A parallel validation policy that performs parallel validations on multiple threads.
Definition: ParallelValidationPolicy.h:30
virtual thread::future< ValidationResult > validateShortCircuit(const model::WeakEntityInfos &entityInfos, const ValidationFunctions &validationFunctions) const =0
Validates all entityInfos using validationFunctions and short circuits on first failure.
void AggregateValidationResult(std::atomic< ValidationResult > &aggregate, ValidationResult value)
Aggregates result into aggregate.
Definition: AggregateValidationResult.cpp:62
virtual ~ParallelValidationPolicy()=default
Provides a way to access the result of an asynchronous operation.
Definition: Future.h:29
static constexpr bool IsEntityShortCircuitAllowed
Definition: ParallelValidationPolicy.cpp:39
std::shared_ptr< const void > m_pOwner
Definition: ParallelValidationPolicy.cpp:138
WeakEntityInfoT< VerifiableEntity > WeakEntityInfo
Definition: WeakEntityInfo.h:128
virtual thread::future< std::vector< ValidationResult > > validateAll(const model::WeakEntityInfos &entityInfos, const ValidationFunctions &validationFunctions) const =0
Validates all entityInfos using validationFunctions and does NOT short circuit on failures.
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::vector< ValidationFunction > ValidationFunctions
A vector of validation functions.
Definition: ValidatorTypes.h:52
std::shared_ptr< const ParallelValidationPolicy > CreateParallelValidationPolicy(const std::shared_ptr< thread::IoThreadPool > &pPool)
Creates a parallel validation policy using pPool for parallelization.
Definition: ParallelValidationPolicy.cpp:190
std::atomic< ValidationResult > m_aggregateResult
Definition: ParallelValidationPolicy.cpp:60
std::vector< WeakEntityInfo > WeakEntityInfos
A container of weak entity infos.
Definition: WeakEntityInfo.h:144
thread::promise< typename TTraits::ResultType > m_promise
Definition: ParallelValidationPolicy.cpp:141
thread::future< bool > ParallelFor(boost::asio::io_context &ioContext, TItems &items, size_t numPartitions, TWorkCallback callback)
Definition: ParallelFor.h:118