DUM Handles

From reSIProcate
Revision as of 17:12, 15 June 2005 by Ronh (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  • Handles

Usages and Handlers must not be exposed to the application, since they might get deleted by the time the application tries to use them. Instead, the application gets a Handle to a Usage or Handler. The Handle keeps track of the referenced object, and will throw a HandleException if the application attempts to access an object that has been deleted. Handle:isValid() will return true if the Handled object exists, or false otherwise. Handle::get() will return the Handled object if it still exists or throw a HandleException if it does not. A Handle is essentially a smart pointer.