Class TAdBufferBucket

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TAdBufferBucket = class(TObject)

Description

TAdBufferBucket represents a single buffer bucket in the buffer bucket list. Buffer buckets are used to seperate the memory into serveral sections, in order to reorder the buckets. Data is read from the bucket until it is "empty". If the bucket is empty, it may be refilled and added to the buffer queue/list again. Every bucket may contain a differtent amout of data.

See also
TAdBufferBucketList
TAdBufferBucketList is a list class that contains serveral TAdBufferBucket elements.

Hierarchy

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public procedure WriteData(ABuf: PByte; ASize: Integer);
Public function ReadData(ABuf: PByte; ASize: Integer): Integer;
Public function Seek(AOffset: integer): integer;

Properties

Public property IsFree: boolean read FIsFree;
Public property FilledSize: Integer read FFilledSize;
Public property Tag: Cardinal read FTag write FTag;
Public property Position: int64 read FPosition write FPosition;
Public property ReadPos: Integer read FReadPos;
Public property DataSize: integer read FDataSize;

Description

Methods

Public constructor Create;

Creates an instance of TAdBufferBucket.

Public destructor Destroy; override;

Destroys the instance of TAdBufferBucket and frees all reserved memory.

Public procedure WriteData(ABuf: PByte; ASize: Integer);

Writes data to the bucket. The memory of the bucket is enlarged, if size is bigger than the last size.

Public function ReadData(ABuf: PByte; ASize: Integer): Integer;

Reads data from the bucket. Returns the count of bytes that were actually read from the bucket. Every call of ReadData increments a internal pointer, so that the next call will read the data from that position.

Public function Seek(AOffset: integer): integer;

Seeks the internall read pointer of the bucket forward or backward.

Properties

Public property IsFree: boolean read FIsFree;

Returns whether all data from the item has been read.

Public property FilledSize: Integer read FFilledSize;

Returns the count of bytes that are still in the bucket. "FilledSize" gets decremented with each call of "ReadData".

Public property Tag: Cardinal read FTag write FTag;

May contain a user defined tag. This tag may be usefull if you want to use the buffer in a audio application to store the current position of this element.

Public property Position: int64 read FPosition write FPosition;

Position is used internally by the buffer classes for seeking and contains the byte position of the buffer bucket since the last "Clear".

Public property ReadPos: Integer read FReadPos;

Specifies the position of the internal read pointer.

Public property DataSize: integer read FDataSize;

The size of the data that was written to the bucket with the last write access.

SourceForge.net Logo


Generated by PasDoc 0.11.0 on 2008-12-31 14:31:58