BtSession Class Reference
[Bluetooth Hands-Free Profile Implementation]

Session object base class. More...

#include <bt.h>

Inheritance diagram for BtSession:

Inheritance graph
[legend]
Collaboration diagram for BtSession:

Collaboration graph
[legend]

List of all members.

Public Member Functions

BtDeviceGetDevice (void) const
 Query the BtDevice associated with the session.
BtServiceGetService (void) const
 Query the service associated with the session.
void Disconnect (bool voluntary=true)
 Request disconnection of the session.
BtHubGetHub (void) const
DispatchInterfaceGetDi (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.


Detailed Description

Session object base class.

Member Function Documentation

BtDevice* GetDevice ( void   )  const [inline]

Query the BtDevice associated with the session.

Returns:
A pointer to the BtDevice to which the session is attached.
Note:
The BtDevice returned does not have a reference added to it. Callers should take care to avoid dangling pointers.

BtService* GetService ( void   )  const [inline]

Query the service associated with the session.

Returns:
A pointer to the BtService object associated with the session. A BtService object is not very useful, as the real service object is derived from BtServce, and added functionality is not exposed through BtService.

Reimplemented in RfcommSession, and HfpSession.

void Disconnect ( bool  voluntary = true  )  [inline]

Request disconnection of the session.

This abstract interface allows one to request any connection-oriented session object derived from BtSession to disconnect itself.

Parameters:
voluntary Whether the disconnection should be presented as voluntary and explicit, i.e. selecting disconnect on a list, or involuntary, i.e. exiting Bluetooth radio range.

BtHub* GetHub ( void   )  const [inline, inherited]

Query the presiding BtHub

DispatchInterface* GetDi ( void   )  const [inline, inherited]

Query the dispatcher interface of the presiding BtHub

void* GetPrivate ( void   )  const [inline, inherited]

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.

Returns:
The current value of the private pointer

void SetPrivate ( void *  priv  )  [inline, inherited]

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.

Parameters:
priv New value to assign to the private pointer

void Get ( void   )  [inline, inherited]

Increment the reference count.

As per managed objects, BtManaged derived objects are not deleted so long as they have a positive reference count.

See also:
Put()

void Put ( void   )  [inherited]

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.

See also:
Get()


Member Data Documentation

Callback<void, BtManaged*> cb_NotifyDestroy [inherited]

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.


The documentation for this class was generated from the following files:
Generated on Fri Jan 9 05:58:38 2009 for libhfp by  doxygen 1.5.4