DDiterator Class Reference#include <DDgraph.h>
List of all members.
|
Public Member Functions |
| | DDiterator (RefList< Statement > *from_stmts, RefList< Statement > *to_stmts, DDgraph &ddgraph) |
| | The ownership of both RefLists is transfered to DDiterator.
|
| | DDiterator (const Statement &from_stmt, const Expression &from_expr, const Statement &to_stmt, const Expression &to_expr, DDgraph &ddgraph) |
| | DDiterator (RefList< Statement > *from_stmts, const Statement &to_stmt, const Expression &to_expr, DDgraph &ddgraph) |
| | DDiterator (const Statement &from_stmt, const Expression &from_expr, RefList< Statement > *to_stmts, DDgraph &ddgraph) |
| | DDiterator (const DDiterator &other) |
| | This method copies the entire state (including current arc) of the iterator.
|
| | ~DDiterator () |
| | Release the current DVfield on exiting.
|
| Boolean | valid () |
| Boolean | end () |
| | Used to check if there are more Nodes to iterate on.
|
| DVfield & | current () |
| | CC 06/15/98.
|
| ActiveArc * | current_arc () |
| | CC end.
|
| Boolean | current_valid () |
| Boolean | current_invalid () |
| | tells whether or not this node is valid
|
| DVfield * | grab () |
| | Grab the current element after deleting or invalidating it from the list.
|
| void | modify (DVfield *other) |
| | Subsititude new_dv_field for the DVfield currently pointed by iterator.
|
| void | del () |
| | Move operations: reset, set_to_last, next, prev, ++, -- -> When an iterator leaves one arc for another, the list DVfields will be overwritten to the old arc in a compacted form subject to its modification in the arc.
|
| void | reset () |
| void | set_to_last () |
| | void prev();
|
| void | operator-- () |
| | void next();
|
| void | operator++ () |
| | Go to the next valid arc.
|
Friends |
| class | DDgraphTester |
| | < DDiterator is initialized by one of the following options; (2 Statement lists) -> from-statements vs.
|
Constructor & Destructor Documentation
| DDiterator::DDiterator |
( |
const DDiterator & |
other |
) |
|
|
|
|
This method copies the entire state (including current arc) of the iterator.
If you don't like this, then immediately follow this constructor with a call to reset()
Definition at line 1910 of file DDgraph.cc.
References _STMTS. |
Member Function Documentation
| Boolean DDiterator::valid |
( |
|
) |
[inline] |
|
| Boolean DDiterator::end |
( |
|
) |
[inline] |
|
|
|
Used to check if there are more Nodes to iterate on.
If yes, then valid() returns TRUE, else FALSE. end() is equivalent to NOT valid().
Definition at line 1255 of file DDgraph.h.
References valid(). |
| DVfield & DDiterator::current |
( |
|
) |
[inline] |
|
|
|
CC 06/15/98.
If there is no current, this results in an error. This is always suppposed to return VALID node, since every invalid node will be automatically skipped.
Definition at line 1261 of file DDgraph.h.
References current_valid(). |
| ActiveArc* DDiterator::current_arc |
( |
|
) |
[inline] |
|
| Boolean DDiterator::current_valid |
( |
|
) |
[inline] |
|
| Boolean DDiterator::current_invalid |
( |
|
) |
[inline] |
|
|
|
tells whether or not this node is valid
Even though DDiterator guarantees to return valid node in response to current(), there is still chance for the current node to become invalid by grab() called by the other iterator which shares it. Since accessing any members in invalid object causes an error, checking for validity of the current might be necessary for safety reason.
Definition at line 1275 of file DDgraph.h.
References current_valid(). |
| DVfield * DDiterator::grab |
( |
|
) |
[inline] |
|
| void DDiterator::modify |
( |
DVfield * |
other |
) |
[inline] |
|
| void DDiterator::del |
( |
|
) |
[inline] |
|
|
|
Move operations: reset, set_to_last, next, prev, ++, -- -> When an iterator leaves one arc for another, the list DVfields will be overwritten to the old arc in a compacted form subject to its modification in the arc.
If this DVfield is only one left in the current arc, the arc would also be deleted(invalidated or deallocated). no modification, no overwriting.
Definition at line 1305 of file DDgraph.h.
References current_valid(), and DDgraph::mark_dead().
Referenced by DDgraphTester::del_current(). |
| void DDiterator::reset |
( |
|
) |
|
|
|
|
... Case: from_part -> _STMTS, to_part -> _STMTS
... Search the first valid from_expr
... _OUT_REFS
... Traverse is done
... Case: from_part -> _EXPR, to_part -> _STMTS
... Case: from_part -> _STMTS, to_part -> _EXPR
... Case: from_part -> _EXPR, to_part -> _EXPR
Definition at line 2006 of file DDgraph.cc.
References _FIRST, _IN_REFS, _OUT_REFS, _STMTS, DDgraph::compute_dvf_n_arc(), Iterator< T >::current(), Iterator< T >::end(), DDgraph::exit(), Statement::in_refs(), Statement::out_refs(), and Iterator< T >::reset().
Referenced by DDgraphTester::reset(). |
| void DDiterator::set_to_last |
( |
|
) |
|
|
|
|
void prev();
Moving to the last might be useful if you need to iterator backwards
Definition at line 2091 of file DDgraph.cc.
References _IN_REFS, _LAST, _OUT_REFS, _STMTS, DDgraph::compute_dvf_n_arc(), Iterator< T >::current(), Iterator< T >::end(), DDgraph::exit(), Statement::in_refs(), Statement::out_refs(), Iterator< T >::reset(), and Iterator< T >::set_to_last().
Referenced by DDgraphTester::set_to_last(). |
| void DDiterator::operator-- |
( |
|
) |
|
|
|
|
void next();
... at the front end or dangling postion
... Case: from_part -> _STMTS, to_part -> _STMTS
... Case: from_part -> _EXPR, to_part -> _STMTS
... Case: from_part -> _STMTS, to_part -> _EXPR
... Case: from_part -> _EXPR, to_part -> _EXPR ... (Nothing else to do)
Definition at line 1942 of file DDgraph.cc.
References _STMTS, and DDgraph::prev(). |
| void DDiterator::operator++ |
( |
|
) |
|
|
|
|
Go to the next valid arc.
... At the end or dangling position
... Case: from_part -> _STMTS, to_part -> _STMTS
... Case: from_part -> _EXPR, to_part -> _STMTS
... Case: from_part -> _STMTS, to_part -> _EXPR
... Case: from_part -> _EXPR, to_part -> _EXPR ... (Nothing else to do)
Definition at line 1974 of file DDgraph.cc.
References _STMTS, and DDgraph::next(). |
Friends And Related Function Documentation
|
|
< DDiterator is initialized by one of the following options; (2 Statement lists) -> from-statements vs.
to-statements (2 pairs of a Statement & an Expression) -> dependency for two expressions where each lives in its partner statement, respectively
--> A statement list must be RefList and is for randomly selected statements to update/query their dependency information.
Definition at line 610 of file DDgraph.h. |
The documentation for this class was generated from the following files:
|