Libosmium  2.22.0
Fast and flexible C++ library for working with OpenStreetMap data
Loading...
Searching...
No Matches
osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp > Class Template Reference

#include <filter.hpp>

Classes

struct  Rule
 

Public Types

using filter_type = Filter<TKey, TValue, TKeyComp, TValueComp>
 
using argument_type = const osmium::Tag&
 
using result_type = bool
 
using iterator = osmium::memory::CollectionFilterIterator<filter_type, const osmium::Tag>
 

Public Member Functions

 Filter (bool default_result=false)
 
template<typename V = TValue, typename std::enable_if_t<!std::is_void< V >::value, int > = 0>
Filteradd (bool result, const key_type &key, const value_type &value)
 
Filteradd (bool result, const key_type &key)
 
bool operator() (const osmium::Tag &tag) const
 
size_t count () const noexcept
 
bool empty () const noexcept
 

Private Types

using key_type = TKey
 
using value_type = std::conditional_t<std::is_void<TValue>::value, bool, TValue>
 

Private Attributes

std::vector< Rulem_rules
 
bool m_default_result
 

Detailed Description

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
class osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >
Deprecated
Use osmium::TagsFilter instead.

Member Typedef Documentation

◆ argument_type

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
using osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::argument_type = const osmium::Tag&

◆ filter_type

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
using osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::filter_type = Filter<TKey, TValue, TKeyComp, TValueComp>

◆ iterator

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
using osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::iterator = osmium::memory::CollectionFilterIterator<filter_type, const osmium::Tag>

◆ key_type

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
using osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::key_type = TKey
private

◆ result_type

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
using osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::result_type = bool

◆ value_type

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
using osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::value_type = std::conditional_t<std::is_void<TValue>::value, bool, TValue>
private

Constructor & Destructor Documentation

◆ Filter()

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::Filter ( bool default_result = false)
inlineexplicit

Member Function Documentation

◆ add() [1/2]

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
Filter & osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::add ( bool result,
const key_type & key )
inline

◆ add() [2/2]

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
template<typename V = TValue, typename std::enable_if_t<!std::is_void< V >::value, int > = 0>
Filter & osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::add ( bool result,
const key_type & key,
const value_type & value )
inline

◆ count()

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
size_t osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::count ( ) const
inlinenoexcept

Return the number of rules in this filter.

Complexity: Constant.

◆ empty()

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
bool osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::empty ( ) const
inlinenoexcept

Is this filter empty, ie are there no rules defined?

Complexity: Constant.

◆ operator()()

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
bool osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::operator() ( const osmium::Tag & tag) const
inline

Member Data Documentation

◆ m_default_result

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
bool osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::m_default_result
private

◆ m_rules

template<typename TKey, typename TValue = void, typename TKeyComp = match_key<TKey>, typename TValueComp = match_value<TValue>>
std::vector<Rule> osmium::tags::Filter< TKey, TValue, TKeyComp, TValueComp >::m_rules
private

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