test_obj_def ( Object : : : )

Test whether an object is already deleted.

The operator test_obj_def checks whether the object still exists in the HALCON operator data base (i.e. whether the surrogate is still valid). This check especially makes sense before deleting an object if it is not sure that the object has already been deleted by a prior deleting operator (clear_obj).


Attention

The operator test_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 context see the example.


Parameters

Object (input_object)
object -> object
Object to be checked.


Example (Syntax: C)
Herror err;
circle(&Circle,100.0,100.0,100.0);
err = test_obj_def(Circle);
printf("Result for test_obj_def (H_MSG_TRUE): %d\n",err);
clear_obj(Circle);
err = test_obj_def(Circle);
printf("Result for test_obj_def (H_MSG_FALSE): %d\n",err);
gen_rectangle1(&Rectangle,200.0,200.0,300.0,300.0);
err = test_obj_def(Circle);
printf("Result for test_obj_def (H_MSG_TRUE!!!): %d\n",err);

Complexity

The runtime complexity is O(1).


Result

The operator test_obj_def returns the value 2 (H_MSG_TRUE) if an object with this surrogate is present in the HALCON operator data base, otherwise the value 3 (H_MSG_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>:).


Parallelization Information

test_obj_def is reentrant and processed without parallelization.


Possible Predecessors

clear_obj, gen_circle, gen_rectangle1


See also

set_check, clear_obj, reset_obj_db


Return Value

bool


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH