CSARStore Class Reference

#include <gsmustor.h>

Link against: gsmu.lib

class CSARStore : public CBase

Inherits from

Protected Attributes
RFs &iFs
TInt iMaxmumNumberOfMessagesInSegmentationStore
Public Member Functions
IMPORT_C voidBeginTransactionLC()
IMPORT_C voidClose()
IMPORT_C voidCommitTransactionL()
IMPORT_C voidCompactL()
IMPORT_C voidDeleteEntryL(TInt)
IMPORT_C voidDoOpenL()
IMPORT_C const CArrayFix< TSAREntry > &Entries()
RFs &FileSession()
TBool InTransaction()
IMPORT_C voidOpenL(const TDesC &, const TUid &)
IMPORT_C voidPrivatePath(TDes &)
IMPORT_C voidPurgeL(const TTimeIntervalMinutes &, TBool)
IMPORT_C voidPurgeL(TInt, TBool)
voidRevert()
Protected Member Functions
CSARStore(RFs &)
~CSARStore()
IMPORT_C voidAddEntryL(const TSAREntry &)
IMPORT_C voidChangeEntryL(TInt, const TSAREntry &)
IMPORT_C TStreamIdExtraStreamId()
IMPORT_C CFileStore &FileStore()
IMPORT_C const CFileStore &FileStore()
IMPORT_C voidSetExtraStreamIdL(const TStreamId &)
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()

Detailed Description

Controls the segmentation and reassembly (SAR) store, used for SMS segmentation and reassembly, and WAP reassembly.

Member Attribute Documentation

iFs

RFs &iFs[protected]

iMaxmumNumberOfMessagesInSegmentationStore

TInt iMaxmumNumberOfMessagesInSegmentationStore[protected]

Maximum number of SMS messages that can be stored in segmentation store.

Constructor & Destructor Documentation

CSARStore ( RFs & )

IMPORT_CCSARStore(RFs &aFs)[protected]

Constructor, initialises class members only.

Parameters
aFsFile system handle
Capability
None

~CSARStore ( )

IMPORT_C~CSARStore()[protected]
Destructor. Frees resource.
Capability
None

Member Function Documentation

AddEntryL ( const TSAREntry & )

IMPORT_C voidAddEntryL(const TSAREntry &aEntry)[protected]

Adds a new entry to the file store.

The function appends the new entry to the internal entry array, and then externalises it.

The file store must be open before calling this function.

Parameters
aEntrySAR entry to add
Capability
None

BeginTransactionLC ( )

IMPORT_C voidBeginTransactionLC()

Sets the SAR store as in-transaction.

The function checks the validity of the call and leaves KErrAccessDenied if invalid.
Capability
None

ChangeEntryL ( TInt, const TSAREntry & )

IMPORT_C voidChangeEntryL(TIntaIndex,
const TSAREntry &aNewEntry
)[protected]

Changes an entry in the file store - changes it first in the internal entry array, and then externalizes it.

The file store must be open before calling this function.

Parameters
aIndexThe index into the SAR store to be changed
aNewEntryThe new SAR store entry
Capability
None

Close ( )

IMPORT_C voidClose()

Closes the file store.

The function deletes the file store object and resets the entry array. It should be called once when the protocol module is closing down.
Capability
None

CommitTransactionL ( )

IMPORT_C voidCommitTransactionL()
Commits a transaction to the filestore.
Capability
None

CompactL ( )

IMPORT_C voidCompactL()

Compacts the file store.

This is done on every reboot and for every eighth SMS message sent, to keep the size of the file as low as possible.

This function opens and closes the file automatically.
Capability
None

DeleteEntryL ( TInt )

IMPORT_C voidDeleteEntryL(TIntaIndex)

Deletes an entry from the entry array, and externalizes it.

The file store must be open before calling this function.

Parameters
aIndexEntry in the SAR store to delete
Capability
None

DoOpenL ( )

IMPORT_C voidDoOpenL()

Opens a filestore.

This is called by OpenL(), and does the work of really opening the file. If the file is not there, it creates a new one.
Capability
None

Entries ( )

IMPORT_C const CArrayFix< TSAREntry > &Entries()const

Gets a const reference to the entry array.

Return Value
Entry array
Capability
None

ExtraStreamId ( )

IMPORT_C TStreamIdExtraStreamId()const [protected]

Gets the extra stream ID.

Return Value
Extra stream ID
Capability
None

FileSession ( )

RFs &FileSession()const [inline]

Gets the file server handle.

Return Value
File server handle

FileStore ( )

IMPORT_C CFileStore &FileStore()[protected]

Gets a reference to the filestore.

Return Value
The filestore
Capability
None

FileStore ( )

IMPORT_C const CFileStore &FileStore()const [protected]

Gets a (const) reference to the filestore.

Return Value
The filestore
Capability
None

InTransaction ( )

TBool InTransaction()const [inline]

Return Value
whether it's in transaction

OpenL ( const TDesC &, const TUid & )

IMPORT_C voidOpenL(const TDesC &aFullName,
const TUid &aThirdUid
)

Opens a specified SAR store.

A SAR filestore has has three uids, KPermanentFileStoreLayoutUid, KSARStoreUid (which designates that the file store is a SAR store) and a third UID, that identifies the particular implementation of CSARStore.

Parameters
aFullNameName for the segmentation and reassembly filestore
aThirdUidThird UID for the filestore.
Capability
None

PrivatePath ( TDes & )

IMPORT_C voidPrivatePath(TDes &aPath)

Returns the private path used to open a store.

Parameters
aPathThe private path of a store.
Capability
None

PurgeL ( const TTimeIntervalMinutes &, TBool )

IMPORT_C voidPurgeL(const TTimeIntervalMinutes &aTimeIntervalMinutes,
TBoolaPurgeIncompleteOnly
)

Purges the reassembly file store.

After a multipart message, it delete all the old entries.

Entries will be purged when: 1) The complete message is received; 2) After aTimerintervalMinutes, if aPurgeIncompletely is false.

PurgeL() will be called after the booting of the device or when a message has been received.

This function opens and closes the file automatically.

Note: overload function for segmentation store.

Parameters
aTimeIntervalMinutesPurge time
aPurgeIncompleteOnlyPurge complete messages flag
Capability
None

PurgeL ( TInt, TBool )

IMPORT_C voidPurgeL(TIntaKSegmentationLifetimeMultiplier,
TBoolaPurgeIncompleteOnly
)

Purges the segmentation store.

This purges the filestore after a multipart message, deleting all the old entries.

This function opens and closes the file automatically.

Parameters
aKSegmentationLifetimeMultiplierThe coefficient for calculating whether a message should be purged
aPurgeIncompleteOnlySet to false to purge all entries. Set to true to purge incomplete messages only.
Capability
None

Revert ( )

voidRevert()

SetExtraStreamIdL ( const TStreamId & )

IMPORT_C voidSetExtraStreamIdL(const TStreamId &aExtraStreamId)[protected]

Sets the extra stream ID - changes it first in the internal entry array, and then externalizes it.

You must call Close() when the function returns.

Parameters
aExtraStreamIdExtra stream ID
Capability
None