DUM Handles

From reSIProcate
Revision as of 18:00, 15 June 2005 by Ronh (talk | contribs)
Jump to navigation Jump to search

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.

Handles point to objects which subclass Handled, and include things like Subscriptions, InviteSessions, etc.

Once created, a Handle will continue to exist even if the Handled object it refers to is deleted.