Package Buffers Overview

Allows any value type (a T class) to be encapsulated as a descriptor, for the purpose of inter-thread data transfer.

Architectural relationships

The Client/Server API expects data that is to be passed between threads to be encapsulated in a descriptor. Package buffers provide a generic way for the thread providing the data to do this. The thread receiving the data extracts the original data from the package.

APIs with client/server architectures, such as telephony and Messaging, define specialised package buffer types that encapsulate the particular data types that they require to pass between threads.

Description

The API has two key concepts: package buffer descriptor, and package pointer descriptor.

Package buffer descriptor

The package buffer descriptor creates a new instance of the type to encapsulate and stores it within the descriptor. The interface allows a reference to the encapsulated object to be obtained, so that it can be accessed and modified.

The package buffer descriptor interface is provided by TPckgBuf.

Package pointer descriptor

The package pointer descriptor refers to an already existing object. It is otherwise used in a similar way to the package buffer descriptor.

The package pointer descriptor interface is provided by TPckgC for const objects, and TPckg for non-const objects.

Related concepts