File: testq_class.m

package info (click to toggle)
mwrap 1.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 980 kB
  • sloc: cpp: 3,271; ansic: 856; makefile: 252; lex: 233; sh: 2
file content (24 lines) | stat: -rw-r--r-- 439 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
% testq_class.m
%   Test case / demo of MWrap bindings to a C++ event queue class.
%
% Copyright (c) 2007  David Bindel
% See the file COPYING for copying permissions

if ~exist('isobject')
  fprintf('MATLAB object system not supported\n');
  return;
end

q = eventq();

push(q, 1, 1.5);
push(q, 2, 0.4);
push(q, 3, 10);
push(q, [4, 5], [8, 11]);

while ~empty(q)
  [id,t] = pop(q);
  fprintf('Time %g: Saw %d\n', t, id);
end

destroy(q);