Store Streams Example Code

This example shows how a network of objects can be written to more than one stream in a direct file store, and how the loading of an object from the store into memory may be deferred.

WriteToMany: externalizing to more than one stream/deferred loading

Download

Download the example: WriteToMany.zip.

Download some additional files required by the example: CommonFramework.zip.

View the source code: browse. View the additional files: browse.

Class summary

  • RStoreWriteStream - Supports the writing of a stream to a store.

  • RStoreReadStream - Supports the opening and manipulation of an existing stream in a store.

  • CDirectFileStore - Direct file store.

  • TStreamId - Provides unique identification for stream within a store.

  • TSwizzle - Maintains a dual representation for an object.

WriteToEmbedded: using an embedded store

Description

This example shows how an object can be externalized to a store embedded within a permanent file store.

Download

Download the example: WriteToEmbedded.zip.

Download some additional files required by the example: CommonFramework.zip.

View the source code: browse. View the additional files: browse

Class summary

  • RStoreWriteStream - Supports the writing of a stream to a store.

  • RStoreReadStream - Supports the opening and manipulation of an existing stream in a store.

  • CPermanentFileStore - Permanent file store.

  • TStreamId - Provides unique identification for stream within a store.

  • CEmbeddedStore - Encapsulates an embedded store.

  • CPersistentStore - Persistent store abstract base class. It provides the behaviour for setting and retrieving the root stream id.

StoreMap: using a store map

Description

This example demonstrates the streaming of a compound object to multiple streams with deferred loading. It also illustrates the use of a store map (CStoreMap).

Related APIs

  • CStoreMap - Store map used when externalizing swizzled in-memory objects.

Download

Download the example: StoreMap.zip.

Download some additional files required by the example: CommonFramework.zip.

View the source code: browse. View the additional files: browse.

Class summary