LuciadCPillar 2023.1.04
luciad::FeatureModelUpdate::Builder Class Referencefinal

Builder that allows FeatureModelUpdate instances to be created. More...

#include <luciad/models/features/IFeatureModelUpdater.h>

Public Member Functions

 Builder (Builder &&other) noexcept
 
 Builder (const Builder &other)
 
 ~Builder ()
 
BuilderaddFeature (Feature newFeature)
 Adds the given Feature to the model. More...
 
std::shared_ptr< FeatureModelUpdatebuild ()
 Build the FeatureModelUpdate instance. More...
 
Builderoperator= (Builder other) noexcept
 
BuilderremoveFeature (FeatureId featureId)
 Removes the feature with the given id from the model. More...
 
BuilderupdateFeature (Feature newFeature)
 This method is called to replace the Feature with the same id. More...
 
BuilderupdaterCallback (std::shared_ptr< IFeatureUpdaterCallback > updaterCallback)
 Sets the callback that must be called by IFeatureModelUpdater::update to inform that this update was successful or not, or to notify that features were added. More...
 

Detailed Description

Builder that allows FeatureModelUpdate instances to be created.

Since
2020.1

Constructor & Destructor Documentation

◆ Builder() [1/2]

luciad::FeatureModelUpdate::Builder::Builder ( const Builder other)

◆ Builder() [2/2]

luciad::FeatureModelUpdate::Builder::Builder ( Builder &&  other)
noexcept

◆ ~Builder()

luciad::FeatureModelUpdate::Builder::~Builder ( )

Member Function Documentation

◆ addFeature()

Builder & luciad::FeatureModelUpdate::Builder::addFeature ( Feature  newFeature)

Adds the given Feature to the model.

This Feature may not have an id yet. In that case, IFeatureModelUpdater::update is responsible for assigning an id to the feature when adding it to the model. In general, callers of this method can not assign id's to Features.

There are a few exceptions though. Passing an id with Feature can for example be useful for in-memory models like FeatureModelBuilder, where the caller may want to assign id's to features. If a Feature with an id is passed to this method, the id must be unique.

When adding the feature is finished, the given callback should be called with the newly added Feature (with id). When the Feature could not be added, the callback should be called as well to notify this.

Parameters
newFeaturethe new Feature
Returns
this builder

◆ build()

std::shared_ptr< FeatureModelUpdate > luciad::FeatureModelUpdate::Builder::build ( )

Build the FeatureModelUpdate instance.

Returns
the feature model update.
Exceptions
luciad::LogicExceptionIf no changes were configured.

◆ operator=()

Builder & luciad::FeatureModelUpdate::Builder::operator= ( Builder  other)
noexcept

◆ removeFeature()

Builder & luciad::FeatureModelUpdate::Builder::removeFeature ( FeatureId  featureId)

Removes the feature with the given id from the model.

Parameters
featureIda feature id
Returns
this builder

◆ updateFeature()

Builder & luciad::FeatureModelUpdate::Builder::updateFeature ( Feature  newFeature)

This method is called to replace the Feature with the same id.

Parameters
newFeaturethe new Feature
Returns
this builder

◆ updaterCallback()

Builder & luciad::FeatureModelUpdate::Builder::updaterCallback ( std::shared_ptr< IFeatureUpdaterCallback updaterCallback)

Sets the callback that must be called by IFeatureModelUpdater::update to inform that this update was successful or not, or to notify that features were added.

This method is optional.

Parameters
updaterCallbackthe updater callback
Returns
this builder