LuciadCPillar C# 2023.1.04
Luciad.Models.Features.FeatureModelPersistenceManager Class Reference

This class can be used to save changes to an IFeatureModel's backend. More...

Inheritance diagram for Luciad.Models.Features.FeatureModelPersistenceManager:

Classes

class  Builder
 IFeatureModel implementations that have support for saving changes can use this class to create a FeatureModelPersistenceManager instance. More...
 

Public Member Functions

void DiscardChanges ()
 Discards the unsaved (in-memory) changes of the IFeatureModel, restoring the IFeatureModel's state back to that of its backend. More...
 
void Dispose ()
 
Luciad.Models.Features.FeatureSaveErrorInfo SaveChanges ()
 Save the in-memory changes in the IFeatureModel's backend (for example a file or database). More...
 

Static Public Member Functions

static Luciad.Models.Features.FeatureModelPersistenceManager.Builder NewBuilder ()
 Returns a new FeatureModelPersistenceManager builder. More...
 

Properties

System.Collections.Generic.IList< Luciad.Models.Features.FeatureChangeChanges [get]
 

Detailed Description

This class can be used to save changes to an IFeatureModel's backend.

The main goal of this class it to give more control over when changes are persisted. An important difference between the updater and the FeatureModelPersistenceManager is the frequency at which they are used, with the FeatureModelPersistenceManager typically being used less often. In other words: The updater typically only makes in-memory changes. These can occur in a high frequency and can be executed fast. FeatureModelPersistenceManager can persist these in-memory changes. This is slower to execute, can require more resources (disk access for example), but can be performed at a lower frequency.

For example: when dragging a point from one location to another in an editor configured to update on any change, many small updates are done along the way. In contrast, a save typically only happens when the editing is finished. A FeatureModelPersistenceManager can be accessed through the model using IFeatureModel::getPersistenceManager. See this article for more information. 2023.1

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureModelPersistenceManager.

Member Function Documentation

◆ DiscardChanges()

void Luciad.Models.Features.FeatureModelPersistenceManager.DiscardChanges ( )
inline

Discards the unsaved (in-memory) changes of the IFeatureModel, restoring the IFeatureModel's state back to that of its backend.

All observers will be notified with a FeatureModelEvent containing the FeatureChanges necessary to go back to the backend's state.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureModelPersistenceManager::discardChanges.

◆ Dispose()

void Luciad.Models.Features.FeatureModelPersistenceManager.Dispose ( )
inline

◆ NewBuilder()

Luciad.Models.Features.FeatureModelPersistenceManager.Builder Luciad.Models.Features.FeatureModelPersistenceManager.NewBuilder ( )
inlinestatic

Returns a new FeatureModelPersistenceManager builder.

a new FeatureModelPersistenceManager builder.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureModelPersistenceManager::newBuilder.

◆ SaveChanges()

Luciad.Models.Features.FeatureSaveErrorInfo Luciad.Models.Features.FeatureModelPersistenceManager.SaveChanges ( )
inline

Save the in-memory changes in the IFeatureModel's backend (for example a file or database).

Typically, calling this method shouldn't modify the in-memory state of the model. So the feature model will not send out events through its observers. In some cases however (depending on the model implementation), feature changes can occur while changes are saved. In that case, the model's observers need to be notified of those changes. std::nullopt on success, or error information on failure.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::FeatureModelPersistenceManager::saveChanges.

Property Documentation

◆ Changes

System.Collections.Generic.IList<Luciad.Models.Features.FeatureChange> Luciad.Models.Features.FeatureModelPersistenceManager.Changes
get