Telepathy::Client::OptionalInterfaceFactory< DBusProxySubclass > Class Template Reference
[Client-side proxies]

#include <TelepathyQt4/Client/OptionalInterfaceFactory>

Inheritance diagram for Telepathy::Client::OptionalInterfaceFactory< DBusProxySubclass >:

Inheritance graph
[legend]
Collaboration diagram for Telepathy::Client::OptionalInterfaceFactory< DBusProxySubclass >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 OptionalInterfaceFactory (DBusProxySubclass *this_)
 ~OptionalInterfaceFactory ()
template<typename Interface >
Interface * interface () const


Detailed Description

template<typename DBusProxySubclass>
class Telepathy::Client::OptionalInterfaceFactory< DBusProxySubclass >

Implementation helper class for high-level proxy classes willing to offer access to shared instances of interface proxies for optional interfaces.

This class is included in the public API for the benefit of high-level proxies in extensions.

To use this helper in a subclass of DBusProxy (say, ExampleObject), ExampleObject should inherit privately from OptionalInterfaceFactory<ExampleObject>, and call OptionalInterfaceFactory(this) in its constructor's initialization list.

Template Parameters:
DBusProxySubclass A subclass of DBusProxy

Constructor & Destructor Documentation

template<typename DBusProxySubclass>
Telepathy::Client::OptionalInterfaceFactory< DBusProxySubclass >::OptionalInterfaceFactory ( DBusProxySubclass *  this_  )  [inline]

Class constructor.

Parameters:
this_ The class to which this OptionalInterfaceFactory is attached

template<typename DBusProxySubclass>
Telepathy::Client::OptionalInterfaceFactory< DBusProxySubclass >::~OptionalInterfaceFactory (  )  [inline]

Class destructor.

Frees all interface instances constructed by this factory.


Member Function Documentation

template<typename DBusProxySubclass>
template<typename Interface >
Interface* Telepathy::Client::OptionalInterfaceFactory< DBusProxySubclass >::interface (  )  const [inline]

Return a pointer to a valid instance of a interface class, associated with the same remote object as the given main interface instance. The given main interface must be of the class the optional interface is generated for (for eg. ChannelInterfaceGroupInterface this means ChannelInterface) or a subclass.

First invocation of this method for a particular optional interface class will construct the instance; subsequent calls will return a pointer to the same instance.

The returned instance is freed when the factory is destroyed; using it after destroying the factory will likely produce a crash. As the instance is shared, it should not be freed directly.

Template Parameters:
Interface Class of the interface instance to get.
Returns:
A pointer to an optional interface instance.

Referenced by Telepathy::Client::OptionalInterfaceFactory< Channel >::interface().


Generated on Thu Mar 5 18:52:08 2009 for TelepathyQt4-0.1.1 by  doxygen 1.5.8