+/// Generic method to register back reference, used in referencing attributes.
+/// Without concealment change, it will be done later, on synchronization.
+#define ADD_BACK_REF(TARGET) \
+ if (TARGET.get() != NULL) { \
+ std::shared_ptr<Model_Data> aTargetData = \
+ std::dynamic_pointer_cast<Model_Data>((TARGET)->data()); \
+ FeaturePtr anAttributeOwnerFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner()); \
+ if (anAttributeOwnerFeature.get()) \
+ aTargetData->addBackReference(anAttributeOwnerFeature, id(), false); \
+ else { \
+ FolderPtr anAttributeOwnerFolder = std::dynamic_pointer_cast<ModelAPI_Folder>(owner()); \
+ if (anAttributeOwnerFolder.get()) \
+ aTargetData->addBackReference(ObjectPtr(anAttributeOwnerFolder), id()); \
+ } \
+ }
+
+/// Generic method to unregister back reference, used in referencing attributes.
+/// Without concealment change, it will be done later, on synchronization.
+#define REMOVE_BACK_REF(TARGET) \
+ if (TARGET.get() != NULL) { \
+ std::shared_ptr<Model_Data> aTargetData = \
+ std::dynamic_pointer_cast<Model_Data>((TARGET)->data()); \
+ FeaturePtr anAttOwnerFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner()); \
+ if (anAttOwnerFeature.get()) \
+ aTargetData->removeBackReference(anAttOwnerFeature, id()); \
+ else { \
+ FolderPtr anAttributeOwnerFolder = std::dynamic_pointer_cast<ModelAPI_Folder>(owner()); \
+ if (anAttributeOwnerFolder.get()) \
+ aTargetData->removeBackReference(ObjectPtr(anAttributeOwnerFolder), id()); \
+ } \
+ }
+