diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-6DAF85AD-E412-5823-81C2-FC1755A90A84.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-6DAF85AD-E412-5823-81C2-FC1755A90A84.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,90 @@ + + + + + +What +are elementsThis topic describes elements. All items that can be stored in +the Comms Database are elements. The topic also discusses the structure of +the unique numeric Id and the attributes that control access to elements. +

An element is represented by the CMDBElement class. +The class is a base class for all items that can be stored in the Comms Database. +The class contains the data that is common to all items that can be stored +in the Comms database.

+

Elements contain three pieces of information:

+ +

CMDBElement derives from MMetaDatabase. MMetaDatabase provides +the behaviour that allows an element to operate with the Comms Database. [See +accessing the database or words to that effect.]

+ + + +
The Element +Id

The iElementId data member of CMDBElement is +a 32 bit number that contains:

    +
  • the unique numeric Id +that shows the location of the element in the database. This numeric Id is +known as the Element Id.

  • +
  • the set of attributes +that controls access to the data. The bits define the access levels.

  • +

Both pieces of information are encoded in the 32 bit number. The +32 bit number is a TMDBElementId type.

The CMDBElement class provides member functions to +access and to change the information in the Element Id.

+

The unique +numeric Id

The unique numeric Id has two parts: the Type Id and +the Record Id.

The Type Id defines the type of element; the Record +Id identifies an instance of this type of element.

The class CMDBElement provides the member functions CommsDat::CMDBElement::TypeId() and CommsDat::CMDBElement::RecordId() to +extract this information.

Internally, the Type Id includes a 8 bit +number and a 7 bit number. The 8 bit number is the Table Id and the 7 bit +number is the Column Id. The Type Id and the Record Id are in defined locations +in the 32 bit number iElementId.

+ +

The header file comsdat.h contains the constants +that define the location of these Ids in the 32 bit number:

+ + + +

Table Id

+

KCDMaskShowRecordType

+
+ +

Column Id

+

KCDMaskShowFieldType

+
+ +

Type Id

+

KCDMaskShowType

+
+ +

Record Id

+

KCDMaskShowRecordId

+
+ + +
+

The set of +attributes that controls access to the data

The access levels of +an element are defined by the bits in the element. The TCDAttributeFlags enum +defines the access levels of an element. These bits are stored in the fourth +byte of the iElementId member of CMDBElement.

+ +

KCDMaskShowAttributes in the header file comsdat.h defines +the location of these access control bits in the 32 bit number.

+
\ No newline at end of file