CTypedNode Class Reference

class CTypedNode : public CNode

Template class for a node in a node tree.

The node type is set to the template parameter TNodeType and the attribute type to TAttributeType. These parameters should be pointers to the type required to store the type value: e.g. for a string, a const TDesC*.

The class is thin template over CNode.

Inherits from

Public Member Functions
voidAddAttributeL(TAttributeType, CBase *)
voidAddDataAndAttributeL(HBufC16 *, TAttributeType, CBase *)
CTypedNode< TNodeType, TAttributeType > &AppendNodeL(TNodeType)
voidAppendNodeToThisNodeL(CNode *)
CBase *Attribute(TAttributeType)
CBase *AttributeByIndex(TInt)
CBase *AttributeByIndex(TInt, TAttributeType &)
TInt AttributeCount()
TBool AttributeExists(TAttributeType)
TAttributeTypeAttributeTypeByIndex(TInt)
CTypedNode *Child(TInt)
voidClearSetDataNoDeleteL()
HBufC16 *Data()
voidDeleteAllAttributes()
voidDeleteAllChildNodes()
voidDeleteAttribute(TAttributeType)
voidDeleteChildNode(CNode *)
CTypedNode *NewL(TNodeType, CNode *)
CTypedNode *NextChild(const CNode *)
CTypedNode *NextSibling()
TInt NumberImmediateChildren()
CTypedNode *Parent()
CTypedNode *PrevChild(const CNode &)
CTypedNode *PrevSibling()
voidRemoveAttributeNoDelete(TAttributeType)
voidReparentL(CNode *)
voidResetDataPointer(HBufC16 *)
const CTypedNode &Root()
voidSetDataL(HBufC16 *)
voidSetDataNoDeleteL()
voidSetFileDataL(HBufC16 *)
voidSetType(TNodeType)
TNodeTypeType()
Protected Member Functions
CTypedNode(TNodeType, CNode *)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CNode::AddAttributeL(TAny *,CBase *)
CNode::AddDataAndAttributeL(HBufC16 *,TAny *,CBase *)
CNode::AdjustBasePointers()
CNode::AppendNodeL(TAny *)
CNode::Attribute(TAny *)const
CNode::AttributeByIndex(TInt,TAny *&)const
CNode::AttributeExists(TAny *)const
CNode::CNode(TAny *,CNode *)
CNode::DeleteAttribute(TAny *)
CNode::FindChild(const CNode *)const
CNode::NewL(TAny *,CNode *)
CNode::RemoveAttributeNoDelete(TAny *)
CNode::SetType(TAny *)
CNode::SetupDeletableOrNonDeleteableDataLC()
CNode::~CNode()
Inherited Attributes
CNode::iChildList
CNode::iDataValue
CNode::iParent
CNode::iType
CNode::iTypes
CNode::iTypesBasePtr
CNode::iValues

Constructor & Destructor Documentation

CTypedNode(TNodeType, CNode *)

CTypedNode(TNodeTypeaType,
CNode *aParent
)[protected, inline]

Parameters

TNodeType aType
CNode * aParent

Member Functions Documentation

AddAttributeL(TAttributeType, CBase *)

voidAddAttributeL(TAttributeTypeaAttributeType,
CBase *aAttributeValue
)[inline]

Adds an attribute.

The node takes ownership of aAttributeValue.

Parameters

TAttributeType aAttributeTypeAttribute type
CBase * aAttributeValueAttribute value

AddDataAndAttributeL(HBufC16 *, TAttributeType, CBase *)

voidAddDataAndAttributeL(HBufC16 *aData,
TAttributeTypeaAttributeType,
CBase *aAttributeValue
)[inline]

Sets node data and adds an attribute.

The node takes ownership of aDataand aAttributeValue. Existing node data owned by the node is deleted.

Parameters

HBufC16 * aDataNode data
TAttributeType aAttributeTypeAttribute type
CBase * aAttributeValueAttribute value

AppendNodeL(TNodeType)

CTypedNode< TNodeType, TAttributeType > &AppendNodeL(TNodeTypeaType)[inline]

Creates a new child node.

Parameters

TNodeType aTypeNode type

AppendNodeToThisNodeL(CNode *)

voidAppendNodeToThisNodeL(CNode *aNode)[inline]

Adds an existing node as a child.

Parameters

CNode * aNodeNode to make a child

Attribute(TAttributeType)

CBase *Attribute(TAttributeTypeaAttributeType)const [inline]

Gets an attribute value for a specified attribute type.

Parameters

TAttributeType aAttributeTypeAttribute type

AttributeByIndex(TInt)

CBase *AttributeByIndex(TIntaIndex)const [inline]

Gets the attribute value of an attribute at a specified index

Parameters

TInt aIndexAttribute index

AttributeByIndex(TInt, TAttributeType &)

CBase *AttributeByIndex(TIntaIndex,
TAttributeType &aType
)const [inline]

Gets the attribute value and type of an attribute at a specified index..

Parameters

TInt aIndexAttribute index
TAttributeType & aTypeOn return, the attribute type

AttributeCount()

TInt AttributeCount()const [inline]

Gets the number of attributes of this node.

AttributeExists(TAttributeType)

TBool AttributeExists(TAttributeTypeaAttributeType)const [inline]

Tests if an attribute of a specified type exists.

Parameters

TAttributeType aAttributeTypeAttribute type

AttributeTypeByIndex(TInt)

TAttributeTypeAttributeTypeByIndex(TIntaIndex)const [inline]

Gets the attribute value of an attribute at a specified index

Parameters

TInt aIndexAttribute index

Child(TInt)

CTypedNode *Child(TIntaByIndex)const [inline]

Gets a child node by index.

Parameters

TInt aByIndexIndex of the child node

ClearSetDataNoDeleteL()

voidClearSetDataNoDeleteL()[inline]

Sets the object to delete the node data in its destructor.

Note that the function internally reallocates memory. If it leaves, the data is lost.

Data()

HBufC16 *Data()const [inline]

Gets the node data.

DeleteAllAttributes()

voidDeleteAllAttributes()[inline]

Delete all node attributes.

Note that attribute values will be deleted.

DeleteAllChildNodes()

voidDeleteAllChildNodes()[inline]

Deletes all the child nodes of this node.

DeleteAttribute(TAttributeType)

voidDeleteAttribute(TAttributeTypeaAttributeType)[inline]

Deletes an attribute of a specified type.

Note that the attribute value will be deleted.

Parameters

TAttributeType aAttributeTypeAttribute type

DeleteChildNode(CNode *)

voidDeleteChildNode(CNode *aNode)[inline]

Deletes a specified child node.

Parameters

CNode * aNodeNode to delete

NewL(TNodeType, CNode *)

CTypedNode *NewL(TNodeTypeaType,
CNode *aParent
)[static, inline]

Allocates and constructs a new node.

Parameters

TNodeType aTypeThe type of the node
CNode * aParentThe parent of this node

NextChild(const CNode *)

CTypedNode *NextChild(const CNode *aNode = NULL)const [inline]

Gets the first child or the next child after a specified child.

Parameters

const CNode * aNode = NULLChild node or NULL to get the first child

NextSibling()

CTypedNode *NextSibling()const [inline]

Gets the next sibling node.

This asks for the next child of its parent.

NumberImmediateChildren()

TInt NumberImmediateChildren()const [inline]

Gets the number of children of this node.

Parent()

CTypedNode *Parent()const [inline]

Gets the parent of this node.

PrevChild(const CNode &)

CTypedNode *PrevChild(const CNode &aNode)const [inline]

Gets the previous child before a specified child.

Parameters

const CNode & aNodeChild node

PrevSibling()

CTypedNode *PrevSibling()const [inline]

Gets the previous sibling node.

This asks for the previous child of its parent.

RemoveAttributeNoDelete(TAttributeType)

voidRemoveAttributeNoDelete(TAttributeTypeaAttributeType)[inline]

Removes an attribute of a specified type, but does not delete it.

The caller is now responsible for the destruction of the attribute value.

Parameters

TAttributeType aAttributeTypeAttribute type

ReparentL(CNode *)

voidReparentL(CNode *aParent)[inline]

Changes the parent of the node.

The node is removed from the childlist of its current parent.

Parameters

CNode * aParentNew parent

ResetDataPointer(HBufC16 *)

voidResetDataPointer(HBufC16 *aData)[inline]

Resets the node data to a specified pointer.

Existing data owned by the node is deleted.

Parameters

HBufC16 * aDataRoot node

Root()

const CTypedNode &Root()const [inline]

Gets the absolute root node of the tree.

SetDataL(HBufC16 *)

voidSetDataL(HBufC16 *aDataNowNodeOwns)[inline]

Sets the node data.

The object will delete the data in its destructor.

Parameters

HBufC16 * aDataNowNodeOwnsNode data

SetDataNoDeleteL()

voidSetDataNoDeleteL()[inline]

Sets the object not to delete the node data in its destructor.

Note that the function internally reallocates memory. If it leaves, the data is lost.

SetFileDataL(HBufC16 *)

voidSetFileDataL(HBufC16 *aFileDataLocationNowNodeOwns)[inline]

Sets the node data to be taken from a specified file.

If the data is deleted, the referenced file is also deleted.

Parameters

HBufC16 * aFileDataLocationNowNodeOwnsName of the file containing the data

SetType(TNodeType)

voidSetType(TNodeTypeaType)[inline]

Sets the node type.

Parameters

TNodeType aTypeNode type

Type()

TNodeTypeType()const [inline]

Gets the node type.