-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIRContext.m
27 lines (26 loc) · 1.04 KB
/
IRContext.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
%% Copyright (c) 2019-2019, Yichao Yu <[email protected]>
%
% This library is free software; you can redistribute it and/or
% modify it under the terms of the GNU Lesser General Public
% License as published by the Free Software Foundation; either
% version 3.0 of the License, or (at your option) any later version.
% This library is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
% Lesser General Public License for more details.
% You should have received a copy of the GNU Lesser General Public
% License along with this library.
classdef IRContext < handle
%% This is a simple class to give each IRNode an ID.
% I cannot find a way to build a object ID dict in matlab so the ID
% is used to identify nodes.
properties(Access=private)
counter = int64(0);
end
methods
function res = next_id(self)
res = self.counter;
self.counter = res + 1;
end
end
end