company logo

Property handle macros

Since open property handle is an activity frequently required in application programming, the are some macros provided for making life easier:

  • PH - Property handle constructor have the same name as the property name
  • PHN - Property handle constructor, where the property handle name may differ from the property name
  • GPH - GetPropertyHandle ()

The rules for creating handle copies and cursor copies are the same, i.e. passing a property handle pointer to the macro will create a handle copy and passing a property handle will create a cursor copy.

void OpenHandleHierarchy ( DBObjectHandle &dbo ) {

  PropertyHandle     person(dbo,"Person::Persons",PI_Read);

  PropertyHandle    *pchildren;

  // PropertyHandle  children(person,"children");

  PH(person,children);

  // PropertyHandle  grand_children(children,"children");

  PHN(person,children,grand_children);

  // pchildren = person.GetPropertyHandle("children");

  pchildren = person.GPH("children");

  

  ...

}