22 #ifndef __M2ETIS_PUBSUB_FILTER_GENERALBOOLEANALGEBRA_NOTEQUALSPREDICATEINDEX_H__
23 #define __M2ETIS_PUBSUB_FILTER_GENERALBOOLEANALGEBRA_NOTEQUALSPREDICATEINDEX_H__
31 template <
typename EventType,
typename AttributeType>
39 if (predicate_id_to_attribute_value_.find(notequals_attribute_filter->
get_constants()[0]) != predicate_id_to_attribute_value_.end()) {
40 return predicate_id_to_attribute_value_[notequals_attribute_filter->
get_constants()[0]];
44 predicate_id_to_attribute_value_.insert(std::pair<AttributeType, PredicateIdentifierFactory::PredicateID >(notequals_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);
66 M2ETIS_THROW_API(
"NotEqualsPredicateIndex function determineMatchingPredicates",
"Attribute not found in attribute map.");
69 for (
auto attributevalue_predicateId_pair : predicate_id_to_attribute_value_) {
71 fulfilled_predicate_vector[attributevalue_predicateId_pair.second] =
true;
82 std::map<AttributeType, PredicateIdentifierFactory::PredicateID> predicate_id_to_attribute_value_;
virtual void removePredicate(std::vector< bool >::size_type predicate_id) override
std::vector< bool >::size_type PredicateID
virtual void determineMatchingPredicates(const EventType &event, std::vector< bool > &fulfilled_predicate_vector) override
void freeID(PredicateID id)
PredicateID createPredicateIdentifier()
const std::vector< AttributeType > get_constants() const
virtual ~NotEqualsPredicateIndex()
M2ETIS_API std::map< filter::AttributeName, std::shared_ptr< filter::AttributeAccessor_Basic > > attributes_accessor_map
PredicateIdentifierFactory::PredicateID addPredicate(const NotEqualsAttributeFilter< EventType, AttributeType > *notequals_attribute_filter)
AttributeName get_attribute_id() const
#define M2ETIS_THROW_API(module, message)
throws on wrong API usage
NotEqualsPredicateIndex(AttributeName attribute_id, PredicateIdentifierFactory *predicate_identifier_factory)
PredicateIdentifierFactory * predicate_identifier_factory_