Skip to content
Snippets Groups Projects
queue.m 935 B
Newer Older
function queue = queue(varargin)
%HASHTABLE Constructor for LIFO queue class
%   q  = queue    - Default constructor, empty queue table
%   mq = queue(q) - Copy constructor 

% $Id$

% todos: define maxSize dimension
% if nargin == 1 && isa(varargin{1},'integer')
%   q.maxSize = varargin{1};
% end
% and test maxSize in push

% copy constructor
% ----------------
  queue = varargin{1};
  return;
    
% default constructor
% -------------------

  % number of object stored in queue 
  % --------------------------------
  q.index = 0;
  
  % objects
  % -------
  q.data = [];
  
  % last object extract from pop and dispose with get
  % -------------------------------------------------
  q.lifo = [];
  
  error('queue:queue', 'Invalid arguments.');