Main Page
Related Pages
Data Structures
Files
File List
Globals
src
libgfsm
gfsmArcIter.h
Go to the documentation of this file.
1
2
/*=============================================================================*\
3
* File: gfsmArcIter.h
4
* Author: Bryan Jurish <moocow.bovine@gmail.com>
5
* Description: finite state machine library: arc iterators
6
*
7
* Copyright (c) 2004-2011 Bryan Jurish.
8
*
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Lesser General Public
11
* License as published by the Free Software Foundation; either
12
* version 3 of the License, or (at your option) any later version.
13
*
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Lesser General Public License for more details.
18
*
19
* You should have received a copy of the GNU Lesser General Public
20
* License along with this library; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
*=============================================================================*/
23
28
#ifndef _GFSM_ARCITER_H
29
#define _GFSM_ARCITER_H
30
31
#include <
gfsmAutomaton.h
>
32
33
/*======================================================================
34
* Types: Arc iterators
35
*/
37
typedef
struct
{
38
gfsmAutomaton
*
fsm
;
39
gfsmState
*
state
;
40
gfsmArcList
*
arcs
;
41
}
gfsmArcIter
;
42
43
/*======================================================================
44
* Methods: Arc iterators: open/close
45
*/
47
48
58
GFSM_INLINE
59
void
gfsm_arciter_open
(
gfsmArcIter
*aip,
gfsmAutomaton
*fsm,
gfsmStateId
stateid);
60
64
GFSM_INLINE
65
void
gfsm_arciter_open_ptr
(
gfsmArcIter
*aip,
gfsmAutomaton
*fsm,
gfsmState
*stateptr);
66
74
GFSM_INLINE
75
void
gfsm_arciter_close
(
gfsmArcIter
*aip);
76
87
GFSM_INLINE
88
gfsmArcIter
*
gfsm_arciter_copy
(
gfsmArcIter
*dst,
const
gfsmArcIter
*src);
89
90
/* Create and return a new (shallow) copy of a ::gfsmArcIter.
91
* \param src The ::gfsmArcIter whose positional data is to be duplicated.
92
* \note
93
* \li Only the position pointed to should be copied by this method,
94
* and not the underlying data.
95
* \li If you use this method to copy ::gfsmArcIter positions,
96
* you should subsequently call gfsm_arciter_close() on only
97
* \e one of them!
98
*/
99
GFSM_INLINE
100
gfsmArcIter
*
gfsm_arciter_clone
(
const
gfsmArcIter
*src);
101
103
104
/*======================================================================
105
* Methods: Arc iterators: Accessors
106
*/
108
109
114
GFSM_INLINE
115
gboolean
gfsm_arciter_ok
(
const
gfsmArcIter
*aip);
116
120
GFSM_INLINE
121
void
gfsm_arciter_next
(
gfsmArcIter
*aip);
122
126
GFSM_INLINE
127
void
gfsm_arciter_reset
(
gfsmArcIter
*aip);
128
141
GFSM_INLINE
142
gfsmArc
*
gfsm_arciter_arc
(
const
gfsmArcIter
*aip);
143
148
GFSM_INLINE
149
void
gfsm_arciter_remove
(
gfsmArcIter
*aip);
150
151
159
void
gfsm_arciter_seek_lower
(
gfsmArcIter
*aip,
gfsmLabelVal
lo);
160
168
void
gfsm_arciter_seek_upper
(
gfsmArcIter
*aip,
gfsmLabelVal
hi);
169
179
void
gfsm_arciter_seek_both
(
gfsmArcIter
*aip,
gfsmLabelVal
lo,
gfsmLabelVal
hi);
180
191
void
gfsm_arciter_seek_all
(
gfsmArcIter
*aip,
gfsmLabelVal
lo,
gfsmLabelVal
hi,
gfsmStateId
dst);
192
194
typedef
gboolean (*
gfsmArcIterSeekFunc
) (
gfsmArcIter
*aip, gpointer data);
195
201
void
gfsm_arciter_seek_user
(
gfsmArcIter
*aip,
202
gfsmArcIterSeekFunc
seekfunc,
203
gpointer data);
204
205
207
208
//-- inline definitions
209
#ifdef GFSM_INLINE_ENABLED
210
# include <gfsmArcIter.hi>
211
#endif
212
213
#endif
/* _GFSM_ARCITER_H */
214
Generated on Tue Oct 21 2014 09:44:47 for libgfsm by
1.8.1.2