libosmscout 0.1
Loading...
Searching...
No Matches
osmscout::TagBinaryCondition Class Reference

Returns true, if the value of the given tag fulfills the given boolean condition in regard to the comparison value. More...

#include <Tag.h>

+ Inheritance diagram for osmscout::TagBinaryCondition:

Public Member Functions

void CollectTagKeys (std::vector< TagId > &keys, bool &guaranteed) const override
 Collects the tag keys that act as primary discriminators for this condition.
 
void CollectTagValues (std::vector< TagValue > &values, bool &exhaustive) const override
 Collects the (tag,value) pairs this condition can match for.
 
bool Evaluate (const TagMap &tagMap) const override
 
 TagBinaryCondition (TagId tag, BinaryOperator binaryOperator, const size_t &tagValue)
 
 TagBinaryCondition (TagId tag, BinaryOperator binaryOperator, const std::string &tagValue)
 
- Public Member Functions inherited from osmscout::TagCondition
virtual ~TagCondition ()=default
 

Detailed Description

Returns true, if the value of the given tag fulfills the given boolean condition in regard to the comparison value.

Constructor & Destructor Documentation

◆ TagBinaryCondition() [1/2]

osmscout::TagBinaryCondition::TagBinaryCondition ( TagId  tag,
BinaryOperator  binaryOperator,
const std::string &  tagValue 
)

◆ TagBinaryCondition() [2/2]

osmscout::TagBinaryCondition::TagBinaryCondition ( TagId  tag,
BinaryOperator  binaryOperator,
const size_t &  tagValue 
)

Member Function Documentation

◆ CollectTagKeys()

void osmscout::TagBinaryCondition::CollectTagKeys ( std::vector< TagId > &  keys,
bool &  guaranteed 
) const
inlineoverridevirtual

Collects the tag keys that act as primary discriminators for this condition.

If 'guaranteed' is true, at least one of the returned keys is guaranteed to be present in the tag map whenever this condition evaluates to true, i.e. the condition can only match objects that carry one of these keys. If 'guaranteed' is false, the condition may evaluate to true even if none of the returned keys is present (e.g. conditions containing negation) and the caller has to always evaluate the condition.

Implements osmscout::TagCondition.

◆ CollectTagValues()

void osmscout::TagBinaryCondition::CollectTagValues ( std::vector< TagValue > &  values,
bool &  exhaustive 
) const
overridevirtual

Collects the (tag,value) pairs this condition can match for.

If 'exhaustive' is true, the condition cannot evaluate to true unless the tag map carries at least one of the returned (tag,value) pairs, i.e. the returned pairs are a conservative superset of the values that can make it match. If 'exhaustive' is false, the condition may match for a value that is not listed (e.g. an existence, ordering or negated condition) and has to be evaluated for every object that carries one of its keys.

The default reports no pairs and is not exhaustive, which is always safe.

Reimplemented from osmscout::TagCondition.

References osmscout::operatorEqual.

◆ Evaluate()


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