CatapultServer  v0.5.0.1 (Elephant)
VerifiableEntityPredicate.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "VerifiableEntity.h"
23 #include "catapult/functions.h"
24 
25 namespace catapult { namespace model {
26 
29 
32  return [](const auto&) { return true; };
33  }
34 
37  return [type](const auto& entity) { return entity.Type == type; };
38  }
39 
42  return [type](const auto& entity) { return ToBasicEntityType(entity.Type) == type; };
43  }
44 }}
catapult::model::HasBasicTypeFilter
VerifiableEntityPredicate HasBasicTypeFilter(BasicEntityType type)
Creates a predicate that returns true when an entity has a matching basic entity type.
Definition: VerifiableEntityPredicate.h:41
catapult::predicate
std::function< bool(TArgs...)> predicate
A predicate function.
Definition: functions.h:31
catapult::model::EntityType
EntityType
Enumeration of entity types.
Definition: EntityType.h:43
functions.h
catapult::model::ToBasicEntityType
constexpr BasicEntityType ToBasicEntityType(EntityType type)
Converts an entity type into a basic entity type.
Definition: EntityType.h:70
catapult::model::VerifiableEntityPredicate
predicate< const VerifiableEntity & > VerifiableEntityPredicate
Prototype for a verifiable entity predicate.
Definition: VerifiableEntityPredicate.h:28
VerifiableEntity.h
catapult::model::NeverFilter
VerifiableEntityPredicate NeverFilter()
Creates a predicate that always returns true.
Definition: VerifiableEntityPredicate.h:31
catapult::model::HasTypeFilter
VerifiableEntityPredicate HasTypeFilter(EntityType type)
Creates a predicate that returns true when an entity has a matching entity type.
Definition: VerifiableEntityPredicate.h:36
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::model::BasicEntityType
BasicEntityType
Definition: EntityType.h:31