22 #ifndef __M2ETIS_PUBSUB_FILTER_GENERALBOOLEANALGEBRA_LESSTHANPREDICATEINDEX_H__
23 #define __M2ETIS_PUBSUB_FILTER_GENERALBOOLEANALGEBRA_LESSTHANPREDICATEINDEX_H__
31 template <
typename EventType,
typename AttributeType>
40 if (predicate_id_to_attribute_value_.find(less_than_attribute_filter->
get_constants()[0]) != predicate_id_to_attribute_value_.end()) {
41 return predicate_id_to_attribute_value_[less_than_attribute_filter->
get_constants()[0]];
45 predicate_id_to_attribute_value_.insert(std::pair<AttributeType, PredicateIdentifierFactory::PredicateID >(less_than_attribute_filter->
get_constants()[0], new_predicate_id));
47 return new_predicate_id;
50 virtual void removePredicate(std::vector<bool>::size_type predicate_id)
override {
53 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) {
54 if (attributeValue_predicateID_pair_iter->second == predicate_id) {
55 predicate_id_to_attribute_value_.erase(attributeValue_predicateID_pair_iter);
68 M2ETIS_THROW_API(
"LessThanPredicateIndex function determineMatchingPredicates",
"Attribute not found in attribute map.");
73 for (
auto iter_predicates = ithigh ; iter_predicates != predicate_id_to_attribute_value_.end() ; ++iter_predicates) {
74 fulfilled_predicate_vector[iter_predicates->second] =
true;
84 std::map<AttributeType, PredicateIdentifierFactory::PredicateID> predicate_id_to_attribute_value_;
PredicateIdentifierFactory::PredicateID addPredicate(const LessThanAttributeFilter< EventType, AttributeType > *less_than_attribute_filter)
LessThanPredicateIndex(AttributeName attribute_id, PredicateIdentifierFactory *predicate_identifier_factory)
std::vector< bool >::size_type PredicateID
virtual void removePredicate(std::vector< bool >::size_type predicate_id) override
void freeID(PredicateID id)
PredicateID createPredicateIdentifier()
const std::vector< AttributeType > get_constants() const
M2ETIS_API std::map< filter::AttributeName, std::shared_ptr< filter::AttributeAccessor_Basic > > attributes_accessor_map
AttributeName get_attribute_id() const
virtual void determineMatchingPredicates(const EventType &event, std::vector< bool > &fulfilled_predicate_vector) override
#define M2ETIS_THROW_API(module, message)
throws on wrong API usage
virtual ~LessThanPredicateIndex()
PredicateIdentifierFactory * predicate_identifier_factory_