Class T3DSparsePointerArray

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type T3DSparsePointerArray = class(TObject)

Description

T3DSparsePointerArray acts like a 3D array of pointers. It provides constant time access to its elements through the its Items property. However, when many of the elements are nil, it can use much less memory than an array.

Hierarchy

Overview

Fields

Private FData: TSparsePointerArray;
Private FQuantum: TSPAQuantum;

Methods

Private function GetIsValue(const Layer, Row, Col: Integer): boolean;
Private function GetItems(const Layer, Row, Col: Integer): Pointer;
Private procedure SetIsValue(const Layer, Row, Col: Integer; const Value: boolean);
Private procedure SetItems(const Layer, Row, Col: Integer; const Value: Pointer);
Public procedure Clear; virtual;
Public constructor Create(Quantum: TSPAQuantum);
Public destructor Destroy; override;

Properties

Public property IsValue[const Layer, Row, Col: Integer]: boolean read GetIsValue write SetIsValue;
Public property Items[const Layer, Row, Col: Integer]: Pointer read GetItems write SetItems;

Description

Fields

Private FData: TSparsePointerArray;

FData: TSparsePointerArray; FData is used to hold pointers to T2DSparsePointerArrays.

Private FQuantum: TSPAQuantum;

FQuantum: TSPAQuantum; FQuantum defines the section size. Once allocated, a section can store a number of pointers.

Methods

Private function GetIsValue(const Layer, Row, Col: Integer): boolean;

See IsValue.

Private function GetItems(const Layer, Row, Col: Integer): Pointer;

See Items.

Private procedure SetIsValue(const Layer, Row, Col: Integer; const Value: boolean);

See IsValue.

Private procedure SetItems(const Layer, Row, Col: Integer; const Value: Pointer);

See Items.

Public procedure Clear; virtual;

Clear removes all items from T3DSparsePointerArray.

Public constructor Create(Quantum: TSPAQuantum);

Create creates an instance of T3DSparsePointerArray.

Public destructor Destroy; override;

Destroy destroys the current instance of T3DSparsePointerArray. Do not call Destroy directly. Call Free instead.

Properties

Public property IsValue[const Layer, Row, Col: Integer]: boolean read GetIsValue write SetIsValue;

IsValue can be read to see if the item at (Layer, Row, Col) is non-nil. Setting IsValue at (Layer, Row, Col) to False sets Items[Layer, Row, Col] to nil. Setting IsValue at (Layer, Row, Col) to True has no effect.

Public property Items[const Layer, Row, Col: Integer]: Pointer read GetItems write SetItems;

Items provides access to the pointer stored at location Index1, Index2.


Generated by PasDoc 0.10.0 on 2006-10-31 09:56:46