Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Using TCardinality

TCardinality's use is best explained by an example:

If an integral value that needs externalising is known to be non-negative and cannot exceed 2^29 (e.g. the length of a descriptor) - instead of storing a 32-bit value in the stream, you can use TCardinality to compress the external format. So instead of

writeStream.WriteUint32L(myValue);
...
myValue=readStream.ReadUint32L();

you would use

writeStream << TCardinality(myValue);
...
TCardinality c;
readStream >> c;
myValue=c;