Den::RSafeMessage Class Reference

class Den::RSafeMessage : public RMessage2

Supplementing RMessage2 with additional methods for transferring handle ownership and completing with logging

Inherits from

Public Member Functions
RSafeMessage ()
~RSafeMessage ()
IMPORT_C void Adopt ( RSafeMessage &)
IMPORT_C void Complete ( TInt )
IMPORT_C void Duplicate (const RSafeMessage &)
IMPORT_C TInt GetDesMaxLengthL ( TInt )
IMPORT_C void PanicClient (const TDesC &, TInt )
IMPORT_C TInt Read ( TInt , TDes8 &, TInt )
IMPORT_C TInt Read ( TInt , TDes16 &, TInt )
IMPORT_C void ReadL ( TInt , TDes16 &, TInt )
IMPORT_C void ReadL ( TInt , TDes8 &, TInt )
IMPORT_C void ResetHandle ()
IMPORT_C TInt Write ( TInt , const TDesC8 &, TInt )
IMPORT_C TInt Write ( TInt , const TPckg < TUint32 > &, TInt )
IMPORT_C TInt Write ( TInt , const TDesC16 &, TInt )
IMPORT_C void WriteL ( TInt , const TDesC8 &, TInt )
IMPORT_C void WriteL ( TInt , const TPckg < TUint32 > &, TInt )
IMPORT_C void WriteL ( TInt , const TDesC16 &, TInt )
Private Member Functions
RSafeMessage (const RMessage2 &)
RSafeMessage & operator= (const RSafeMessage &)
RSafeMessage & operator= (const RMessage2 &)
Inherited Functions
RMessage2::Authorised()const
RMessage2::ClearAuthorised()const
RMessage2::Function()const
RMessage2::Int0()const
RMessage2::Int1()const
RMessage2::Int2()const
RMessage2::Int3()const
RMessage2::Ptr0()const
RMessage2::Ptr1()const
RMessage2::Ptr2()const
RMessage2::Ptr3()const
RMessage2::RMessage2()
RMessage2::RMessage2(const RMessagePtr2 &)
RMessage2::Session()const
RMessage2::SetAuthorised()const
RMessagePtr2::Client(RThread &,TOwnerType)const
RMessagePtr2::ClientIsRealtime()const
RMessagePtr2::ClientL(RThread &,TOwnerType)const
RMessagePtr2::ClientProcessFlags()const
RMessagePtr2::ClientStatus()const
RMessagePtr2::Complete(RHandleBase)const
RMessagePtr2::GetDesLength(TInt)const
RMessagePtr2::GetDesMaxLength(TInt)const
RMessagePtr2::Handle()const
RMessagePtr2::HasCapability(TCapability,TCapability,const char *)const
RMessagePtr2::HasCapability(TCapability,const char *)const
RMessagePtr2::HasCapabilityL(TCapability,TCapability,const char *)const
RMessagePtr2::HasCapabilityL(TCapability,const char *)const
RMessagePtr2::Identity()const
RMessagePtr2::IsNull()const
RMessagePtr2::Kill(TInt)const
RMessagePtr2::Panic(const TDesC &,TInt)const
RMessagePtr2::RMessagePtr2()
RMessagePtr2::SecureId()const
RMessagePtr2::SetProcessPriority(TProcessPriority)const
RMessagePtr2::SetProcessPriorityL(TProcessPriority)const
RMessagePtr2::Terminate(TInt)const
RMessagePtr2::VendorId()const
Inherited Enumerations
RMessage2:TSessionMessages
Inherited Attributes
RMessage2::iArgs
RMessage2::iFunction
RMessage2::iSessionPtr
RMessagePtr2::iHandle

Constructor & Destructor Documentation

RSafeMessage()

RSafeMessage ( ) [inline]

Only a default constructor is supported; safe messages get initialised by adopting their handle from another instance, by downcasting from a received RMessage2 (ugly but safe since safe messages never add members or virtuals), or (rarely) by duplicating another instance, which diminishes safety.

RSafeMessage(const RMessage2 &)

RSafeMessage ( const RMessage2 & ) [private]

Parameters

const RMessage2 &

~RSafeMessage()

IMPORT_C ~RSafeMessage ( )

Because we strive to maintain a single owner for a message and to pass by reference when ownership it's generally an error for the handle to be set upon destruction.

Member Functions Documentation

Adopt(RSafeMessage &)

IMPORT_C void Adopt ( RSafeMessage & aSrc )

Take over a message. Beyond being a simple copy this resets the source's handle so that double-ownership is avoided

Parameters

RSafeMessage & aSrc

Complete(TInt)

IMPORT_C void Complete ( TInt aReason ) const

Complete the message with the given reason code, with detailed logging

Parameters

TInt aReason

Duplicate(const RSafeMessage &)

IMPORT_C void Duplicate ( const RSafeMessage & aSrc )

Duplicate a message, including aliasing the handle & so raising the risk of a double-complete

Parameters

const RSafeMessage & aSrc

GetDesMaxLengthL(TInt)

IMPORT_C TInt GetDesMaxLengthL ( TInt aParam ) const

Parameters

TInt aParam

PanicClient(const TDesC &, TInt)

IMPORT_C void PanicClient ( const TDesC & aCategory,
TInt aReason
) const

Parameters

const TDesC & aCategory
TInt aReason

Read(TInt, TDes8 &, TInt)

IMPORT_C TInt Read ( TInt aSrcParamIndex,
TDes8 & aDes,
TInt anOffset = 0
) const

Perform a read and kill the client if it has supplied a bad descriptor

Parameters

TInt aSrcParamIndex
TDes8 & aDes
TInt anOffset = 0

Read(TInt, TDes16 &, TInt)

IMPORT_C TInt Read ( TInt aSrcParamIndex,
TDes16 & aDes,
TInt anOffset = 0
) const

Parameters

TInt aSrcParamIndex
TDes16 & aDes
TInt anOffset = 0

ReadL(TInt, TDes16 &, TInt)

IMPORT_C void ReadL ( TInt aSrcParamIndex,
TDes16 & aDes,
TInt anOffset = 0
) const

Perform a read and kill the client if it has supplied a bad descriptor

Parameters

TInt aSrcParamIndex
TDes16 & aDes
TInt anOffset = 0

ReadL(TInt, TDes8 &, TInt)

IMPORT_C void ReadL ( TInt aSrcParamIndex,
TDes8 & aDes,
TInt anOffset = 0
) const

Parameters

TInt aSrcParamIndex
TDes8 & aDes
TInt anOffset = 0

ResetHandle()

IMPORT_C void ResetHandle ( )

Null the handle, so this safe message no longer references a client request. This is normally done automatically by completing or panicking the client or transferring message ownership, so this will seldom need to be called explicitly

Write(TInt, const TDesC8 &, TInt)

IMPORT_C TInt Write ( TInt aDstParamIndex,
const TDesC8 & aDes,
TInt anOffset = 0
) const

Perform a write and kill the client if it has supplied a bad descriptor

Parameters

TInt aDstParamIndex
const TDesC8 & aDes
TInt anOffset = 0

Write(TInt, const TPckg< TUint32 > &, TInt)

IMPORT_C TInt Write ( TInt aDstParamIndex,
const TPckg < TUint32 > & aDes,
TInt anOffset = 0
) const

Perform a write and kill the client if it has supplied a bad descriptor

Parameters

TInt aDstParamIndex
const TPckg < TUint32 > & aDes
TInt anOffset = 0

Write(TInt, const TDesC16 &, TInt)

IMPORT_C TInt Write ( TInt aDstParamIndex,
const TDesC16 & aDes,
TInt anOffset = 0
) const

Parameters

TInt aDstParamIndex
const TDesC16 & aDes
TInt anOffset = 0

WriteL(TInt, const TDesC8 &, TInt)

IMPORT_C void WriteL ( TInt aDstParamIndex,
const TDesC8 & aDes,
TInt anOffset = 0
) const

Perform a write and kill the client if it has supplied a bad descriptor

Parameters

TInt aDstParamIndex
const TDesC8 & aDes
TInt anOffset = 0

WriteL(TInt, const TPckg< TUint32 > &, TInt)

IMPORT_C void WriteL ( TInt aDstParamIndex,
const TPckg < TUint32 > & aDes,
TInt anOffset = 0
) const

Perform a write and kill the client if it has supplied a bad descriptor

Parameters

TInt aDstParamIndex
const TPckg < TUint32 > & aDes
TInt anOffset = 0

WriteL(TInt, const TDesC16 &, TInt)

IMPORT_C void WriteL ( TInt aDstParamIndex,
const TDesC16 & aDes,
TInt anOffset = 0
) const

Perform a write and kill the client if it has supplied a bad descriptor

Parameters

TInt aDstParamIndex
const TDesC16 & aDes
TInt anOffset = 0

operator=(const RSafeMessage &)

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

Parameters

const RSafeMessage &

operator=(const RMessage2 &)

RSafeMessage & operator= ( const RMessage2 & ) [private]

Parameters

const RMessage2 &