Phoenix Logo

phoenix_title wx.lib.pubsub.core.topictreetraverser.TopicTreeTraverser

Supports taking action on every topic in the topic tree. The traverse() method traverses a topic tree and calls visitor._onTopic() for each topic in the tree that satisfies visitor._accept(). Additionally it calls visitor._startChildren() whenever it starts traversing the subtopics of a topic, and visitor._endChildren() when it is done with the subtopics. Finally, it calls visitor._doneTraversal() when traversal has been completed. The visitor must therefore adhere to the ITopicTreeVisitor interface.


class_hierarchy Class Hierarchy

Inheritance diagram for class TopicTreeTraverser:


method_summary Methods Summary

__init__ The visitor, if given, must adhere to API of
setVisitor The visitor must adhere to API of ITopicTreeVisitor.
traverse Start traversing tree at topicObj. Note that topicObj is a

api Class API



class TopicTreeTraverser

Supports taking action on every topic in the topic tree. The traverse() method traverses a topic tree and calls visitor._onTopic() for each topic in the tree that satisfies visitor._accept(). Additionally it calls visitor._startChildren() whenever it starts traversing the subtopics of a topic, and visitor._endChildren() when it is done with the subtopics. Finally, it calls visitor._doneTraversal() when traversal has been completed. The visitor must therefore adhere to the ITopicTreeVisitor interface.


Methods



__init__(self, visitor = None)

The visitor, if given, must adhere to API of ITopicTreeVisitor. The visitor can be changed or set via setVisitor(visitor) before calling traverse().



setVisitor(self, visitor)

The visitor must adhere to API of ITopicTreeVisitor.



traverse(self, topicObj, how=DEPTH, onlyFiltered=True)

Start traversing tree at topicObj. Note that topicObj is a Topic object, not a topic name. The how defines if tree should be traversed breadth or depth first. If onlyFiltered is False, then all nodes are accepted (_accept(node) not called).

This method can be called multiple times.