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

Marker collection. More...

Inheritance diagram for gem::MarkerCollection:
Collaboration diagram for gem::MarkerCollection:

Public Member Functions

 MarkerCollection (EMarkerType type, const String &name)
 Default constructor.
 MarkerCollection (const MarkerCollection &v)
 Default copy constructor.
 MarkerCollection (MarkerCollection &&v)=default
 Default move constructor noexcept is deduced.
MarkerCollectionoperator= (const MarkerCollection &v)
 Default copy assignment.
MarkerCollectionoperator= (MarkerCollection &&v)=default
 Default move assignment noexcept is deduced.
bool operator== (const MarkerCollection &markerCollection) const
 Comparison operator equal.
bool operator!= (const MarkerCollection &coll) const
 Comparison operator not equal.
LargeInteger getId () const noexcept
 Get collection id.
EMarkerType getType () const noexcept
 Get collection type.
const StringRef getName () const noexcept
 Get collection name.
void setName (const String &name) noexcept
 Set collection name.
int size () const noexcept
 Get marker count.
MarkerRef getMarkerAt (int index) const noexcept
 Get the marker at the given index.
Marker getMarkerById (LargeInteger id) const noexcept
 Get the marker with the given id.
int indexOf (const Marker &marker) const noexcept
 Get the index of the given marker.
int indexOf (LargeInteger id) const noexcept
 Get the index of the given marker id.
MarkerRef getPointsGroupHead (LargeInteger markerId) const
 Gets the points group head for the given marker id.
MarkerList getPointsGroupComponents (LargeInteger groupId) const
 Gets the points group components.
MarkerCollectionadd (const Marker &marker=Marker(), int index=-1) noexcept
 Add a new marker to collection.
MarkerCollectiondel (int index) noexcept
 Delete a marker by index.
void clear () noexcept
 Delete all markers.
void hitTest (const RectangleGeographicArea &area, MarkerMatchList &list, const Marker *ignore=nullptr) const noexcept
 Hit test in collection markers.
RectangleGeographicArea getArea () const noexcept
 Get whole collection enclosing area.
template<typename TCollector>
bool iterateMarkers (TCollector collector) const noexcept
 Iterate marker collection markers and call collector for each.
int save (DataBuffer &buffer) const noexcept
 Serialize to buffer.

Static Public Member Functions

static std::pair< MarkerCollection, int > load (const DataBuffer &buffer) noexcept
 Create & load from buffer.

Detailed Description

Marker collection.

Implements share-read / share-write Api object over IMarkerCollection

Constructor & Destructor Documentation

◆ MarkerCollection() [1/3]

gem::MarkerCollection::MarkerCollection ( EMarkerType type,
const String & name )
inline

Default constructor.

Parameters
[in]typeMarker type
[in]nameMarker collection name

◆ MarkerCollection() [2/3]

gem::MarkerCollection::MarkerCollection ( const MarkerCollection & v)
inline

Default copy constructor.

Parameters
[in]vMarkerCollection

◆ MarkerCollection() [3/3]

gem::MarkerCollection::MarkerCollection ( MarkerCollection && v)
default

Default move constructor noexcept is deduced.

Parameters
vMarkerCollection

Member Function Documentation

◆ add()

MarkerCollection & gem::MarkerCollection::add ( const Marker & marker = Marker(),
int index = -1 )
inlinenoexcept

Add a new marker to collection.

Parameters
[in]markerThe marker added to the collection
[in]indexThe new marker position in collection. -1 means at the collection end ( topmost )
Returns
MarkerCollection reference

◆ del()

MarkerCollection & gem::MarkerCollection::del ( int index)
inlinenoexcept

Delete a marker by index.

Parameters
[in]indexThe marker index to be deleted
Returns
MarkerCollection reference

◆ getArea()

RectangleGeographicArea gem::MarkerCollection::getArea ( ) const
inlinenoexcept

Get whole collection enclosing area.

Returns
Collection rectangle geographic area

◆ getId()

LargeInteger gem::MarkerCollection::getId ( ) const
inlinenoexcept

Get collection id.

Returns
Collection id

◆ getMarkerAt()

MarkerRef gem::MarkerCollection::getMarkerAt ( int index) const
inlinenoexcept

Get the marker at the given index.

Return empty if index is not valid

Parameters
[in]indexThe marker index
Returns
Marker reference

◆ getMarkerById()

Marker gem::MarkerCollection::getMarkerById ( LargeInteger id) const
inlinenoexcept

Get the marker with the given id.

Parameters
[in]idMarker id
Returns
Marker

◆ getName()

const StringRef gem::MarkerCollection::getName ( ) const
inlinenoexcept

Get collection name.

Returns
Collection name

◆ getPointsGroupComponents()

MarkerList gem::MarkerCollection::getPointsGroupComponents ( LargeInteger groupId) const
inline

Gets the points group components.

Parameters
[in]groupIdThe group id

This requires the collection to be added to a map view collection with MarkerCollectionRenderSettings::buildPointsGroupConfig set to true

If points group head info is not available the function will return a default list and will set the API error accordingly

Returns
Points group components list

◆ getPointsGroupHead()

MarkerRef gem::MarkerCollection::getPointsGroupHead ( LargeInteger markerId) const
inline

Gets the points group head for the given marker id.

Parameters
[in]markerIdThe marker id belonging to the points group

This requires the collection to be added to a map view collection with MarkerCollectionRenderSettings::buildPointsGroupConfig set to true

If points group head info is not available the function will return a reference to the queried marker and will set the API error accordingly

If markerId is already a points group head the function will return a reference to the queried marker and will set the API error accordingly

Returns
Points group head marker reference

◆ getType()

EMarkerType gem::MarkerCollection::getType ( ) const
inlinenoexcept

Get collection type.

Returns
Collection type

◆ hitTest()

void gem::MarkerCollection::hitTest ( const RectangleGeographicArea & area,
MarkerMatchList & list,
const Marker * ignore = nullptr ) const
noexcept

Hit test in collection markers.

Parameters
[in]areaThe geographic area to be tested
[out]listThe list of markers that intersect the area
[in]ignoreThe marker to be ignored in the test

◆ indexOf() [1/2]

int gem::MarkerCollection::indexOf ( const Marker & marker) const
inlinenoexcept

Get the index of the given marker.

Parameters
[in]markerThe marker
Returns
Marker index

◆ indexOf() [2/2]

int gem::MarkerCollection::indexOf ( LargeInteger id) const
inlinenoexcept

Get the index of the given marker id.

Parameters
[in]idThe marker id
Returns
Marker index

◆ iterateMarkers()

template<typename TCollector>
bool gem::MarkerCollection::iterateMarkers ( TCollector collector) const
inlinenoexcept

Iterate marker collection markers and call collector for each.

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

Template Parameters
TCollectorThe collector function type
Parameters
[in]collectorThe collector function
Returns
true if iteration was completed, false if it was stopped by the collector

◆ load()

std::pair< MarkerCollection, int > gem::MarkerCollection::load ( const DataBuffer & buffer)
inlinestaticnoexcept

Create & load from buffer.

Parameters
[in]bufferThe buffer to load from
Returns
MarkerCollection and error code

◆ operator!=()

bool gem::MarkerCollection::operator!= ( const MarkerCollection & coll) const
inline

Comparison operator not equal.

Parameters
[in]collMarkerCollection
Returns
true if not equal

◆ operator=() [1/2]

MarkerCollection & gem::MarkerCollection::operator= ( const MarkerCollection & v)
inline

Default copy assignment.

Parameters
[in]vMarkerCollection
Returns
MarkerCollection reference

◆ operator=() [2/2]

MarkerCollection & gem::MarkerCollection::operator= ( MarkerCollection && v)
default

Default move assignment noexcept is deduced.

Parameters
vMarkerCollection
Returns
MarkerCollection reference

◆ operator==()

bool gem::MarkerCollection::operator== ( const MarkerCollection & markerCollection) const
inline

Comparison operator equal.

Parameters
[in]markerCollectionMarkerCollection
Returns
true if equal

◆ save()

int gem::MarkerCollection::save ( DataBuffer & buffer) const
inlinenoexcept

Serialize to buffer.

Parameters
[out]bufferThe buffer to serialize to
Returns
Error code

◆ setName()

void gem::MarkerCollection::setName ( const String & name)
inlinenoexcept

Set collection name.

Parameters
[in]nameCollection name

◆ size()

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

Get marker count.

Returns
Marker count