RHandleBase Class Reference

class RHandleBase

A handle to an object.

The class encapsulates the basic behaviour of a handle, hiding the handle-number which identifies the object which the handle represents.

The class is abstract in the sense that a RHandleBase object is never explicitly instantiated. It is always a base class to a concrete handle class; for example, RSemaphore, RThread, RProcess, RCriticalSection etc.

Public Member Functions
RHandleBase()
IMPORT_C TUintAttributes()
IMPORT_C TIntBTraceId()
IMPORT_C voidClose()
voidDoExtendedClose()
IMPORT_C TIntDuplicate(const RThread &, TOwnerType)
IMPORT_C TFullNameFullName()
IMPORT_C voidFullName(TDes &)
TInt Handle()
IMPORT_C voidHandleInfo(THandleInfo *)
IMPORT_C TNameName()
IMPORT_C voidNotifyDestruction(TRequestStatus &)
voidSetHandle(TInt)
IMPORT_C voidSetHandleNC(TInt)
TInt SetReturnedHandle(TInt)
Protected Member Functions
RHandleBase(TInt)
IMPORT_C TIntOpen(const TFindHandleBase &, TOwnerType)
TInt OpenByName(const TDesC &, TOwnerType, TInt)
TInt SetReturnedHandle(TInt, RHandleBase &)
Private Member Functions
voidDoExtendedCloseL()
Public Member Enumerations
enumTAttributes { EReadAccess = 0x1, EWriteAccess = 0x2, EDirectReadAccess = 0x4, EDirectWriteAccess = 0x8 }
Protected Attributes
TInt iHandle

Constructor & Destructor Documentation

RHandleBase()

RHandleBase()[inline]

Default constructor.

RHandleBase(TInt)

RHandleBase(TIntaHandle)[protected, inline]

Copy constructor.

It constructs this handle from an existing one. Specifically, the handle-number encapsulated by the specified handle is copied to this handle.

Parameters

TInt aHandleThe existing handle to be copied.

Member Functions Documentation

Attributes()

IMPORT_C TUintAttributes()const

BTraceId()

IMPORT_C TIntBTraceId()const

Close()

IMPORT_C voidClose()

DoExtendedClose()

voidDoExtendedClose()[static]

DoExtendedCloseL()

voidDoExtendedCloseL()[private, static]

Duplicate(const RThread &, TOwnerType)

IMPORT_C TIntDuplicate(const RThread &aSrc,
TOwnerTypeaType = EOwnerProcess
)

Parameters

const RThread & aSrc
TOwnerType aType = EOwnerProcess

FullName()

IMPORT_C TFullNameFullName()const

FullName(TDes &)

IMPORT_C voidFullName(TDes &aName)const

Parameters

TDes & aName

Handle()

TInt Handle()const [inline]

Retrieves the handle-number of the object associated with this handle.

The handle number

HandleInfo(THandleInfo *)

IMPORT_C voidHandleInfo(THandleInfo *anInfo)

Parameters

THandleInfo * anInfo

Name()

IMPORT_C TNameName()const

NotifyDestruction(TRequestStatus &)

IMPORT_C voidNotifyDestruction(TRequestStatus &aStatus)

Parameters

TRequestStatus & aStatus

Open(const TFindHandleBase &, TOwnerType)

IMPORT_C TIntOpen(const TFindHandleBase &aHandle,
TOwnerTypeaType
)[protected]

Parameters

const TFindHandleBase & aHandle
TOwnerType aType

OpenByName(const TDesC &, TOwnerType, TInt)

TInt OpenByName(const TDesC &aName,
TOwnerTypeaOwnerType,
TIntaObjectType
)[protected]

Parameters

const TDesC & aName
TOwnerType aOwnerType
TInt aObjectType

SetHandle(TInt)

voidSetHandle(TIntaHandle)[inline]

Sets the handle-number of this handle to the specified value.

Parameters

TInt aHandleThe handle-number to be set.

SetHandleNC(TInt)

IMPORT_C voidSetHandleNC(TIntaHandle)

Parameters

TInt aHandle

SetReturnedHandle(TInt)

TInt SetReturnedHandle(TIntaHandleOrError)[inline]

Sets the handle-number of this handle to the specified value.

The function can take a (zero or positive) handle-number, or a (negative) error number.

If aHandleOrError represents a handle-number, then the handle-number of this handle is set to that value. If aHandleOrError represents an error number, then the handle-number of this handle is set to zero and the negative value is returned.

KErrNone, if aHandle is a handle-number; the value of aHandleOrError, otherwise.

Parameters

TInt aHandleOrErrorA handle-number, if zero or positive; an error value, if negative.

SetReturnedHandle(TInt, RHandleBase &)

TInt SetReturnedHandle(TIntaHandleOrError,
RHandleBase &aHandle
)[protected, static]

Parameters

TInt aHandleOrError
RHandleBase & aHandle

Member Enumerations Documentation

Enum TAttributes

Read/Write attributes for the handle.

Enumerators

EReadAccess = 0x1
EWriteAccess = 0x2
EDirectReadAccess = 0x4
EDirectWriteAccess = 0x8

Member Data Documentation

TInt iHandle

TInt iHandle[protected]