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 {
41 } gfsmArcIter;
42 
43 /*======================================================================
44  * Methods: Arc iterators: open/close
45  */
47 
48 
59 void gfsm_arciter_open(gfsmArcIter *aip, gfsmAutomaton *fsm, gfsmStateId stateid);
60 
65 void gfsm_arciter_open_ptr(gfsmArcIter *aip, gfsmAutomaton *fsm, gfsmState *stateptr);
66 
76 
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  */
101 
103 
104 /*======================================================================
105  * Methods: Arc iterators: Accessors
106  */
108 
109 
115 gboolean gfsm_arciter_ok(const gfsmArcIter *aip);
116 
121 void gfsm_arciter_next(gfsmArcIter *aip);
122 
128 
143 
150 
151 
160 
169 
180 
192 
194 typedef gboolean (*gfsmArcIterSeekFunc) (gfsmArcIter *aip, gpointer data);
195 
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