CNcdAttributes Class Reference

class CNcdAttributes : public CBase

Simple attribute container

Used for setting, getting, storing and loading simple attributes. Currently supports 16-bit descriptors and TInt32

Inherits from

Public Member Functions
~CNcdAttributes()
IMPORT_C TInt32AttributeInt32(TInt)
IMPORT_C const TDesC &AttributeString16(TInt)
IMPORT_C TAttributeTypeAttributeType(TInt)
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C CNcdAttributes *NewL(TInt, TInt)
IMPORT_C CNcdAttributes *NewL(RReadStream &, TInt, TInt)
IMPORT_C CNcdAttributes *NewL(const CNcdAttributes &)
IMPORT_C TIntRangeLowerLimit()
IMPORT_C TIntRangeUpperLimit()
IMPORT_C voidSetAttributeL(TInt, TInt32)
IMPORT_C voidSetAttributeL(TInt, const TDesC &)
Protected Member Functions
CNcdAttributes(TInt, TInt)
TInt ArraySize()
const TAttribute &Attribute(TInt)
TAttribute &Attribute(TInt)
voidClearAttributes()
voidConstructL()
voidConstructL(const CNcdAttributes &)
TAttribute CopyAttributeL(const TAttribute &)
voidDeleteAttribute(TAttribute &)
voidExternalizeAttributeL(const TAttribute &, RWriteStream &)
TAttribute InternalizeAttributeL(RReadStream &)
voidResetAttributesL()
Private Member Functions
CNcdAttributes(const CNcdAttributes &)
CNcdAttributes &operator=(const CNcdAttributes &)
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()
Public Member Enumerations
enumTAttributeType { EAttributeTypeUndefined = 0, EAttributeTypeInt32, EAttributeTypeString16 }
Private Attributes
RArray< TAttribute >iAttributes
TInt iLowerLimit
TInt iUpperLimit

Constructor & Destructor Documentation

CNcdAttributes(TInt, TInt)

CNcdAttributes(TIntaUpperLimit,
TIntaLowerLimit
)[protected]

Parameters

TInt aUpperLimit
TInt aLowerLimit

CNcdAttributes(const CNcdAttributes &)

CNcdAttributes(const CNcdAttributes &)[private]

Parameters

const CNcdAttributes &

~CNcdAttributes()

IMPORT_C~CNcdAttributes()[virtual]

Destructor

Member Functions Documentation

ArraySize()

TInt ArraySize()const [protected]

Attribute(TInt)

const TAttribute &Attribute(TIntaAttribute)const [protected]

Parameters

TInt aAttribute

Attribute(TInt)

TAttribute &Attribute(TIntaAttribute)[protected]

Parameters

TInt aAttribute

AttributeInt32(TInt)

IMPORT_C TInt32AttributeInt32(TIntaAttribute)const

TInt32 attribute getter

panic
ENcdPanicIndexOutOfRange if aAttribute is not RangeLowerLimit() <= aAttribute < RangeUpperLimit()
panic
ENcdPanicInvalidArgument if the attribute type is not EAttributeTypeInt32

Parameters

TInt aAttributeAttribute

AttributeString16(TInt)

IMPORT_C const TDesC &AttributeString16(TIntaAttribute)const

16-bit descriptor attribute getter

panic
ENcdPanicIndexOutOfRange if aAttribute is not RangeLowerLimit() <= aAttribute < RangeUpperLimit()
panic
ENcdPanicInvalidArgument if the attribute type is not EAttributeTypeString16

Parameters

TInt aAttributeAttribute

AttributeType(TInt)

IMPORT_C TAttributeTypeAttributeType(TIntaAttribute)const

Attribute type getter

panic
ENcdPanicIndexOutOfRange if aAttribute is not RangeLowerLimit() <= aAttribute < RangeUpperLimit()

Parameters

TInt aAttribute

ClearAttributes()

voidClearAttributes()[protected]

ConstructL()

voidConstructL()[protected]

ConstructL(const CNcdAttributes &)

voidConstructL(const CNcdAttributes &aAttributes)[protected]

Parameters

const CNcdAttributes & aAttributes

CopyAttributeL(const TAttribute &)

TAttribute CopyAttributeL(const TAttribute &aAttribute)const [protected]

Parameters

const TAttribute & aAttribute

DeleteAttribute(TAttribute &)

voidDeleteAttribute(TAttribute &aAttribute)[protected]

Parameters

TAttribute & aAttribute

ExternalizeAttributeL(const TAttribute &, RWriteStream &)

voidExternalizeAttributeL(const TAttribute &aAttribute,
RWriteStream &aStream
)const [protected]

Parameters

const TAttribute & aAttribute
RWriteStream & aStream

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Parameters

RWriteStream & aStream

InternalizeAttributeL(RReadStream &)

TAttribute InternalizeAttributeL(RReadStream &aStream)const [protected]

Parameters

RReadStream & aStream

InternalizeL(RReadStream &)

IMPORT_C voidInternalizeL(RReadStream &aStream)

Parameters

RReadStream & aStream

NewL(TInt, TInt)

IMPORT_C CNcdAttributes *NewL(TIntaUpperLimit,
TIntaLowerLimit = 0
)[static]

Parameters

TInt aUpperLimitUpper attribute limit is NOT included in the range. Must be >= 0 and > aLowerLimit
TInt aLowerLimit = 0

NewL(RReadStream &, TInt, TInt)

IMPORT_C CNcdAttributes *NewL(RReadStream &aStream,
TIntaUpperLimit,
TIntaLowerLimit = 0
)[static]
Note:

If given upperlimit differs from the one read from the stream then the attribute range is adjusted for the given limit.

leave
KErrArgument if aLowerLimit differs from the lower limit read from the stream

Parameters

RReadStream & aStream
TInt aUpperLimit
TInt aLowerLimit = 0

NewL(const CNcdAttributes &)

IMPORT_C CNcdAttributes *NewL(const CNcdAttributes &aAttributes)[static]

Copy constructor

Parameters

const CNcdAttributes & aAttributes

RangeLowerLimit()

IMPORT_C TIntRangeLowerLimit()const

Lower limit getter

RangeUpperLimit()

IMPORT_C TIntRangeUpperLimit()const

Upper limit getter

ResetAttributesL()

voidResetAttributesL()[protected]

SetAttributeL(TInt, TInt32)

IMPORT_C voidSetAttributeL(TIntaAttribute,
TInt32aValue
)

TInt32 attribute setter

panic
ENcdPanicIndexOutOfRange if aAttribute is not RangeLowerLimit() <= aAttribute < RangeUpperLimit()
panic
ENcdPanicInvalidArgument if the attribute type is not EAttributeTypeInt32 or EAttributeTypeUndefined

Parameters

TInt aAttributeAttribute
TInt32 aValueValue

SetAttributeL(TInt, const TDesC &)

IMPORT_C voidSetAttributeL(TIntaAttribute,
const TDesC &aValue
)

16-bit descriptor attribute setter

leave
KErrNoMemory if memory runs out
panic
ENcdPanicIndexOutOfRange if aAttribute is not RangeLowerLimit() <= aAttribute < RangeUpperLimit()
panic
ENcdPanicInvalidArgument if the attribute type is not EAttributeTypeString16 or EAttributeTypeUndefined

Parameters

TInt aAttributeAttribute
const TDesC & aValueValue

operator=(const CNcdAttributes &)

CNcdAttributes &operator=(const CNcdAttributes &)[private]

Parameters

const CNcdAttributes &

Member Enumerations Documentation

Enum TAttributeType

Types of supported attributes

Enumerators

EAttributeTypeUndefined = 0

Attribute type is not set

EAttributeTypeInt32

Attribute is TInt32

EAttributeTypeString16

Attribute is a 16-bit descriptor

Member Data Documentation

RArray< TAttribute > iAttributes

RArray< TAttribute >iAttributes[private]

TInt iLowerLimit

TInt iLowerLimit[private]

TInt iUpperLimit

TInt iUpperLimit[private]