Main Content

queueLIFO

Class: matlab.DiscreteEventSystem
Namespace: matlab

Define last-in last-out (LIFO) stack storage

Syntax

storage=queueLIFO(entityType,capacity)

Description

storage=queueLIFO(entityType,capacity) defines a LIFO stack storage element. Use this function when implementing the getEntityStorageImpl method.

Input Arguments

expand all

Type of entities that the new storage element works with.

Maximum number of entities that the storage can contain, specified as a double.

Output Arguments

expand all

Stack storage that contains entities and sorts them in a LIFO order.

Examples

expand all

Define LIFO stack storage.

% Define a storage element as a LIFO queue
% - Entities in the queue are sorted in Last-In-First-Out (LIFO) order
% - Queue can store entities of type 'myEntity'
% - Queue can store no more than 25 entities
storage = obj.queueLIFO('myEntity', 25);

Version History

Introduced in R2016a