Difference between revisions of "DUM Handles"

From reSIProcate
Jump to navigation Jump to search
Line 2: Line 2:
  
 
Handles point to objects which subclass Handled, and include things like Subscriptions, InviteSessions, etc.
 
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.

Revision as of 18:00, 15 June 2005

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.