ACT Library
Loading...
Searching...
No Matches
iter.h
Go to the documentation of this file.
1/*************************************************************************
2 *
3 * This file is part of the ACT library
4 *
5 * Copyright (c) 2018-2019 Rajit Manohar
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 **************************************************************************
23 */
24#ifndef __ITER_H__
25#define __ITER_H__
26
27#include <act/namespaces.h>
28#include <iterator>
29
30#define ACTSTDITER(name,rettype) \
31 name (const name & c); \
32 name& operator=(const name & c) = default; \
33 name& operator++(); \
34 name operator++(int); \
35 bool operator==(const name& rhs) const; \
36 bool operator!=(const name& rhs) const; \
37 rettype operator*(); \
38 name begin(); \
39 name end()
40
41
61#if __cplusplus < 201703L
62/* deprecated in C++17 onward */
63 : public std::iterator<std::input_iterator_tag, ActNamespace *>
64#endif
65{
66 hash_bucket_t *b;
67 int i;
69
70 public:
71#if __cplusplus >= 201703L
72 using iterator_category = std::input_iterator_tag;
73 using value_type = ActNamespace *;
74#endif
75
78};
79
80
92#if __cplusplus < 201703L
93 : public std::iterator<std::input_iterator_tag, ValueIdx *>
94#endif
95{
96 hash_bucket_t *b;
97 int i;
99
100 public:
101#if __cplusplus >= 201703L
102 using iterator_category = std::input_iterator_tag;
103 using value_type = ValueIdx *;
104#endif
105
108};
109
121#if __cplusplus < 201703L
122 : public std::iterator<std::input_iterator_tag, act_connection *>
123#endif
124{
127
128 public:
129#if __cplusplus >= 201703L
130 using iterator_category = std::input_iterator_tag;
131 using value_type = act_connection *;
132#endif
133
136};
137
150#if __cplusplus < 201703L
151 : public std::iterator<std::input_iterator_tag, Type *>
152#endif
153{
154 hash_bucket_t *b;
155 int i;
157
158 public:
159#if __cplusplus >= 201703L
160 using iterator_category = std::input_iterator_tag;
161 using value_type = Type *;
162#endif
163
166};
167
183#if __cplusplus < 201703L
184 : public std::iterator<std::input_iterator_tag, ValueIdx *>
185#endif
186{
187 hash_bucket_t *b;
188 int i;
190
191 public:
192#if __cplusplus >= 201703L
193 using iterator_category = std::input_iterator_tag;
194 using value_type = ValueIdx *;
195#endif
196
199};
200
201
202#undef ACTSTDITER
203
204
205#endif /* __ITER_H__ */
206
This is an iterator that, when passed an act_connection pointer, allows you to iterate through all th...
Definition: iter.h:124
ACTSTDITER(ActConniter, act_connection *)
act_connection * cur
Definition: iter.h:126
act_connection * start
Definition: iter.h:125
ActConniter(act_connection *s)
This is an iterator that, when passed a Scope pointer, allows you to iterate through all instances wi...
Definition: iter.h:95
int i
Definition: iter.h:97
ActInstiter(Scope *s)
hash_bucket_t * b
Definition: iter.h:96
Scope * s
Definition: iter.h:98
ACTSTDITER(ActInstiter, ValueIdx *)
The ActNamespace class holds all the information about a namespace.
Definition: namespaces.h:469
This is an iterator that, when passed an ActNamespace pointer, allows you to iterate through nested n...
Definition: iter.h:65
int i
Definition: iter.h:67
ActNamespace * top
Definition: iter.h:68
hash_bucket_t * b
Definition: iter.h:66
ACTSTDITER(ActNamespaceiter, ActNamespace *)
ActNamespaceiter(ActNamespace *ns)
This is an iterator that, when passed an ActNamespace pointer, allows you to iterate through all user...
Definition: iter.h:153
hash_bucket_t * b
Definition: iter.h:154
ACTSTDITER(ActTypeiter, Type *)
int i
Definition: iter.h:155
ActTypeiter(ActNamespace *s)
ActNamespace * top
Definition: iter.h:156
This is an iterator that, when passed a Scope pointer, allows you to iterate through all the uinque p...
Definition: iter.h:186
hash_bucket_t * b
Definition: iter.h:187
Scope * s
Definition: iter.h:189
ActUniqProcInstiter(Scope *s)
ACTSTDITER(ActUniqProcInstiter, ValueIdx *)
int i
Definition: iter.h:188
This is the data structure that holds all instances and their associated types within a scope....
Definition: namespaces.h:77
The abstract base class for all types in the system.
Definition: basetype.h:45
This class is used to create an instance in a scope. The name comes from the fact that this is used t...
Definition: value.h:342
Connections.
Definition: value.h:113
This contains the defintions of the ActNamespace class as well as the Scope classes....