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;
Protected FMinRow: NativeInt;
Protected FMaxLayer: NativeInt;
Protected FMinLayer: NativeInt;
Protected FMaxCol: NativeInt;
Protected FMaxRow: NativeInt;
Protected FMinCol: NativeInt;

Methods

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

Properties

Public property IsValue[constLayer,Row,Col:NativeInt]: boolean read GetIsValue write SetIsValue;
Public property Items[constLayer,Row,Col:NativeInt]: Pointer read GetItems write SetItems;
Public property MinLayer: NativeInt read FMinLayer;
Public property MaxLayer: NativeInt read FMaxLayer;
Public property MinRow: NativeInt read FMinRow;
Public property MaxRow: NativeInt read FMaxRow;
Public property MinCol: NativeInt read FMinCol;
Public property MaxCol: NativeInt read FMaxCol;

Description

Fields

Private FData: TSparsePointerArray;

FData is used to hold pointers to T2DSparsePointerArrays.

Private FQuantum: TSPAQuantum;

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

Protected FMinRow: NativeInt;
 
Protected FMaxLayer: NativeInt;
 
Protected FMinLayer: NativeInt;
 
Protected FMaxCol: NativeInt;
 
Protected FMaxRow: NativeInt;
 
Protected FMinCol: NativeInt;
 

Methods

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

See IsValue.

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

See Items.

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

See IsValue.

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

See Items.

Protected procedure UpdateMinMaxPositions(const Col, Row, Layer: NativeInt);
 
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[constLayer,Row,Col:NativeInt]: 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[constLayer,Row,Col:NativeInt]: Pointer read GetItems write SetItems;

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

Public property MinLayer: NativeInt read FMinLayer;
 
Public property MaxLayer: NativeInt read FMaxLayer;
 
Public property MinRow: NativeInt read FMinRow;
 
Public property MaxRow: NativeInt read FMaxRow;
 
Public property MinCol: NativeInt read FMinCol;
 
Public property MaxCol: NativeInt read FMaxCol;
 

Generated by PasDoc 0.12.1 on 2013-05-13 15:42:04