Skip to content

TStaticVector<T, TStorage>

A resizable container with compile-time fixed static capacity and contiguous inplace storage.

Definition

Unit: Neslib.Iceoryx2.Containers

type TStaticVector<T, TStorage> = record ... end;

Type Parameters

T: The type of the items in the vector

TStorage:

Remarks

The layout of this record is compatible with its C++ and Rust counterparts, so it can be used for cross-language communication.

Nested Types

Name Description
P

Properties

Name Description
Count Retrieves the number of items in the vector.
Items Gets or sets an item in the vector.
Refs Gets a reference to an item in the vector.

Methods

Name Description
Init Initializes the vector. This must be called before performing any other operations.
ToString Returns a string-presentation of the vector for debugging purposes
TryAdd Attempts to insert a single AValue at the back of the vector. This function will copy the input value into place.

Property Descriptions

Count

Retrieves the number of items in the vector.

property Count: Int64 read FSize

Type: Int64


Items

Gets or sets an item in the vector.

property Items[const AIndex: Int64]: T read GetItem write SetItem; default

Type: T

Remarks

AIndex must be between 0 and Count-1. This is checked with an assertion.


Refs

Gets a reference to an item in the vector.

property Refs[const AIndex: Int64]: P read GetRef

Type: P

Remarks

AIndex must be between 0 and Count-1. This is checked with an assertion.


Method Descriptions

Init

Initializes the vector. This must be called before performing any other operations.

procedure Init; inline


ToString

Returns a string-presentation of the vector for debugging purposes

function ToString: String

Returns

String


TryAdd(T)

Attempts to insert a single AValue at the back of the vector. This function will copy the input value into place.

function TryAdd(const AValue: T): Boolean

Parameters

AValue: T

Returns

Boolean: True on success, False if there is no room left.