CatapultServer  v0.5.0.1 (Elephant)
ValidatorTypes.h File Reference
Include dependency graph for ValidatorTypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  catapult::validators::AggregateEntityValidatorT< TArgs >
 An aggregate validator. More...
 
class  catapult::validators::DemuxValidatorBuilderT< TArgs >
 A demultiplexing validator builder. More...
 

Namespaces

 catapult
 
 catapult::validators
 
 catapult::validators::stateless
 
 catapult::validators::stateful
 

Macros

#define DECLARE_STATELESS_VALIDATOR(NAME, NOTIFICATION_TYPE)   stateless::NotificationValidatorPointerT<NOTIFICATION_TYPE> Create##NAME##Validator
 Declares a stateless validator with NAME for notifications of type NOTIFICATION_TYPE. More...
 
#define MAKE_STATELESS_VALIDATOR(NAME, HANDLER)   std::make_unique<stateless::FunctionalNotificationValidatorT<validators::Notification>>(#NAME "Validator", HANDLER);
 
#define DEFINE_STATELESS_VALIDATOR(NAME, HANDLER)
 
#define DEFINE_STATELESS_VALIDATOR_WITH_TYPE(NAME, NOTIFICATION_TYPE, HANDLER)
 Defines a functional stateless validator with NAME around HANDLER for notifications of type NOTIFICATION_TYPE. More...
 
#define DECLARE_STATEFUL_VALIDATOR(NAME, NOTIFICATION_TYPE)   stateful::NotificationValidatorPointerT<NOTIFICATION_TYPE> Create##NAME##Validator
 Declares a stateful validator with NAME for notifications of type NOTIFICATION_TYPE. More...
 
#define MAKE_STATEFUL_VALIDATOR(NAME, HANDLER)   std::make_unique<stateful::FunctionalNotificationValidatorT<validators::Notification>>(#NAME "Validator", HANDLER);
 
#define DEFINE_STATEFUL_VALIDATOR(NAME, HANDLER)
 
#define DEFINE_STATEFUL_VALIDATOR_WITH_TYPE(NAME, NOTIFICATION_TYPE, HANDLER)
 Defines a functional stateful validator with NAME around HANDLER for notifications of type NOTIFICATION_TYPE. More...
 

Typedefs

using catapult::validators::ValidationResultPredicate = predicate< ValidationResult >
 Validation result predicate. More...
 
template<typename... TArgs>
using catapult::validators::ValidatorVectorT = std::vector< std::unique_ptr< const EntityValidatorT< TArgs... > >>
 A vector of validators. More...
 
using catapult::validators::ValidationFunction = std::function< ValidationResult(const model::WeakEntityInfo &)>
 A validation function. More...
 
using catapult::validators::ValidationFunctions = std::vector< ValidationFunction >
 A vector of validation functions. More...
 
template<typename TResult >
using catapult::validators::ValidationPolicyFunc = std::function< TResult(const model::WeakEntityInfos &, const ValidationFunctions &)>
 Function signature for validation policies. More...
 
template<typename TNotification >
using catapult::validators::stateless::NotificationValidatorT = catapult::validators::NotificationValidatorT< TNotification >
 
template<typename TNotification >
using catapult::validators::stateless::NotificationValidatorPointerT = std::unique_ptr< const NotificationValidatorT< TNotification > >
 
template<typename TNotification >
using catapult::validators::stateless::FunctionalNotificationValidatorT = catapult::validators::FunctionalNotificationValidatorT< TNotification >
 
using catapult::validators::stateless::EntityValidator = EntityValidatorT<>
 
using catapult::validators::stateless::NotificationValidator = NotificationValidatorT< model::Notification >
 
using catapult::validators::stateless::AggregateEntityValidator = AggregateEntityValidatorT<>
 
using catapult::validators::stateless::AggregateNotificationValidator = AggregateNotificationValidatorT< model::Notification >
 
using catapult::validators::stateless::DemuxValidatorBuilder = DemuxValidatorBuilderT<>
 
template<typename TNotification >
using catapult::validators::stateful::NotificationValidatorT = catapult::validators::NotificationValidatorT< TNotification, const ValidatorContext & >
 
template<typename TNotification >
using catapult::validators::stateful::NotificationValidatorPointerT = std::unique_ptr< const NotificationValidatorT< TNotification > >
 
template<typename TNotification >
using catapult::validators::stateful::FunctionalNotificationValidatorT = catapult::validators::FunctionalNotificationValidatorT< TNotification, const ValidatorContext & >
 
using catapult::validators::stateful::EntityValidator = EntityValidatorT< const ValidatorContext & >
 
using catapult::validators::stateful::NotificationValidator = NotificationValidatorT< model::Notification >
 
using catapult::validators::stateful::AggregateEntityValidator = AggregateEntityValidatorT< const ValidatorContext & >
 
using catapult::validators::stateful::AggregateNotificationValidator = AggregateNotificationValidatorT< model::Notification, const ValidatorContext & >
 
using catapult::validators::stateful::DemuxValidatorBuilder = DemuxValidatorBuilderT< const ValidatorContext & >
 

Macro Definition Documentation

◆ DECLARE_STATEFUL_VALIDATOR

#define DECLARE_STATEFUL_VALIDATOR (   NAME,
  NOTIFICATION_TYPE 
)    stateful::NotificationValidatorPointerT<NOTIFICATION_TYPE> Create##NAME##Validator

Declares a stateful validator with NAME for notifications of type NOTIFICATION_TYPE.

◆ DECLARE_STATELESS_VALIDATOR

#define DECLARE_STATELESS_VALIDATOR (   NAME,
  NOTIFICATION_TYPE 
)    stateless::NotificationValidatorPointerT<NOTIFICATION_TYPE> Create##NAME##Validator

Declares a stateless validator with NAME for notifications of type NOTIFICATION_TYPE.

◆ DEFINE_STATEFUL_VALIDATOR

#define DEFINE_STATEFUL_VALIDATOR (   NAME,
  HANDLER 
)
Value:

Defines a functional stateful validator with NAME around HANDLER.

Note
This macro requires a validators::Notification alias.

◆ DEFINE_STATEFUL_VALIDATOR_WITH_TYPE

#define DEFINE_STATEFUL_VALIDATOR_WITH_TYPE (   NAME,
  NOTIFICATION_TYPE,
  HANDLER 
)
Value:
DECLARE_STATEFUL_VALIDATOR(NAME, NOTIFICATION_TYPE)() { \
return std::make_unique<stateful::FunctionalNotificationValidatorT<NOTIFICATION_TYPE>>(#NAME "Validator", HANDLER); \
}

Defines a functional stateful validator with NAME around HANDLER for notifications of type NOTIFICATION_TYPE.

◆ DEFINE_STATELESS_VALIDATOR

#define DEFINE_STATELESS_VALIDATOR (   NAME,
  HANDLER 
)
Value:

Defines a functional stateless validator with NAME around HANDLER.

Note
This macro requires a validators::Notification alias.

◆ DEFINE_STATELESS_VALIDATOR_WITH_TYPE

#define DEFINE_STATELESS_VALIDATOR_WITH_TYPE (   NAME,
  NOTIFICATION_TYPE,
  HANDLER 
)
Value:
DECLARE_STATELESS_VALIDATOR(NAME, NOTIFICATION_TYPE)() { \
return std::make_unique<stateless::FunctionalNotificationValidatorT<NOTIFICATION_TYPE>>(#NAME "Validator", HANDLER); \
}

Defines a functional stateless validator with NAME around HANDLER for notifications of type NOTIFICATION_TYPE.

◆ MAKE_STATEFUL_VALIDATOR

#define MAKE_STATEFUL_VALIDATOR (   NAME,
  HANDLER 
)    std::make_unique<stateful::FunctionalNotificationValidatorT<validators::Notification>>(#NAME "Validator", HANDLER);

Makes a functional stateful validator with NAME around HANDLER.

Note
This macro requires a validators::Notification alias.

◆ MAKE_STATELESS_VALIDATOR

#define MAKE_STATELESS_VALIDATOR (   NAME,
  HANDLER 
)    std::make_unique<stateless::FunctionalNotificationValidatorT<validators::Notification>>(#NAME "Validator", HANDLER);

Makes a functional stateless validator with NAME around HANDLER.

Note
This macro requires a validators::Notification alias.
catapult::validators::Notification
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
MAKE_STATEFUL_VALIDATOR
#define MAKE_STATEFUL_VALIDATOR(NAME, HANDLER)
Definition: ValidatorTypes.h:123
DECLARE_STATELESS_VALIDATOR
#define DECLARE_STATELESS_VALIDATOR(NAME, NOTIFICATION_TYPE)
Declares a stateless validator with NAME for notifications of type NOTIFICATION_TYPE.
Definition: ValidatorTypes.h:96
MAKE_STATELESS_VALIDATOR
#define MAKE_STATELESS_VALIDATOR(NAME, HANDLER)
Definition: ValidatorTypes.h:101
DECLARE_STATEFUL_VALIDATOR
#define DECLARE_STATEFUL_VALIDATOR(NAME, NOTIFICATION_TYPE)
Declares a stateful validator with NAME for notifications of type NOTIFICATION_TYPE.
Definition: ValidatorTypes.h:118