Iterate over outgoing arcs of an automaton state.
More...
#include <gfsmAutomaton.h>
#include <gfsmArcIter.hi>
Go to the source code of this file.
Arc Iterators: Accessors |
typedef gboolean(* | gfsmArcIterSeekFunc )(gfsmArcIter *aip, gpointer data) |
| Typedef for user-seek functions.
|
static gboolean | gfsm_arciter_ok (const gfsmArcIter *aip) |
static void | gfsm_arciter_next (gfsmArcIter *aip) |
static void | gfsm_arciter_reset (gfsmArcIter *aip) |
static gfsmArc * | gfsm_arciter_arc (const gfsmArcIter *aip) |
static void | gfsm_arciter_remove (gfsmArcIter *aip) |
void | gfsm_arciter_seek_lower (gfsmArcIter *aip, gfsmLabelVal lo) |
void | gfsm_arciter_seek_upper (gfsmArcIter *aip, gfsmLabelVal hi) |
void | gfsm_arciter_seek_both (gfsmArcIter *aip, gfsmLabelVal lo, gfsmLabelVal hi) |
void | gfsm_arciter_seek_all (gfsmArcIter *aip, gfsmLabelVal lo, gfsmLabelVal hi, gfsmStateId dst) |
void | gfsm_arciter_seek_user (gfsmArcIter *aip, gfsmArcIterSeekFunc seekfunc, gpointer data) |
Detailed Description
Typedef Documentation
typedef gboolean(* gfsmArcIterSeekFunc)(gfsmArcIter *aip, gpointer data) |
Function Documentation
Open a gfsmArcIter aip for the outgoing arcs from state with ID qid in the automaton fsm.
- Parameters
-
aip | Pointer to the gfsmArcIter to be opened; assumed to be already allocated |
fsm | Automaton containing the state whose outgoing arcs are to be opened |
qid | ID of the state whose outgoing arcs are to be opened |
- Note
- Arc iterators may be silently invalidated by destructive operations
- The arc iterator should be closed with gfsm_arciter_close() when it is no longer needed.
- Caller is responsible for allocation and freeing of *aip.
Close a gfsmArcIter aip if already opened, otherwise does nothing.
- Parameters
-
- Note
- If multiple copies of a gfsmArcIter exist, only one needs to be closed.
- Currently does nothing useful; in future versions this function may be required to free temporary allocations, etc.
Copy positional data from src to dst.
- Parameters
-
src | The gfsmArcIter from which to copy positional data |
dst | The gfsmArcIter to which positional data is to be written |
- Note
- Only the position pointed to should be copied by this method, and not the underlying data.
- If you use this method to copy gfsmArcIter positions, you should subsequently call gfsm_arciter_close() on only one of them!
static gboolean gfsm_arciter_ok |
( |
const gfsmArcIter * |
aip | ) |
|
|
inlinestatic |
Check validity of a gfsmArcIter* aip.
- Parameters
-
- Returns
- a true value if aip is considered valid, FALSE otherwise.
Position the gfsmArcIter aip to the next available outgoing arc for which it was opened.
- Parameters
-
Reset an arc iterator to the first outgoing arc for which it was initially opened.
- Parameters
-
Get current arc associated with a :gfsmArcIter, or NULL if none is available.
- Parameters
-
- Returns
- A pointer to the current gfsmArc 'pointed to' by aip, or NULL if no more arcs are available.
- Note
- In future versions, a gfsmAutomaton implementation will be free to return a dynamically generated arc here: there is no general guarantee that modifications to the gfsmArc returned by this function will be propagated to the underlying gfsmAutomaton.
- It is expected to remain the case that for the default automaton implementation class, the arcs returned by this function should be modifiable in-place.
Remove the arc referred to by a gfsmArcIter aip from the associated gfsmAutomaton, and position to the next available arc, if any.
- Parameters
-
aip | The gfsmArcIter whose 'current' arc is to be removed. |
Position an arc-iterator to the current or next arc with lower label lo and upper label hi. If either lo or hi is gfsmNoLabel, no matching will be performed on the corresponding arc label(s).
- Parameters
-
- Note
- Default implementation wraps gfsm_arciter_ok(), gfsm_arciter_next() and gfsm_arciter_arc() in a linear search from the current position.
Position an arc-iterator to the current or next arc with lower label lo, upper label hi, and sink-state dst. If either lo or hi is gfsmNoLabel, no matching will be performed on the corresponding arc label(s).
- Parameters
-
- Note
- Default implementation wraps gfsm_arciter_ok(), gfsm_arciter_next() and gfsm_arciter_arc() in a linear search from the current position.
Position an arc-iterator to the next arc for which (*seekfunc)(arciter,data) returns TRUE.
- Note
- Just wraps gfsm_arciter_ok() and gfsm_arciter_next() in a linear search from the current position.