#include <bt.h>
Public Member Functions | |
BtManaged (BtHub *hubp) | |
virtual | ~BtManaged (void) |
BtHub * | GetHub (void) const |
DispatchInterface * | GetDi (void) const |
void * | GetPrivate (void) const |
Query the private pointer associated with the object. | |
void | SetPrivate (void *priv) |
Assign the private pointer associated with the object. | |
void | Get (void) |
Increment the reference count. | |
void | Put (void) |
Decrement the reference count. | |
Public Attributes | |
Callback< void, BtManaged * > | cb_NotifyDestroy |
Object destruction notification callback. |
This class forms the base class of all reference-counted objects used in this module. See also BtDevice life cycle management.
These objects have three standard features:
~BtManaged | ( | void | ) | [virtual] |
Standard destructor
DispatchInterface* GetDi | ( | void | ) | const [inline] |
Query the dispatcher interface of the presiding BtHub
void* GetPrivate | ( | void | ) | const [inline] |
Query the private pointer associated with the object.
All BtManaged derived objects have a single pointer field reserved for the use of clients. It is always initialized to zero when the object is constructed, and clients may assign it as they wish.
void SetPrivate | ( | void * | priv | ) | [inline] |
Assign the private pointer associated with the object.
All BtManaged derived objects have a single pointer field reserved for the use of clients. It is always initialized to zero when the object is constructed, and clients may assign it as they wish.
priv | New value to assign to the private pointer |
void Get | ( | void | ) | [inline] |
Increment the reference count.
As per managed objects, BtManaged derived objects are not deleted so long as they have a positive reference count.
void Put | ( | void | ) |
Decrement the reference count.
As per managed objects, when the object's reference count reaches zero, the object will be destroyed in the context of a timer event.
Callback<void, BtManaged*> cb_NotifyDestroy |
Object destruction notification callback.
This callback is invoked proir to deletion of the managed object, so that clients may release associated resources. This callback occurs in the context of a timer event, and complies with the rule of not invoking client callbacks in a nested fashion.
The decision to destroy the object is final. The client may not attempt to preserve the object by acquiring additional references from this callback.