.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. currentmodule:: wx.lib.pubsub.core.topictreetraverser
.. highlight:: python
.. _wx.lib.pubsub.core.topictreetraverser.TopicTreeTraverser:
==========================================================================================================================================
|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
=================================
.. raw:: html

Inheritance diagram for class
TopicTreeTraverser:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.pubsub.core.topictreetraverser.TopicTreeTraverser.__init__` The visitor, if given, must adhere to API of
:meth:`~wx.lib.pubsub.core.topictreetraverser.TopicTreeTraverser.setVisitor` The visitor must adhere to API of ITopicTreeVisitor.
:meth:`~wx.lib.pubsub.core.topictreetraverser.TopicTreeTraverser.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.
.. method:: __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().
.. method:: setVisitor(self, visitor)
The visitor must adhere to API of ITopicTreeVisitor.
.. method:: 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.