CatapultServer  v0.5.0.1 (Elephant)
catapult::validators::FunctionalNotificationValidatorT< TNotification, TArgs > Class Template Reference

Notification validator that wraps a function. More...

Inheritance diagram for catapult::validators::FunctionalNotificationValidatorT< TNotification, TArgs >:
Collaboration diagram for catapult::validators::FunctionalNotificationValidatorT< TNotification, TArgs >:

Public Member Functions

 FunctionalNotificationValidatorT (const std::string &name, const FunctionType &func)
 Creates a functional notification validator around func with name. More...
 
const std::string & name () const override
 Gets the validator name. More...
 
ValidationResult validate (const TNotification &notification, TArgs &&... args) const override
 Validates a single notification with contextual information args. More...
 
- Public Member Functions inherited from catapult::validators::NotificationValidatorT< TNotification, TArgs... >
virtual ~NotificationValidatorT ()=default
 

Private Types

using FunctionType = std::function< ValidationResult(const TNotification &, TArgs &&...)>
 

Private Attributes

std::string m_name
 
FunctionType m_func
 

Additional Inherited Members

- Public Types inherited from catapult::validators::NotificationValidatorT< TNotification, TArgs... >
using NotificationType = TNotification
 Notification type. More...
 

Detailed Description

template<typename TNotification, typename... TArgs>
class catapult::validators::FunctionalNotificationValidatorT< TNotification, TArgs >

Notification validator that wraps a function.

Member Typedef Documentation

◆ FunctionType

template<typename TNotification , typename... TArgs>
using catapult::validators::FunctionalNotificationValidatorT< TNotification, TArgs >::FunctionType = std::function<ValidationResult (const TNotification&, TArgs&&...)>
private

Constructor & Destructor Documentation

◆ FunctionalNotificationValidatorT()

template<typename TNotification , typename... TArgs>
catapult::validators::FunctionalNotificationValidatorT< TNotification, TArgs >::FunctionalNotificationValidatorT ( const std::string &  name,
const FunctionType func 
)
inlineexplicit

Creates a functional notification validator around func with name.

Member Function Documentation

◆ name()

template<typename TNotification , typename... TArgs>
const std::string& catapult::validators::FunctionalNotificationValidatorT< TNotification, TArgs >::name ( ) const
inlineoverridevirtual

◆ validate()

template<typename TNotification , typename... TArgs>
ValidationResult catapult::validators::FunctionalNotificationValidatorT< TNotification, TArgs >::validate ( const TNotification &  notification,
TArgs &&...  args 
) const
inlineoverridevirtual

Validates a single notification with contextual information args.

Implements catapult::validators::NotificationValidatorT< TNotification, TArgs... >.

Member Data Documentation

◆ m_func

template<typename TNotification , typename... TArgs>
FunctionType catapult::validators::FunctionalNotificationValidatorT< TNotification, TArgs >::m_func
private

◆ m_name

template<typename TNotification , typename... TArgs>
std::string catapult::validators::FunctionalNotificationValidatorT< TNotification, TArgs >::m_name
private

The documentation for this class was generated from the following file: