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);
76 virtual void *pop(void);
77 virtual void *top(void);
80 virtual void set_limit(t_index alimit);
82 void free_at(t_index index);
83 void disconn_at(t_index index);
84 void disconn(void *item);
85 void disconn_all(void);
87 void add_at(t_index index, void *item);
88 void put_at(t_index index, void *item);
89 virtual t_index add(void *item);
90 virtual void push(void *item);
92 void *first_that(match_func test, void *arg);
93 void *last_that(match_func test, void *arg);
94 void for_each(iterator_func action, void *arg);
96 void error(t_index code, t_index info);
98 virtual void free_item(void *item);
103 ==========================================================================#
105 ==========================================================================#
109 class cl_sorted_list: public cl_list
114 cl_sorted_list(t_index alimit, t_index adelta);
115 virtual ~cl_sorted_list(void);
117 virtual bool search(void *key, t_index& index);
118 virtual t_index index_of(void *item);
119 virtual t_index add(void *item);
120 virtual void *key_of(void *item);
122 virtual int compare(void *key1, void *key2)= 0;
127 ==========================================================================#
129 ==========================================================================#
133 class cl_strings: public cl_sorted_list
136 cl_strings(t_index alimit, t_index adelta);
137 virtual ~cl_strings(void);
140 virtual int compare(void *key1, void *key2);
141 virtual void free_item(void *item);
146 ==========================================================================#
148 ==========================================================================#
152 class cl_ustrings: public cl_strings
155 cl_ustrings(t_index alimit, t_index adelta);
156 virtual ~cl_ustrings(void);
159 virtual int compare(void *key1, void *key2);
160 virtual bool search(void *key, t_index &index);