Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: s32std.h
Link against: estor.lib

Class TSwizzleCBase

TSwizzleCBase

Support

Supported from 5.0

Description

Base class for swizzles.

A swizzle maintains a dual representation for an object:

The class is not intended for instantiation.

Defined in TSwizzleCBase:
AsId(), InternalizeL(), IsId(), IsPtr(), operator!=(), operator==()


Determine the current representation of the swizzled object


IsPtr()

TBool IsPtr() const;

Description

Tests whether this swizzle currently represents an object as a pointer.

Return value

TBool

True, if this swizzle currently maintains the object representation as a pointer; False, otherwise. Note that if the swizzle is uninitialised, the value returned by this function is not defined.


IsId()

TBool IsId() const;

Description

Tests whether this swizzle currently represents an object as a stream id.

Return value

TBool

True, if this swizzle currently maintains the representation of the object as a stream id; False, otherwise. Note that if the swizzle is uninitialised, the value returned by this function is not defined.

[Top]


Get streamid of represented object


AsId()

TStreamId AsId() const;

Description

Returns the streamid of the represented object.

This swizzle must currently represent the object as a stream id, otherwise the function raises a STORE-Store 3 panic.

Return value

TStreamId

The stream id of the represented object

[Top]


Stream persistence


InternalizeL()

void InternalizeL(RReadStream& aStream);

Description

Internalises a stream id from the read stream, constructs a swizzle from this stream id and copies the swizzle to this swizzle.

The presence of this function means that the standard templated operator>>() can be used to internalise objects of this class.

Parameters

RReadStream& aStream

Stream from which the stream id should be internalised

[Top]


Comparison operators


operator==()

TBool operator==(const TSwizzleCBase& aSwizzle) const;

Description

Compare for equality with another swizzle.

Use this operator to determine whether this swizzle represents the same object as that represented by the specified swizzle.

Both this swizzle and the specified swizzle must maintain the representation of their respective objects as either pointers or stream ids.

If one swizzle maintains the representation of its object as a pointer while the other swizzle maintains the representation of its object as a stream id, the comparison is meaningless and always returns false.

Parameters

const TSwizzleCBase& aSwizzle

A reference to the swizzle to be compared with this swizzle.

Return value

TBool

True, if the represented objects are the same; False, otherwise.


operator==()

TBool operator==(const TAny* aPtr) const;

Description

Compare for equality with an in-memory object.

Use this operator to determine whether this swizzle represents the same in-memory object as that represented by the specified pointer.

This swizzle must maintain the representation of its object as a pointer. If it maintains the representation of its object as a swizzle, the comparison is meaningless and always returns false.

Parameters

const TAny* aPtr

A pointer to the object to be compared with this swizzle.

Return value

TBool

True, if the represented objects are the same; False, otherwise.


operator!=()

TBool operator!=(const TSwizzleCBase& aSwizzle) const;

Description

Compare for inequality with another swizzle.

Use this operator to determine whether this swizzle represents a different object to that represented by the specified swizzle.

Both this swizzle and the specified swizzle must maintain the representation of their respective objects as either pointers or stream ids.

If one swizzle maintains the representation of its object as a pointer while the other swizzle maintains the representation of its object as a stream id, the comparison is meaningless and always returns true.

Parameters

const TSwizzleCBase& aSwizzle

A reference to the swizzle to be compared with this swizzle.

Return value

TBool

True, if the represented objects are not the same; False, otherwise


operator!=()

TBool operator!=(const TAny* aPtr) const;

Description

Compare for inequality with an in-memory object.

Use this operator to determine whether this swizzle represents a different in-memory object to that represented by the specified pointer.

This swizzle must maintain the representation of its object as a pointer. If it maintains the representation of its object as a swizzle, the comparison is meaningless and always returns true.

Parameters

const TAny* aPtr

A pointer to the object to be compared with this swizzle.

Return value

TBool

True, if the represented objects are not the same; False, otherwise