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

LandmarkStore object. More...

Inheritance diagram for gem::LandmarkStore:
Collaboration diagram for gem::LandmarkStore:

Public Member Functions

 LandmarkStore (const LandmarkStore &)=delete
 LandmarkStore (LandmarkStore &&store)=default
 Default move constructor noexcept is deduced.
LandmarkStore & operator= (const LandmarkStore &)=delete
LandmarkStore & operator= (LandmarkStore &&store)=default
 Default move assignment noexcept is deduced.
int getId () const
 Get the ID of the landmark store.
int getType () const noexcept
 Get the type of the landmark store.
const StringRef getName () const noexcept
 Get the landmark store name.
LandmarkStore & addCategory (LandmarkCategory &category) noexcept
 Add a new category to the store.
LandmarkStore & removeCategory (int categoryId, bool removeLmkContent=false) noexcept
 Remove the specified category.
LandmarkCategory getCategoryById (int categoryId) const noexcept
 Get the category by ID.
LandmarkStore & updateCategory (LandmarkCategory const &category) noexcept
 Update the specified category.
LandmarkCategoryList getCategories () const noexcept
 Get the list of all categories.
LandmarkStore & addLandmark (Landmark &landmark, int categoryId=KUncategorizedLandmarkCategId) noexcept
 Add a landmark to the specified category in the landmark store.
LandmarkCategoryList getCategories (int landmarkId) const noexcept
 Get the list of categories for the specified landmark.
Landmark getLandmark (int landmarkId) const noexcept
 Get the specified landmark.
LandmarkStore & removeLandmark (int landmarkId) noexcept
 Remove the specified landmark.
LandmarkStore & removeAllLandmarks () noexcept
 Remove all landmarks from store.
int getLandmarkCount (int categoryId=KInvalidLandmarkCategId) const noexcept
 Get the number of all landmarks within the specified category.
LandmarkList getLandmarks (int categoryId=KInvalidLandmarkCategId) const noexcept
 Get the landmarks within the specified category.
LandmarkList getLandmarks (const GeographicArea &area, int categoryId=KInvalidLandmarkCategId) const noexcept
 Get the landmarks within the specified area.
StrongPointer< LandmarkBrowseSessioncreateLandmarkBrowseSession (LandmarkBrowseSessionSettings settings=LandmarkBrowseSessionSettings()) noexcept
 Create a landmarks browse session with the specified settings.
LandmarkStore & updateLandmark (Landmark &landmark) noexcept
 Update the information about a landmark.
LandmarkStore & setLandmarkCategory (Landmark &landmark, int categoryId) noexcept
 Set landmark category id.
int importLandmarks (const DataBuffer &data, ELandmarkFileFormat format, const Image &image, ProgressListener listener, int categoryId=KUncategorizedLandmarkCategId) noexcept
 Async import landmarks from given buffer format.
int importLandmarks (const String &path, ELandmarkFileFormat format, const Image &image, ProgressListener listener, int categoryId=KUncategorizedLandmarkCategId) noexcept
 Async import landmarks from given file format.
void cancelImportLandmarks () noexcept
 Cancel async import landmarks operation.
String getFilePath () const noexcept
 Get landmark store path.
LandmarkStore & startFastUpdateMode () noexcept
 Start landmark store fast update mode.
LandmarkStore & stopFastUpdateMode (bool discard=false) noexcept
 Stop landmark store fast update mode.
bool isFastUpdateMode () const noexcept
 Get fast update mode state.
Image getImage () const noexcept
 Get the landmark store image.
int setImage (const Image &img) noexcept
 Set the landmark store image.

Detailed Description

LandmarkStore object.

Implements share-read / write Api object over ILandmarkStore.

Constructor & Destructor Documentation

◆ LandmarkStore()

gem::LandmarkStore::LandmarkStore ( LandmarkStore && store)
default

Default move constructor noexcept is deduced.

Parameters
storeThe object to move

Member Function Documentation

◆ addCategory()

LandmarkStore & gem::LandmarkStore::addCategory ( LandmarkCategory & category)
inlinenoexcept

Add a new category to the store.

After this method call, the category object that is passed as a parameter belongs to this landmark store. The category must have a name.

Returns
self
Parameters
[in]categoryThe category to be added

◆ addLandmark()

LandmarkStore & gem::LandmarkStore::addLandmark ( Landmark & landmark,
int categoryId = KUncategorizedLandmarkCategId )
inlinenoexcept

Add a landmark to the specified category in the landmark store.

If the landmark already exists in the landmark store, only the category info is updated

Parameters
[in]landmarkThe landmark to be added to the landmark store in the specified category.
[in]categoryIdThe ID of the category where the landmark will be added.

When the ID is KUncategorizedLandmarkCategId then the landmark will be added as uncategorized

Returns
self

◆ createLandmarkBrowseSession()

StrongPointer< LandmarkBrowseSession > gem::LandmarkStore::createLandmarkBrowseSession ( LandmarkBrowseSessionSettings settings = LandmarkBrowseSessionSettings())
inlinenoexcept

Create a landmarks browse session with the specified settings.

Returns
session id on Success
KGeneral Any other error
Parameters
[in]settingsThe settings for the browse session

◆ getCategories() [1/2]

LandmarkCategoryList gem::LandmarkStore::getCategories ( ) const
inlinenoexcept

Get the list of all categories.

Returns
The list of categories

◆ getCategories() [2/2]

LandmarkCategoryList gem::LandmarkStore::getCategories ( int landmarkId) const
inlinenoexcept

Get the list of categories for the specified landmark.

Parameters
[in]landmarkIdThe landmark id
Returns
The list of categories

◆ getCategoryById()

LandmarkCategory gem::LandmarkStore::getCategoryById ( int categoryId) const
inlinenoexcept

Get the category by ID.

Parameters
[in]categoryIdThe category id
Returns
The category object

◆ getFilePath()

String gem::LandmarkStore::getFilePath ( ) const
inlinenoexcept

Get landmark store path.

Returns
The landmark store path

◆ getId()

int gem::LandmarkStore::getId ( ) const
inline

Get the ID of the landmark store.

Returns
The landmark store id

◆ getImage()

Image gem::LandmarkStore::getImage ( ) const
inlinenoexcept

Get the landmark store image.

Returns
The landmark store image

◆ getLandmark()

Landmark gem::LandmarkStore::getLandmark ( int landmarkId) const
inlinenoexcept

Get the specified landmark.

Parameters
[in]landmarkIdThe landmark id
Returns
The landmark object

◆ getLandmarkCount()

int gem::LandmarkStore::getLandmarkCount ( int categoryId = KInvalidLandmarkCategId) const
inlinenoexcept

Get the number of all landmarks within the specified category.

If the category ID is KUncategorizedLandmarkCategId, the uncategorized landmarks count is returned.

If the category ID is KInvalidLandmarkCategId, the total landmarks count is returned.

Parameters
[in]categoryIdThe category id
Returns
The number of landmarks

◆ getLandmarks() [1/2]

LandmarkList gem::LandmarkStore::getLandmarks ( const GeographicArea & area,
int categoryId = KInvalidLandmarkCategId ) const
inlinenoexcept

Get the landmarks within the specified area.

Parameters
[in]areaThe geographic area queried for landmarks
[in]categoryIdThe category id for which landmarks are retrieved ( default KInvalidLandmarkCategId meaning all categories )

If the category ID is KUncategorizedLandmarkCategId, all uncategorized landmarks are retrieved.

If the category ID is KInvalidLandmarkCategId, all landmarks are retrieved.

Returns
The landmark list corresponding to given criteria

◆ getLandmarks() [2/2]

LandmarkList gem::LandmarkStore::getLandmarks ( int categoryId = KInvalidLandmarkCategId) const
inlinenoexcept

Get the landmarks within the specified category.

Parameters
[in]categoryIdThe category id for which landmarks are retrieved ( default KInvalidLandmarkCategId meaning all categories )

If the category ID is KUncategorizedLandmarkCategId, all uncategorized landmarks are retrieved.

If the category ID is KInvalidLandmarkCategId, all landmarks are retrieved.

Returns
The landmark list

◆ getName()

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

Get the landmark store name.

Returns
The landmark store name

◆ getType()

int gem::LandmarkStore::getType ( ) const
inlinenoexcept

Get the type of the landmark store.

The result value is in range of ELandmarkStoreType

Returns
The landmark store type

◆ importLandmarks() [1/2]

int gem::LandmarkStore::importLandmarks ( const DataBuffer & data,
ELandmarkFileFormat format,
const Image & image,
ProgressListener listener,
int categoryId = KUncategorizedLandmarkCategId )
inlinenoexcept

Async import landmarks from given buffer format.

Parameters
[in]dataThe data buffer
[in]formatThe data buffer format
[in]imageThe landmark map image. If left empty, a default image is assigned
[in]listenerOperation progress listener
[in]categoryIdThe category for the new imported landmarks. The category must exist or use KUncategorizedLandmarkCategId set the landmark as uncategorized
Returns
The operation start error code

◆ importLandmarks() [2/2]

int gem::LandmarkStore::importLandmarks ( const String & path,
ELandmarkFileFormat format,
const Image & image,
ProgressListener listener,
int categoryId = KUncategorizedLandmarkCategId )
inlinenoexcept

Async import landmarks from given file format.

Parameters
[in]pathThe file path
[in]formatThe file format
[in]imageThe landmark map image. If left empty, a default image is assigned
[in]listenerOperation progress listener
[in]categoryIdThe category for the new imported landmarks. The category must exist or use KUncategorizedLandmarkCategId set the landmark as uncategorized
Returns
The operation start error code

◆ isFastUpdateMode()

bool gem::LandmarkStore::isFastUpdateMode ( ) const
inlinenoexcept

Get fast update mode state.

Returns
true if fast update mode is active

◆ operator=()

LandmarkStore & gem::LandmarkStore::operator= ( LandmarkStore && store)
default

Default move assignment noexcept is deduced.

Parameters
storeThe object to move
Returns
The moved object

◆ removeAllLandmarks()

LandmarkStore & gem::LandmarkStore::removeAllLandmarks ( )
inlinenoexcept

Remove all landmarks from store.

For performance issue the function will notify via ILandmarkStoreListener::onLandmarksRemoved with an empty list

Returns
self

◆ removeCategory()

LandmarkStore & gem::LandmarkStore::removeCategory ( int categoryId,
bool removeLmkContent = false )
inlinenoexcept

Remove the specified category.

Parameters
[in]categoryIdThe category id
[in]removeLmkContentRequest to remove all landmarks belonging to the category

If removeLmkContent = false, the landmarks belonging to the category are marked uncategorized

Returns
self

◆ removeLandmark()

LandmarkStore & gem::LandmarkStore::removeLandmark ( int landmarkId)
inlinenoexcept

Remove the specified landmark.

Returns
self
Parameters
[in]landmarkIdThe landmark id

◆ setImage()

int gem::LandmarkStore::setImage ( const Image & img)
inlinenoexcept

Set the landmark store image.

Parameters
[in]imgThe landmark store image.

Setting a valid landmark store image will override individual items images, see Landmark::getImage

Setting an empty landmark store image will restore individual items images, see Landmark::getImage

Returns
Error code

◆ setLandmarkCategory()

LandmarkStore & gem::LandmarkStore::setLandmarkCategory ( Landmark & landmark,
int categoryId )
inlinenoexcept

Set landmark category id.

Parameters
[in]landmarkThe landmark object
[in]categoryIdThe category id. Use KUncategorizedLandmarkCategId to set the landmark as uncategorized
Returns
self

◆ startFastUpdateMode()

LandmarkStore & gem::LandmarkStore::startFastUpdateMode ( )
inlinenoexcept

Start landmark store fast update mode.

Fast update mode - allow fast insert, delete and update operations This mode should be used with caution because if a power failure or process crash interrupts it, the database will likely be corrupted and will be deleted at next startup This is intended for fast import of external landmarks into application format

Returns
self

◆ stopFastUpdateMode()

LandmarkStore & gem::LandmarkStore::stopFastUpdateMode ( bool discard = false)
inlinenoexcept

Stop landmark store fast update mode.

Parameters
[in]discardDiscard fast update mode session changes. Default is false
Returns
self

◆ updateCategory()

LandmarkStore & gem::LandmarkStore::updateCategory ( LandmarkCategory const & category)
inlinenoexcept

Update the specified category.

The category object must belong to this landmark store. No fields of the parameter will be updated by this call.

Returns
self
Parameters
[in]categoryThe category to be updated

◆ updateLandmark()

LandmarkStore & gem::LandmarkStore::updateLandmark ( Landmark & landmark)
inlinenoexcept

Update the information about a landmark.

This updates only the information about a landmark and does not modify the categories the landmark belongs to. The landmark instance passed in as the parameter must be an instance that belongs to this landmark store. Calling this method updates the timestamp of the landmark.

Returns
self
Parameters
[in]landmarkThe landmark to be updated