Home · All Classes · Main Classes · Deprecated
Public Member Functions | Protected Member Functions | Protected Attributes

MAggregateDataAccess Class Reference

MAggregateDataAccess can be used to combine two or several objects implementing MDataAccess interface behind common MDataAccess interface. More...

Inherits MDataAccess.

List of all members.

Public Member Functions

 MAggregateDataAccess (MDataAccess &primaryAccess, MDataAccess &secondaryAccess)
virtual ~MAggregateDataAccess ()

Protected Member Functions

 MAggregateDataAccess (MAggregateDataAccessPrivate &dd)

Protected Attributes

MAggregateDataAccessPrivate *const d_ptr

Detailed Description

MAggregateDataAccess can be used to combine two or several objects implementing MDataAccess interface behind common MDataAccess interface.

Keys are primarily set and acquired from primary access. If the particular key is not defined in primary access then its set or acquired from the secondary access. MDataAccess interfaces can be chained so that MAggregateDataAccess is defined as the secondary MDataAccess in the constructor of this object.

 // MAggregateDataAccess with two MDataAccesses:
 MDataAccess& primaryAccess;
 MDataAccess& secondaryAccess;
 MAggregateDataAccess* aggregate = new MAggregateDataAccess(primaryAccess, secondaryAccess);

 // MAggregateDataAccess with three MDataAccesses:
 MDataAccess& primaryAccess;
 MDataAccess& secondaryAccess;
 MDataAccess& tertiaryAccess;
 MAggregateDataAccess* secondaryAggregate = new MAggregateDataAccess(secondaryAccess, tertiaryAccess);
 MAggregateDataAccess* aggregate = new MAggregateDataAccess(primaryAccess, *secondaryAggregate);

Ownership of the primary and secondary data access are maintained on the caller. Caller needs to make sure that primary and secondary data access objects exist whenever MAggregateDataAccess exists. For instance, MAggregateDataAccess object has to be destroyed before associated primary and secondary data access objects are destroyed.


Constructor & Destructor Documentation

MAggregateDataAccess::MAggregateDataAccess ( MDataAccess primaryAccess,
MDataAccess secondaryAccess 
)

Default constructor.

Parameters:
primaryAccess Primary MDataAccess object. Values are set and accessed from this data access primarily.
secondaryAccess Secondary MDataAccess object. Values are set and accessed from this data access only if values cannot be set or accessed from the primary access.
MAggregateDataAccess::~MAggregateDataAccess (  )  [virtual]

Destructor.

MAggregateDataAccess::MAggregateDataAccess ( MAggregateDataAccessPrivate &  dd  )  [protected]

Constructor for derived classes that allows injection of private implementation object of a derived class.


Member Data Documentation

MAggregateDataAccessPrivate* const MAggregateDataAccess::d_ptr [protected]

Pointer to private implementation object.


Copyright © 2010 Nokia Corporation
MeeGo Touch