#include <iokernel/walker.h>
Class diagram for Walker:

Public Members | |
| enum | ApplyStatus { Continue, Stop, Abort, Truncate, Replaced } |
| Status codes that can be returned by the operator(). More... | |
| Walker (SuifEnv *the_env) | |
| virtual | ~Walker () |
| In case subclasses want to delete something. | |
| virtual ApplyStatus | operator() (Address address, const MetaClass *_meta) = 0 |
| Called by the walker to perform action on the data in address. More... | |
| virtual bool | is_walkable (Address address, bool is_owned, const MetaClass *_meta) |
| Determine if the tree rooted at the address should be walked Default implementation returns true iff is_owned is true. More... | |
| virtual bool | is_visitable (Address address, const MetaClass *_meta) const |
| Determine if operator() should be called on the data in address. More... | |
| void | set_post_order () |
| Set the order of walking to post_order. More... | |
| void | set_pre_order () |
| Set the order of walking to pre_order, which is the default. | |
| bool | get_is_pre_order () const |
| Get the order of walking. More... | |
| void | set_address (Address new_address) |
| Address | get_address () const |
| SuifEnv* | get_env () const |
| void | set_parent (Address addr) |
| Address | get_parent () const |
| virtual bool | get_makes_changes () const |
| It is possible for nodes to be replaced during a walk. More... | |
| virtual bool | is_changed (Address addr) const |
| Should the node be ignored because it has been deleted or changed? This exists so that we do not need to try to develop the real meta class for a deleted object. More... | |
This class is abstract. Generally, you will want to derive from SuifWalker found in suifkernel/suif_walker.h. The normal use of walkers is described in that file.
Status codes that can be returned by the operator().
The internal status should not be modified by the operator code.
Enumeration values:
Continue iteration.
Stop iteration, normal termination.
Stop with error condition.
Do not walk sub-objects of this object (pre-order only).
Object has been replaced with a new object.
You must set the address of the new object by calling set_address before returning.
[virtual]In case subclasses want to delete something.
[pure virtual]Called by the walker to perform action on the data in address.
Subclass must overwrite this method.
Reimplemented in SuifWalker.
[virtual]Determine if the tree rooted at the address should be walked Default implementation returns true iff is_owned is true.
You can, for example, return false if you know that a node of interest cannot be contained inside a given node.
Notice the difference to is_visitable. The latter determines if the function operator should be called on a given node. This function controls walking of an entire subtree.
Reimplemented in ReplacingWalker, and AllWalker.
[virtual]Determine if operator() should be called on the data in address.
Default implementation always true.
Reimplemented in SuifWalker, and SelectiveWalker.
Set the order of walking to post_order.
Default is pre_order.
Set the order of walking to pre_order, which is the default.
Get the order of walking.
[virtual]It is possible for nodes to be replaced during a walk.
This is important when walking lists, as the contents of the list can change while the list is being walked.
So, if changes can occur, we must copy the list before walking it. get_makes_changes returns true if a walker changes the tree.
Reimplemented in ReplacingWalker.
[virtual]Should the node be ignored because it has been deleted or changed? This exists so that we do not need to try to develop the real meta class for a deleted object.
Doing that will cause a seg fault
Reimplemented in ReplacingWalker.
written by Dimitri van Heesch, © 1997-1999