Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: s32std.h
Link against: estor.lib

Class CStoreMap

CStoreMap

Support

Supported from 5.0

Description

Store map used when externalising swizzled in-memory objects.

It has three main characteristics:

Derivation

CBaseBase class for all classes to be instantiated on the heap
CStoreMapStore map used when externalising swizzled in-memory objects
MExternalizerBase class used in the derivation of CStoreMap

Defined in CStoreMap:
At(), BindL(), Forget(), Label(), NewL(), NewLC(), Reset(), ResetAndDestroy(), Unbind(), ~CStoreMap()

Inherited from CBase:
operator new()


Construction and destruction


NewL()

static CStoreMap* NewL(CStreamStore& aStore);

Description

Allocates and constructs a store map associated with the specified store and returns a pointer to that store map.

The function leaves if it cannot complete successfully.

Parameters

CStreamStore& aStore

A reference to the store associated with this store map.

Return value

CStoreMap*

A pointer to the new store map object.


NewLC()

static CStoreMap* NewLC(CStreamStore& aStore);

Description

Allocates and constructs a store map associated with the specified store, returns a pointer to that store map and puts the pointer onto the cleanup stack.

The function leaves if it cannot complete successfully.

Placing a pointer to this object onto the cleanup stack allows the object and allocated resources to be cleaned up if a subsequent leave occurs.

Parameters

CStreamStore& aStore

A reference to the store associated with this store map.

Return value

CStoreMap*

A pointer to the new store map object.


~CStoreMap()

~CStoreMap();

Description

Frees resources owned by the object, prior to its destruction.

In particular, the destructor deletes all streams whose stream ids are currently held within the store map and then empties the store map.

[Top]


Create store map entry (binding)


BindL()

void BindL(TSwizzleC<TAny> aSwizzle,TStreamId anId);

Description

Creates an entry in the store map to contain the specified stream id and an associated swizzle. On return from this function, the stream id is said to be bound to the swizzle.

If the store map already contains an entry with the same swizzle, then the new entry replaces the existing entry; in effect, knowledge of the original stream id associated with aSwizzle, is lost.

Callers of this function can pass any type of swizzle as the first parameter, i.e. any swizzle derived from TSwizzleCBase. The required TSwizzleC<TAny> object is constructed from the swizzle passed by the caller.

Note that in most applications, callers pass a general swizzle, i.e. an object of type TSwizzle<class T>, where T is the type of object represented by that swizzle.

Parameters

TSwizzleC<TAny> aSwizzle

Any swizzle derived from TSwizzleCBase.

TStreamId anId

The stream id to be bound to the swizzle.

[Top]


Delete store map entry by swizzle (unbinding)


Unbind()

void Unbind(TSwizzleC<TAny> aSwizzle);

Description

Deletes the first entry from the store map corresponding to the specified swizzle.

On return from this function, the swizzle is said to be unbound and knowledge of the associated stream id is lost.

Callers of this function can pass any type of swizzle as the parameter, i.e. any swizzle derived from TSwizzleCBase. The required TSwizzleC<TAny> object is constructed from the swizzle passed by the caller.

Notes:

Parameters

TSwizzleC<TAny> aSwizzle

Any swizzle derived from TSwizzleCBase.

[Top]


Delete store map entry by stream id (Forgetting)


Forget()

void Forget(TStreamId anId);

Description

Deletes an entry from the store map. The entry selected is the first one whose stream id matches the specified stream id.

On return from this function, the stream id is said to be forgotten and knowledge of that stream id is lost.

Parameters

TStreamId anId

The stream id used to identify the entry in the store map to be deleted.

[Top]


Empty the store map


Reset()

void Reset();

Description

Deletes all entries from the store map.

It is important that this function is called before deleting the store map, as the destructor attempts to delete all streams whose stream ids are held within the map.

[Top]


Delete streams and empty the store map


ResetAndDestroy()

void ResetAndDestroy();

Description

Deletes all streams whose ids are held within the store map, and then empties the store map.

[Top]


Find stream id associated with swizzle


At()

TStreamId At(TSwizzleC<TAny> aSwizzle) const;

Description

Returns the stream id of the first entry the store map matching the specified swizzle.

Callers of this function can pass any type of swizzle as the first parameter, i.e. any swizzle derived from TSwizzleCBase. The required TSwizzleC<TAny> object is constructed from the swizzle passed by the caller.

Parameters

TSwizzleC<TAny> aSwizzle

Any type of swizzle derived from TSwizzleCBase.

Return value

TStreamId

The required streamid.KNullStreamId, if no matching entry can be found.

[Top]


Find swizzle associated with stream id


Label()

TSwizzleC<TAny> Label(TStreamId anId) const;

Description

Returns the swizzle in the store map assocated with the specified stream id.

Parameters

TStreamId anId

The id of the stream

Return value

TSwizzleC<TAny>

The associated swizzle. If there is no matching swizzle, then this is an uninitialized swizzle.