libosmscout 0.1
Loading...
Searching...
No Matches
osmscout::TypeInfoSet Class Referencefinal

Custom data structure to efficiently handle a set of TypeInfoRef. More...

#include <TypeInfoSet.h>

Public Member Functions

void Adapt (const TypeConfig &typeConfig)
 
void Add (const TypeInfoSet &types)
 
size_t AllocatedBytes () const
 The bytes the storage of the set allocates: the bitmap over the type indices, one bit per defined type rounded up to whole 64 bit words, plus one slot per contained type.
 
TypeInfoSetConstIterator begin () const
 
void Clear ()
 
bool Empty () const
 
TypeInfoSetConstIterator end () const
 
void Intersection (const TypeInfoSet &otherTypes)
 
bool Intersects (const TypeInfoSet &otherTypes) const
 Returns 'true' if at least one type is set in both Sets.
 
bool IsSet (const TypeInfoRef &type) const
 
bool operator!= (const TypeInfoSet &other) const
 
TypeInfoSet & operator= (const TypeInfoSet &other)=default
 
TypeInfoSet & operator= (TypeInfoSet &&other) noexcept=default
 
bool operator== (const TypeInfoSet &other) const
 
void Remove (const TypeInfoRef &type)
 
void Remove (const TypeInfoSet &otherTypes)
 
void Set (const std::vector< TypeInfoRef > &types)
 
void Set (const TypeInfoRef &type)
 
void Set (const TypeInfoSet &other)
 
size_t Size () const
 
 TypeInfoSet ()=default
 
 TypeInfoSet (const std::vector< TypeInfoRef > &types)
 
 TypeInfoSet (const TypeConfig &typeConfig)
 
 TypeInfoSet (const TypeInfoSet &other)=default
 
 TypeInfoSet (TypeInfoSet &&other) noexcept
 
 ~TypeInfoSet ()=default
 

Detailed Description

Custom data structure to efficiently handle a set of TypeInfoRef.

The set holds one bit per type index and the contained types in ascending index order, using the fact, that TypeInfo internally have a continuously running index variable. Its operations are independent of the number of types the type configuration defines; the bytes the set allocates follow the contained types and not the number of types the type configuration defines.

Note
Any modification of the set (Set(), Remove(), Clear(), Intersection(), Adapt(), assignment) invalidates all iterators of the set. Do not modify a set while iterating it; iterate over a copy instead.

Constructor & Destructor Documentation

◆ TypeInfoSet() [1/5]

osmscout::TypeInfoSet::TypeInfoSet ( )
default

◆ ~TypeInfoSet()

osmscout::TypeInfoSet::~TypeInfoSet ( )
default

◆ TypeInfoSet() [2/5]

osmscout::TypeInfoSet::TypeInfoSet ( const TypeConfig &  typeConfig)
explicit

◆ TypeInfoSet() [3/5]

osmscout::TypeInfoSet::TypeInfoSet ( const std::vector< TypeInfoRef > &  types)
explicit

References Set().

◆ TypeInfoSet() [4/5]

osmscout::TypeInfoSet::TypeInfoSet ( const TypeInfoSet &  other)
default

◆ TypeInfoSet() [5/5]

osmscout::TypeInfoSet::TypeInfoSet ( TypeInfoSet &&  other)
noexcept

Member Function Documentation

◆ Adapt()

void osmscout::TypeInfoSet::Adapt ( const TypeConfig &  typeConfig)

◆ Add()

void osmscout::TypeInfoSet::Add ( const TypeInfoSet &  types)

◆ AllocatedBytes()

size_t osmscout::TypeInfoSet::AllocatedBytes ( ) const
inline

The bytes the storage of the set allocates: the bitmap over the type indices, one bit per defined type rounded up to whole 64 bit words, plus one slot per contained type.

◆ begin()

TypeInfoSetConstIterator osmscout::TypeInfoSet::begin ( ) const
inline

◆ Clear()

◆ Empty()

◆ end()

TypeInfoSetConstIterator osmscout::TypeInfoSet::end ( ) const
inline

◆ Intersection()

void osmscout::TypeInfoSet::Intersection ( const TypeInfoSet &  otherTypes)

◆ Intersects()

bool osmscout::TypeInfoSet::Intersects ( const TypeInfoSet &  otherTypes) const

Returns 'true' if at least one type is set in both Sets.

Else 'false' is returned.

◆ IsSet()

◆ operator!=()

bool osmscout::TypeInfoSet::operator!= ( const TypeInfoSet &  other) const

◆ operator=() [1/2]

TypeInfoSet & osmscout::TypeInfoSet::operator= ( const TypeInfoSet &  other)
default

◆ operator=() [2/2]

TypeInfoSet & osmscout::TypeInfoSet::operator= ( TypeInfoSet &&  other)
defaultnoexcept

◆ operator==()

bool osmscout::TypeInfoSet::operator== ( const TypeInfoSet &  other) const

◆ Remove() [1/2]

void osmscout::TypeInfoSet::Remove ( const TypeInfoRef &  type)

◆ Remove() [2/2]

void osmscout::TypeInfoSet::Remove ( const TypeInfoSet &  otherTypes)

References Clear(), and Remove().

◆ Set() [1/3]

void osmscout::TypeInfoSet::Set ( const std::vector< TypeInfoRef > &  types)

References Clear(), and Set().

◆ Set() [2/3]

◆ Set() [3/3]

void osmscout::TypeInfoSet::Set ( const TypeInfoSet &  other)

◆ Size()

size_t osmscout::TypeInfoSet::Size ( ) const
inline

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