company logo

Property :: markUsed - Mark property handle as used

When referencing a property handle recursively (e.g. via transient property handles), this may result in never deleting the resources allocated with the property handle.

Recursive references to property handles may happen when setting transient references (setTransientProperty()) for a property in an upper property handle. In this case the program has to mark the property handle explicitly as unused. Property handles marked as unused must be marked as used before being closed or replaced (use()).

Using this function improperly (e.g. after constructing a property handle) may release the resources allocated to the property handle immediately.

A property handle that have been marked as unused should be marked as used before being closed or replaced in a transient reference.

The function throws an exception, when the property handle is not valid.

// fragment: Property   person;

  Property    tPerson(person,"tperson"); // refers to transient property

  tPerson.markUsed(true);                // increas use count  

  tPerson.resetTransientProperty();      // remove ptoprty from transient reference

// fragment: Property   person;

  Property    tPerson(person,"tperson"); // refers to transient property

  tPerson.setTransientProperty(person);  // person referenced recursively

  tPerson.MarkUsed(false);               // reduce use count

Implementation details

Property  :: markUsed ( bool bEnable )
  • bEnable - Enable resource

    In order to enable the referenced resource true should be passed. Passing false will disable the resource.