Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::OverlayCollection Class Reference

Immutable collection of overlay items. More...

Inheritance diagram for gem::OverlayCollection:
Collaboration diagram for gem::OverlayCollection:

Public Member Functions

int size () const noexcept
 Get the number of overlay datasets in this collection.
const OverlayInfoRef getOverlayAt (int index) const noexcept
 Get the overlay at the specified index.
const OverlayInfoRef getOverlayByUid (int overlayUid) const noexcept
 Get the overlay having the specified UID.
bool contains (int overlayId) const noexcept
 Check if overlay is added to the collection.
bool contains (int overlayId, int categoryId) const noexcept
 Check if overlay category is added to the collection.
template<typename TCollector>
bool iterateOverlays (TCollector collector) const
 Iterate all overlays in the collection.
template<typename TCollector>
bool iterateOverlaysAndCategories (TCollector collector) const
 Iterate all overlays & categories in the collection.

Protected Types

using Base = ApiObject<IOverlayCollection, false>
 Base.

Detailed Description

Immutable collection of overlay items.

Implements share-read / write Api object over the read-only IOverlayCollection part.

Represents a fixed set of overlays, typically returned by queries on map or layer state. Allows inspection and iteration but does not support modifications.

Member Function Documentation

◆ contains() [1/2]

bool gem::OverlayCollection::contains ( int overlayId) const
inlinenoexcept

Check if overlay is added to the collection.

Parameters
[in]overlayIdThe overlay id. The list of available overlays can be obtained by using OverlayService
Returns
True if overlay is in the collection, false otherwise

◆ contains() [2/2]

bool gem::OverlayCollection::contains ( int overlayId,
int categoryId ) const
inlinenoexcept

Check if overlay category is added to the collection.

Parameters
[in]overlayIdThe overlay id. The list of available overlays can be obtained by using OverlayService
[in]categoryIdThe overlay category id in OverlayInfo.getCategories result list
Returns
True if overlay category is in the collection, false otherwise

◆ getOverlayAt()

const OverlayInfoRef gem::OverlayCollection::getOverlayAt ( int index) const
inlinenoexcept

Get the overlay at the specified index.

Parameters
indexThe index of the overlay
Returns
Empty if the index is out of bounds

◆ getOverlayByUid()

const OverlayInfoRef gem::OverlayCollection::getOverlayByUid ( int overlayUid) const
inlinenoexcept

Get the overlay having the specified UID.

Parameters
overlayUidThe overlay UID
Returns
Empty if the overlay is not found

◆ iterateOverlays()

template<typename TCollector>
bool gem::OverlayCollection::iterateOverlays ( TCollector collector) const
inline

Iterate all overlays in the collection.

Collector should return true if iteration should continue and false if iteration should stop

Parameters
collectorThe collector function
Returns
True if iteration was successful, false otherwise
Template Parameters
TCollectorThe collector function type

◆ iterateOverlaysAndCategories()

template<typename TCollector>
bool gem::OverlayCollection::iterateOverlaysAndCategories ( TCollector collector) const
inline

Iterate all overlays & categories in the collection.

Collector should return true if iteration should continue and false if iteration should stop

Parameters
collectorThe collector function
Returns
True if iteration was successful, false otherwise

◆ size()

int gem::OverlayCollection::size ( ) const
inlinenoexcept

Get the number of overlay datasets in this collection.

Returns
The number of overlays