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

Mutable collection of overlay items. More...

Inheritance diagram for gem::OverlayMutableCollection:
Collaboration diagram for gem::OverlayMutableCollection:

Public Member Functions

OverlayMutableCollectionadd (int overlayId) noexcept
 Add an online overlay to the collection.
OverlayMutableCollectionadd (int overlayId, int categoryId) noexcept
 Add an online overlay category to the collection.
int remove (int overlayId) noexcept
 Remove the overlay from the collection.
int remove (int overlayId, int categoryId) noexcept
 Remove the overlay category id from the collection.
OverlayMutableCollectionclear () noexcept
 Clear all overlays in collection.
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.

Detailed Description

Mutable collection of overlay items.

Implements share-read / write Api object over IOverlayCollection. Extends OverlayCollection by allowing overlays to be added, removed, or updated in a MapView at runtime.

Member Function Documentation

◆ add() [1/2]

OverlayMutableCollection & gem::OverlayMutableCollection::add ( int overlayId)
inlinenoexcept

Add an online overlay to the collection.

Parameters
[in]overlayIdThe overlay id. The list of available overlays can be obtained by using OverlayService

Add an overlay to the collection. If the overlay has categories, all are added to the collection

Returns
reference to this object

◆ add() [2/2]

OverlayMutableCollection & gem::OverlayMutableCollection::add ( int overlayId,
int categoryId )
inlinenoexcept

Add an online overlay category to the collection.

Parameters
[in]overlayIdThe overlay id
[in]categoryIdThe overlay category id in OverlayInfo.getCategories result list

Add an overlay category id to the collection

Returns
reference to this object

◆ clear()

OverlayMutableCollection & gem::OverlayMutableCollection::clear ( )
inlinenoexcept

Clear all overlays in collection.

Returns
reference to this object

◆ contains() [1/2]

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

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
inlinenoexceptinherited

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
inlinenoexceptinherited

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
inlinenoexceptinherited

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
inlineinherited

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
inlineinherited

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

◆ remove() [1/2]

int gem::OverlayMutableCollection::remove ( int overlayId)
inlinenoexcept

Remove the overlay from the collection.

Parameters
[in]overlayIdThe overlay id. The list of available overlays can be obtained by using OverlayService
Returns
KNoError on success, error::KNotFound if the overlay is not in the collection

◆ remove() [2/2]

int gem::OverlayMutableCollection::remove ( int overlayId,
int categoryId )
inlinenoexcept

Remove the overlay category id from 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
KNoError on success, error::KNotFound if the overlay category is not in the collection

◆ size()

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

Get the number of overlay datasets in this collection.

Returns
The number of overlays