Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <mmfcontroller.h>
Link against: mmfcontrollerframework.lib

Class CMMFObjectContainer

class CMMFObjectContainer : public CBase;

Description

Container class to hold the CMMFObject-derived objects in the controller framework.

Derivation

Members

Defined in CMMFObjectContainer:

Inherited from CBase:


Construction and destruction


CMMFObjectContainer()

IMPORT_C CMMFObjectContainer();

Description

Constructor.


~CMMFObjectContainer()

IMPORT_C ~CMMFObjectContainer();

Description

Destructor.

Deletes all objects owned by the container.

[Top]


Member functions


AddMMFObject(CMMFObject &)

IMPORT_C TInt AddMMFObject(CMMFObject &aObject);

Description

Add an object to the container.

Once the object has been added, its ownership is transferred to the container.

Parameters

CMMFObject &aObject

A reference to the object to be added to the container.

Return value

TInt

An error code indicating if the function call was successful. If the return code is not KErrNone, then ownership of the object still remains with the caller.


RemoveAndDestroyMMFObject(CMMFObject &)

IMPORT_C void RemoveAndDestroyMMFObject(CMMFObject &aObject);

Description

Removes and destroys an object from the container.

This method ensures that the object is no longer in the container, and that it gets deleted. Even if the object is not found in the container's array of objects, it will be deleted.

Parameters

CMMFObject &aObject

A reference to the object to be deleted.


FindMMFObject(const TMMFMessageDestination &,CMMFObject *&)

IMPORT_C TInt FindMMFObject(const TMMFMessageDestination &aObjectHandle, CMMFObject *&aObjectFound);

Description

Finds an object in the container using a handle.

Parameters

const TMMFMessageDestination &aObjectHandle

The handle of the object to be located.

CMMFObject *&aObjectFound

A reference to a pointer to the object found in the container.

Return value

TInt

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.


DeleteAllObjects()

IMPORT_C void DeleteAllObjects();

Description

Removes and destroys all objects from the container.