MTimeoutManager Class Reference

class MTimeoutManager : public MInetBase

Implementation of "delta queue" timeout manager.

The timeout manager provides a timeout callback service for any object. An object using the timeout service only needs to have member variable of RTimeout and define the timeout linkage ( TimeoutLinkage ) for redirecting the timeout callback to a real function of some object.

The same time manager can be used for different object classes. A component can use single timeout manager instance for all of its objects:

  1. Create timeout manager using TimeoutFactory::NewL

  2. Objects, which need the timeout callback, declare the RTimeout member variable and the appropriate linkage ( TimeoutLinkage ).

  3. The timeout callback for a object is requested either by RTimeout::Set or MTimeoutManager::Set . The set implicitly cancels previous timeout, if active.

  4. RTimeout::Cancel cancels pending timeout, if any is active.

Destructions:
  1. When an object with RTimeout member(s) is destroyed, the destructor of this object should include a RTimeout::Cancel() for the member variable(s).

  2. The timeout manager must be deleted, as any normal allocated object. All pending timeouts are silently cancelled (no expire call will happen for them).

The timeout manager maintains an ordered queue of pending timeouts. The next object to expire is always the first in the list, and the timeout manager sets up an internal timer event ( RTimer::After ) to happen based on the first object.

To create an instance of a timeout manager, use TimeoutFactory::NewL .

Inherits from

Constructor & Destructor Documentation

~MTimeoutManager()

~MTimeoutManager ( ) [inline, virtual]

Destructor.

Even though this is a "mixin" class, the entity that creates it through the TimeoutFactory::NewL() is expected to delete this manager using the returned pointer.

Member Functions Documentation

Set(RTimeout &, TUint)

void Set ( RTimeout & aLink,
TUint aTime
) [pure virtual]

Activate timeout callback after the specified time.

Set a timeout for an object (any previous timeout setting for this object is silently removed, no Expired callback will occur for that). The timeout (aTime) value interpretation is dependent on the aUnit parameter specified for the manager, when it was created (see TimeoutFactory::NewL ).

Parameters

RTimeout & aLink the timeout handle within the object
TUint aTime the time (in fraction of second units).