diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-B756AB28-A0EA-5AA3-86E3-CCFFCD642F08.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-B756AB28-A0EA-5AA3-86E3-CCFFCD642F08.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,30 @@ + + + + + +What are linksThis topic describes the structure of links. A link is a container and an element. A link is an item that can be stored in the Comms Database.

A link is a container. A link refers to another record. A link can be included in a record.

A link is represented by the templated class CMDBRecordLink<T>. The template parameter defines the type of record to which the link refers.

A link is a public data member of a class. The class defines the structure of record. This record is the 'parent' record of the linked record. For example, Symbian OS defines the class CCDIAPRecord that represents an Internet Access Point (IAP) record. A set of IAP records form an IAP table. The public data members of this class are the fields and links that make the record. The following code shows part of the class definition. Some parts are omitted - this is not the complete class definition.

class CCDIAPRecord : public CCDRecordBase + { + public: + CMDBField<TDesC> iServiceType; + CMDBRecordLink<CCDServiceRecordBase> iService; + CMDBField<TDesC> iBearerType; + CMDBRecordLink<CCDBearerRecordBase> iBearer; + CMDBRecordLink<CCDNetworkRecord> iNetwork; + CMDBField<TUint32> iNetworkWeighting; + CMDBRecordLink<CCDLocationRecord> iLocation; + ... + } +

A CMDBRecordLink<T> object contains an integer. The integer is the element Id of the linked record in the database.

If you have a parent record in memory, you call the LoadL() function on the link object CMDBRecordLink<T> to get the linked record into memory. You can access the linked record through the iLinkedRecord pointer. This pointer is a member of the CMDBRecordLinkBase class, but you can access this data member through the CMDBRecordLink<T> object.

There are two cases:

Following + a link to another table and finding a field by Id and by name: Tutorial
\ No newline at end of file