LuciadCPillar 2023.1.04
|
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 () | |
Builder & | addFeature (Feature newFeature) |
Adds the given Feature to the model. More... | |
std::shared_ptr< FeatureModelUpdate > | build () |
Build the FeatureModelUpdate instance. More... | |
Builder & | operator= (Builder other) noexcept |
Builder & | removeFeature (FeatureId featureId) |
Removes the feature with the given id from the model. More... | |
Builder & | updateFeature (Feature newFeature) |
This method is called to replace the Feature with the same id. More... | |
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. More... | |
Builder that allows FeatureModelUpdate instances to be created.
luciad::FeatureModelUpdate::Builder::Builder | ( | const Builder & | other | ) |
|
noexcept |
luciad::FeatureModelUpdate::Builder::~Builder | ( | ) |
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
.
newFeature | the new Feature |
std::shared_ptr< FeatureModelUpdate > luciad::FeatureModelUpdate::Builder::build | ( | ) |
Build the FeatureModelUpdate instance.
luciad::LogicException | If no changes were configured. |
Removes the feature with the given id from the model.
featureId | a feature id |
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.
updaterCallback | the updater callback |