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 voidAdopt(RSafeMessage &)
IMPORT_C voidComplete(TInt)
IMPORT_C voidDuplicate(const RSafeMessage &)
IMPORT_C TIntGetDesMaxLengthL(TInt)
IMPORT_C voidPanicClient(const TDesC &, TInt)
IMPORT_C TIntRead(TInt, TDes8 &, TInt)
IMPORT_C TIntRead(TInt, TDes16 &, TInt)
IMPORT_C voidReadL(TInt, TDes16 &, TInt)
IMPORT_C voidReadL(TInt, TDes8 &, TInt)
IMPORT_C voidResetHandle()
IMPORT_C TIntWrite(TInt, const TDesC8 &, TInt)
IMPORT_C TIntWrite(TInt, const TPckg< TUint32 > &, TInt)
IMPORT_C TIntWrite(TInt, const TDesC16 &, TInt)
IMPORT_C voidWriteL(TInt, const TDesC8 &, TInt)
IMPORT_C voidWriteL(TInt, const TPckg< TUint32 > &, TInt)
IMPORT_C voidWriteL(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 voidAdopt(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 voidComplete(TIntaReason)const

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

Parameters

TInt aReason

Duplicate(const RSafeMessage &)

IMPORT_C voidDuplicate(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 TIntGetDesMaxLengthL(TIntaParam)const

Parameters

TInt aParam

PanicClient(const TDesC &, TInt)

IMPORT_C voidPanicClient(const TDesC &aCategory,
TIntaReason
)const

Parameters

const TDesC & aCategory
TInt aReason

Read(TInt, TDes8 &, TInt)

IMPORT_C TIntRead(TIntaSrcParamIndex,
TDes8 &aDes,
TIntanOffset = 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 TIntRead(TIntaSrcParamIndex,
TDes16 &aDes,
TIntanOffset = 0
)const

Parameters

TInt aSrcParamIndex
TDes16 & aDes
TInt anOffset = 0

ReadL(TInt, TDes16 &, TInt)

IMPORT_C voidReadL(TIntaSrcParamIndex,
TDes16 &aDes,
TIntanOffset = 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 voidReadL(TIntaSrcParamIndex,
TDes8 &aDes,
TIntanOffset = 0
)const

Parameters

TInt aSrcParamIndex
TDes8 & aDes
TInt anOffset = 0

ResetHandle()

IMPORT_C voidResetHandle()

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 TIntWrite(TIntaDstParamIndex,
const TDesC8 &aDes,
TIntanOffset = 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 TIntWrite(TIntaDstParamIndex,
const TPckg< TUint32 > &aDes,
TIntanOffset = 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 TIntWrite(TIntaDstParamIndex,
const TDesC16 &aDes,
TIntanOffset = 0
)const

Parameters

TInt aDstParamIndex
const TDesC16 & aDes
TInt anOffset = 0

WriteL(TInt, const TDesC8 &, TInt)

IMPORT_C voidWriteL(TIntaDstParamIndex,
const TDesC8 &aDes,
TIntanOffset = 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 voidWriteL(TIntaDstParamIndex,
const TPckg< TUint32 > &aDes,
TIntanOffset = 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 voidWriteL(TIntaDstParamIndex,
const TDesC16 &aDes,
TIntanOffset = 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 &