2 * Simulator of microcontrollers (pobjcl.h)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
37 ==========================================================================#
39 ==========================================================================#
47 virtual ~cl_base(void);
49 virtual int init(void);
54 ==========================================================================#
56 ==========================================================================#
60 class cl_list: public cl_base
70 cl_list(t_index alimit, t_index adelta);
71 virtual ~cl_list(void);
73 void *at(t_index index);
74 virtual t_index index_of(void *item);
75 virtual bool index_of(void *item, t_index *idx);
77 virtual void *pop(void);
78 virtual void *top(void);
81 virtual void set_limit(t_index alimit);
83 void free_at(t_index index);
85 void disconn_at(t_index index);
86 void disconn(void *item);
87 void disconn_all(void);
89 void add_at(t_index index, void *item);
90 void put_at(t_index index, void *item);
91 virtual t_index add(void *item);
92 virtual void push(void *item);
94 void *first_that(match_func test, void *arg);
95 void *last_that(match_func test, void *arg);
96 void for_each(iterator_func action, void *arg);
98 void error(t_index code, t_index info);
100 virtual void free_item(void *item);
105 ==========================================================================#
107 ==========================================================================#
111 class cl_sorted_list: public cl_list
116 cl_sorted_list(t_index alimit, t_index adelta);
117 virtual ~cl_sorted_list(void);
119 virtual bool search(void *key, t_index& index);
120 virtual t_index index_of(void *item);
121 virtual t_index add(void *item);
122 virtual void *key_of(void *item);
124 virtual int compare(void *key1, void *key2)= 0;
129 ==========================================================================#
131 ==========================================================================#
135 class cl_strings: public cl_sorted_list
138 cl_strings(t_index alimit, t_index adelta);
139 virtual ~cl_strings(void);
142 virtual int compare(void *key1, void *key2);
143 virtual void free_item(void *item);
148 ==========================================================================#
150 ==========================================================================#
154 class cl_ustrings: public cl_strings
157 cl_ustrings(t_index alimit, t_index adelta);
158 virtual ~cl_ustrings(void);
161 virtual int compare(void *key1, void *key2);
162 virtual bool search(void *key, t_index &index);