Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: btsdp.h
Link against: bluetooth.lib

Class CSdpAttrValue

CSdpAttrValue

Support

Supported from 6.1

Description

Base class for classes that encapsulate SDP attributes values.

Sub-classes of this wrap specific types of SDP service record attributes. For example, CSdpBoolean derives from CSdpAttrValue to encapsulate boolean attributes. The base class defines getters for all types: for example, it declares a function Bool() that returns the attribute value as a TBool. Note though that the function would panic unless called on actual CSdpBoolean.

A common base class allows attributes of all types to be used polymorphically. You can use CSdpAttrValue's Type() function to find the actual type being used, and upcast the pointer appropriately.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CSdpAttrValueBase class for classes that encapsulate SDP attributes values

Defined in CSdpAttrValue:
AcceptVisitorL(), Bool(), CSdpAttrValue(), DataSize(), Des(), DoesIntFit(), Int(), Type(), UUID(), Uint(), ~CSdpAttrValue()

Inherited from CBase:
operator new()


Construction and destruction


CSdpAttrValue()

CSdpAttrValue();

Description

Default constructor.


~CSdpAttrValue()

virtual ~CSdpAttrValue();

Description

Destructor.

[Top]


Attribute properties


DataSize()

virtual TUint DataSize() const=0;

Description

Gets the size of the attribute.

Return value

TUint

Size of the attribute in bytes


DoesIntFit()

virtual TBool DoesIntFit() const;

Description

Tests if the attribute can be stored in an integer value.

The base class implementation returns EFalse.

Return value

TBool

True if the attribute can be stored in an integer value


Type()

virtual TSdpElementType Type() const=0;

Description

Gets the attribute type.

Return value

TSdpElementType

Attribute type

[Top]


Attribute value getters


AcceptVisitorL()

virtual void AcceptVisitorL(MSdpAttributeValueVisitor& aVisitor);

Description

Request a call back to pass the attribute value.

When called on attributes that are not lists (not DEA or DES), then this calls MSdpAttributeValueVisitor::VisitAttributeValueL(), passing the attribute value object itself (i.e. *this), and the value attribute type.

It is more useful when called on a DES or DEA object, as it then provides a simple method of enumerating each attribute in a list.

Parameters

MSdpAttributeValueVisitor& aVisitor

Abstract interface that can be implemented to receive an enumeration of the values in an attribute list.

See also:


Bool()

virtual TInt Bool() const;

Description

Gets a Boolean attribute value.

The base class implementation panics.

Return value

TInt

Attribute value


Des()

virtual const TPtrC8 Des() const;

Description

Gets a data buffer attribute value.

The base class implementation panics.

Return value

TPtrC8

Attribute value


Int()

virtual TInt Int() const;

Description

Gets a signed integer attribute value.

The base class implementation panics.

Return value

TInt

Attribute value


Uint()

virtual TUint Uint() const;

Description

Gets an unsigned integer attribute value.

The base class implementation panics.

Return value

TUint

Attribute value


UUID()

virtual const TUUID& UUID() const;

Description

Gets a UUID attribute value.

The base class implementation panics.

Return value

TUUID

Attribute value