.. 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

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>TopicTreeTraverser</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.pubsub.core.topictreetraverser.TopicTreeTraverser_inheritance.png" alt="Inheritance diagram of TopicTreeTraverser" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.pubsub.core.topictreetraverser.TopicTreeTraverser.html" title="wx.lib.pubsub.core.topictreetraverser.TopicTreeTraverser" alt="" coords="5,5,393,35"/> </map> 
   </p>
   </div>

|


|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.


