22 #ifndef __M2ETIS_PUBSUB_FILTER_GENERALBOOLEANALGEBRA_GREATERTHANPREDICATEINDEX_H__
23 #define __M2ETIS_PUBSUB_FILTER_GENERALBOOLEANALGEBRA_GREATERTHANPREDICATEINDEX_H__
31 template <
typename EventType,
typename AttributeType>
39 if (predicate_id_to_attribute_value_.find(greater_than_attribute_filter->
get_constants()[0]) != predicate_id_to_attribute_value_.end()) {
40 return predicate_id_to_attribute_value_[greater_than_attribute_filter->
get_constants()[0]];
44 predicate_id_to_attribute_value_.insert(std::pair<AttributeType, PredicateIdentifierFactory::PredicateID >(greater_than_attribute_filter->
get_constants()[0], new_predicate_id));
46 return new_predicate_id;
49 virtual void removePredicate(std::vector<bool>::size_type predicate_id)
override {
52 for (
auto attributeValue_predicateID_pair_iter = predicate_id_to_attribute_value_.begin(); attributeValue_predicateID_pair_iter != predicate_id_to_attribute_value_.end(); ++attributeValue_predicateID_pair_iter) {
53 if (attributeValue_predicateID_pair_iter->second == predicate_id) {
54 predicate_id_to_attribute_value_.erase(attributeValue_predicateID_pair_iter);
67 M2ETIS_THROW_API(
"GreaterThanPredicateIndex function determineMatchingPredicates",
"Attribute not found in attribute map.");
72 for (
auto iter_predicates = predicate_id_to_attribute_value_.begin(); iter_predicates != itlow ; ++iter_predicates) {
73 fulfilled_predicate_vector[iter_predicates->second] =
true;
83 std::map<AttributeType, PredicateIdentifierFactory::PredicateID > predicate_id_to_attribute_value_;
PredicateIdentifierFactory::PredicateID addPredicate(const GreaterThanAttributeFilter< EventType, AttributeType > *greater_than_attribute_filter)
std::vector< bool >::size_type PredicateID
GreaterThanPredicateIndex(AttributeName attribute_id, PredicateIdentifierFactory *predicate_identifier_factory)
void freeID(PredicateID id)
PredicateID createPredicateIdentifier()
const std::vector< AttributeType > get_constants() const
virtual void removePredicate(std::vector< bool >::size_type predicate_id) override
M2ETIS_API std::map< filter::AttributeName, std::shared_ptr< filter::AttributeAccessor_Basic > > attributes_accessor_map
virtual void determineMatchingPredicates(const EventType &event, std::vector< bool > &fulfilled_predicate_vector) override
AttributeName get_attribute_id() const
virtual ~GreaterThanPredicateIndex()
#define M2ETIS_THROW_API(module, message)
throws on wrong API usage
PredicateIdentifierFactory * predicate_identifier_factory_