Test whether an object is already deleted.
The operator obj_def checks whether the object still exists in the HORUS data bank (i.e. whether the surrogate is still valid). This check especially makes sense before deleting an object if it cannot be excluded that the object has already been deleted by a prior deleting operator (clear).
The operator obj_def can return TRUE even if the object was already deleted because the surrogates of deleted objects are re-used for new objects. In this connection see the example.
Object (input_object) |
object -> object |
Object to be checked. |
ERR_TYPE err; circle(&Circle,100.0,100.0,100.0); err = obj_def(Circle); printf("Result for obj_def (MESS_TRUE): %d\",err); clear(Circle); err = obj_def(Circle); printf("Result for obj_def (MESS_FALSE): %d\",err); rectangle1(&Rectangle,200.0,200.0,300.0,300.0); err = obj_def(Circle); printf("Result for obj_def (MESS_TRUE!!!): %d\",err);
The runtime complexity is O(1).
The operator obj_def returns the value TRUE if an object with this surrogate is present in the HORUS data bank, otherwise the value FALSE is returned. The behavior in case of empty input (no input objects available) is set via the operator set_system(::'no_object_result',<Result>:).
bool