LuciadCPillar 2024.0.08
|
Represents a change for a feature. More...
#include <luciad/models/features/IFeatureModel.h>
Public Member Functions | |
FeatureChange (Feature feature, FeatureChangeType featureChangeType) | |
Constructs the feature change based on a feature instance and the type of change for the feature. More... | |
FeatureChange (FeatureId featureId, FeatureChangeType featureChangeType) | |
Constructs the feature change based on the id of the feature and the type of change for the feature. More... | |
std::optional< Feature > | getFeature () const |
Returns the changed feature, or std::nullopt . More... | |
FeatureChangeType | getFeatureChangeType () const |
Returns the type of change. More... | |
FeatureId | getFeatureId () const |
Returns the id of the changed feature. More... | |
bool | operator!= (const FeatureChange &fc) const |
bool | operator== (const FeatureChange &fc) const |
Represents a change for a feature.
It indicates for a given feature, identified by its luciad::FeatureId, whether it has been added, updated, etc. It can optionally contain the actual feature instance rather than only the id of the feature. The benefit of the latter is that it may avoid performing queries on the luciad::IFeatureModel.
|
inline |
Constructs the feature change based on the id of the feature and the type of change for the feature.
featureId | the id of the feature. |
featureChangeType | the type of change. |
|
inline |
Constructs the feature change based on a feature instance and the type of change for the feature.
feature | the feature. |
featureChangeType | the type of change. |
|
inline |
Returns the changed feature, or std::nullopt
.
If no value is available, the model can be queried
to retrieve it. In case of a FeatureChangeType::Remove
change type, this method will always return std::nullopt
.
std::nullopt
.
|
inline |
Returns the type of change.
|
inline |
Returns the id of the changed feature.
When this class is used as part of FeatureModelUpdate, the feature id will not always be available. This method will throw an exception in that case. Use FeatureChange::getFeature
in that case. See FeatureModelUpdate::Builder::addFeature
for more information.
In all other cases, this method will not thrown an exception.
nullptr
for Update and Remove changes. Not necessarily for Add. LogicException | when the feature has no id. |
|
inline |
|
inline |