CTypedNode Class Reference

#include <mw/cnode.h>

class CTypedNode : public 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 Attributes
CNode::iChildList
CNode::iDataValue
CNode::iParent
CNode::iType
CNode::iTypes
CNode::iTypesBasePtr
CNode::iValues
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()

Detailed Description

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.

Constructor & Destructor Documentation

CTypedNode ( TNodeType, CNode * )

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

Member Function Documentation

AddAttributeL ( TAttributeType, CBase * )

voidAddAttributeL(TAttributeTypeaAttributeType,
CBase *aAttributeValue
)[inline]

Adds an attribute.

The node takes ownership of aAttributeValue.

Parameters
aAttributeTypeAttribute type
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
aDataNode data
aAttributeTypeAttribute type
aAttributeValueAttribute value

AppendNodeL ( TNodeType )

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

Creates a new child node.

Parameters
aTypeNode type
Return Value
The new child node

AppendNodeToThisNodeL ( CNode * )

voidAppendNodeToThisNodeL(CNode *aNode)[inline]

Adds an existing node as a child.

Parameters
aNodeNode to make a child

Attribute ( TAttributeType )

CBase *Attribute(TAttributeTypeaAttributeType)const [inline]

Gets an attribute value for a specified attribute type.

Parameters
aAttributeTypeAttribute type
Return Value
Attribute value

AttributeByIndex ( TInt )

CBase *AttributeByIndex(TIntaIndex)const [inline]

Gets the attribute value of an attribute at a specified index

Parameters
aIndexAttribute index
Return Value
Attribute value

AttributeByIndex ( TInt, TAttributeType & )

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

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

Parameters
aIndexAttribute index
aTypeOn return, the attribute type
Return Value
Attribute value

AttributeCount ( )

TInt AttributeCount()const [inline]

Reimplemented from CNode::AttributeCount()const

Gets the number of attributes of this node.

Return Value
Number of attributes of this node

AttributeExists ( TAttributeType )

TBool AttributeExists(TAttributeTypeaAttributeType)const [inline]

Tests if an attribute of a specified type exists.

Parameters
aAttributeTypeAttribute type
Return Value
True if the attribute exists, otherwise false

AttributeTypeByIndex ( TInt )

TAttributeTypeAttributeTypeByIndex(TIntaIndex)const [inline]

Gets the attribute value of an attribute at a specified index

Parameters
aIndexAttribute index
Return Value
Attribute value

Child ( TInt )

CTypedNode *Child(TIntaByIndex)const [inline]

Reimplemented from CNode::Child(TInt)const

Gets a child node by index.

Parameters
aByIndexIndex of the child node
Return Value
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]

Reimplemented from CNode::Data()const

Gets the node data.

Return Value
Node data or NULL if no data is set

DeleteAllAttributes ( )

voidDeleteAllAttributes()[inline]

Reimplemented from CNode::DeleteAllAttributes()

Delete all node attributes.

Note that attribute values will be deleted.

DeleteAllChildNodes ( )

voidDeleteAllChildNodes()[inline]

Reimplemented from CNode::DeleteAllChildNodes()

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
aAttributeTypeAttribute type

DeleteChildNode ( CNode * )

voidDeleteChildNode(CNode *aNode)[inline]

Deletes a specified child node.

Parameters
aNodeNode to delete

NewL ( TNodeType, CNode * )

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

Allocates and constructs a new node.

Parameters
aTypeThe type of the node
aParentThe parent of this node
Return Value
New 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
aNodeChild node or NULL to get the first child
Return Value
First or next child node

NextSibling ( )

CTypedNode *NextSibling()const [inline]

Reimplemented from CNode::NextSibling()const

Gets the next sibling node.

This asks for the next child of its parent.

Return Value
Next sibling node

NumberImmediateChildren ( )

TInt NumberImmediateChildren()const [inline]

Gets the number of children of this node.

Return Value
Number of children of this node

Parent ( )

CTypedNode *Parent()const [inline]

Reimplemented from CNode::Parent()const

Gets the parent of this node.

Return Value
Parent

PrevChild ( const CNode & )

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

Gets the previous child before a specified child.

Parameters
aNodeChild node
Return Value
Previous child node

PrevSibling ( )

CTypedNode *PrevSibling()const [inline]

Reimplemented from CNode::PrevSibling()const

Gets the previous sibling node.

This asks for the previous child of its parent.

Return Value
Previous sibling node

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
aAttributeTypeAttribute type

ReparentL ( CNode * )

voidReparentL(CNode *aParent)[inline]

Reimplemented from CNode::ReparentL(CNode *)

Changes the parent of the node.

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

Parameters
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
aDataRoot node

Root ( )

const CTypedNode &Root()const [inline]

Reimplemented from CNode::Root()const

Gets the absolute root node of the tree.

Return Value
Root node

SetDataL ( HBufC16 * )

voidSetDataL(HBufC16 *aDataNowNodeOwns)[inline]

Reimplemented from CNode::SetDataL(HBufC16 *)

Sets the node data.

The object will delete the data in its destructor.

Parameters
aDataNowNodeOwnsNode data

SetDataNoDeleteL ( )

voidSetDataNoDeleteL()[inline]

Reimplemented from CNode::SetDataNoDeleteL()

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
aFileDataLocationNowNodeOwnsName of the file containing the data

SetType ( TNodeType )

voidSetType(TNodeTypeaType)[inline]

Sets the node type.

Parameters
aTypeNode type

Type ( )

TNodeTypeType()const [inline]

Reimplemented from CNode::Type()const

Gets the node type.

Return Value
Node type