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 TInt32 AttributeInt32 ( TInt )
IMPORT_C const TDesC & AttributeString16 ( TInt )
IMPORT_C TAttributeType AttributeType ( TInt )
IMPORT_C void ExternalizeL ( RWriteStream &)
IMPORT_C void InternalizeL ( RReadStream &)
IMPORT_C CNcdAttributes * NewL ( TInt , TInt )
IMPORT_C CNcdAttributes * NewL ( RReadStream &, TInt , TInt )
IMPORT_C CNcdAttributes * NewL (const CNcdAttributes &)
IMPORT_C TInt RangeLowerLimit ()
IMPORT_C TInt RangeUpperLimit ()
IMPORT_C void SetAttributeL ( TInt , TInt32 )
IMPORT_C void SetAttributeL ( TInt , const TDesC &)
Protected Member Functions
CNcdAttributes ( TInt , TInt )
TInt ArraySize ()
const TAttribute & Attribute ( TInt )
TAttribute & Attribute ( TInt )
void ClearAttributes ()
void ConstructL ()
void ConstructL (const CNcdAttributes &)
TAttribute CopyAttributeL (const TAttribute &)
void DeleteAttribute ( TAttribute &)
void ExternalizeAttributeL (const TAttribute &, RWriteStream &)
TAttribute InternalizeAttributeL ( RReadStream &)
void ResetAttributesL ()
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
enum TAttributeType { EAttributeTypeUndefined  = 0, EAttributeTypeInt32 , EAttributeTypeString16 }
Private Attributes
RArray < TAttribute > iAttributes
TInt iLowerLimit
TInt iUpperLimit

Constructor & Destructor Documentation

CNcdAttributes(TInt, TInt)

CNcdAttributes ( TInt aUpperLimit,
TInt aLowerLimit
) [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 ( TInt aAttribute ) const [protected]

Parameters

TInt aAttribute

Attribute(TInt)

TAttribute & Attribute ( TInt aAttribute ) [protected]

Parameters

TInt aAttribute

AttributeInt32(TInt)

IMPORT_C TInt32 AttributeInt32 ( TInt aAttribute ) const

TInt32 attribute getter

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

Parameters

TInt aAttribute Attribute

AttributeString16(TInt)

IMPORT_C const TDesC & AttributeString16 ( TInt aAttribute ) 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 aAttribute Attribute

AttributeType(TInt)

IMPORT_C TAttributeType AttributeType ( TInt aAttribute ) const

Attribute type getter

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

Parameters

TInt aAttribute

ClearAttributes()

void ClearAttributes ( ) [protected]

ConstructL()

void ConstructL ( ) [protected]

ConstructL(const CNcdAttributes &)

void ConstructL ( const CNcdAttributes & aAttributes ) [protected]

Parameters

const CNcdAttributes & aAttributes

CopyAttributeL(const TAttribute &)

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

Parameters

const TAttribute & aAttribute

DeleteAttribute(TAttribute &)

void DeleteAttribute ( TAttribute & aAttribute ) [protected]

Parameters

TAttribute & aAttribute

ExternalizeAttributeL(const TAttribute &, RWriteStream &)

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

Parameters

const TAttribute & aAttribute
RWriteStream & aStream

ExternalizeL(RWriteStream &)

IMPORT_C void ExternalizeL ( RWriteStream & aStream ) const

Parameters

RWriteStream & aStream

InternalizeAttributeL(RReadStream &)

TAttribute InternalizeAttributeL ( RReadStream & aStream ) const [protected]

Parameters

RReadStream & aStream

InternalizeL(RReadStream &)

IMPORT_C void InternalizeL ( RReadStream & aStream )

Parameters

RReadStream & aStream

NewL(TInt, TInt)

IMPORT_C CNcdAttributes * NewL ( TInt aUpperLimit,
TInt aLowerLimit = 0
) [static]

Parameters

TInt aUpperLimit Upper 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,
TInt aUpperLimit,
TInt aLowerLimit = 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 TInt RangeLowerLimit ( ) const

Lower limit getter

RangeUpperLimit()

IMPORT_C TInt RangeUpperLimit ( ) const

Upper limit getter

ResetAttributesL()

void ResetAttributesL ( ) [protected]

SetAttributeL(TInt, TInt32)

IMPORT_C void SetAttributeL ( TInt aAttribute,
TInt32 aValue
)

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 aAttribute Attribute
TInt32 aValue Value

SetAttributeL(TInt, const TDesC &)

IMPORT_C void SetAttributeL ( TInt aAttribute,
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 aAttribute Attribute
const TDesC & aValue Value

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]