<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=069340422-20112006><FONT face=Arial color=#0000ff size=2>The
default implementation of accept is Depth-First: </FONT></SPAN></DIV>
<DIV><SPAN class=069340422-20112006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN><SPAN class=069340422-20112006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=069340422-20112006><FONT face=Arial color=#0000ff
size=2> void ModelImpl::accept( Visitor* pVisitor
)<BR> {<BR> FCOSet children =
getChildFCOsI();<BR> for ( FCOSet::iterator it = children.begin() ;
it != children.end() ; it++ )<BR> (*it)->accept( pVisitor
);<BR> pVisitor->visitModel( Model( this )
);<BR> }<BR></FONT></SPAN></DIV>
<DIV><SPAN class=069340422-20112006><FONT face=Arial color=#0000ff
size=2>Children are visited first, then parent.</FONT></SPAN></DIV>
<DIV><SPAN class=069340422-20112006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=069340422-20112006><FONT face=Arial color=#0000ff size=2>If
you'd like another way of traversal: you can override
accept.</FONT></SPAN></DIV>
<DIV><SPAN class=069340422-20112006><FONT face=Arial color=#0000ff size=2>(I
have heard opinions that making assumptions about the traversal order
is superfluous or bad, however your custom visitor could be speeded up
by introducing some order. )</FONT></SPAN></DIV>
<DIV><SPAN class=069340422-20112006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=069340422-20112006><FONT face=Arial color=#0000ff
size=2>Zoli</FONT></SPAN></DIV>
<DIV><SPAN class=069340422-20112006><FONT face=Arial color=#0000ff
size=2> </DIV></FONT></SPAN>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
gme-users-bounces@list.isis.vanderbilt.edu
[mailto:gme-users-bounces@list.isis.vanderbilt.edu] <B>On Behalf Of </B>Joe
Porter<BR><B>Sent:</B> Monday, November 20, 2006 4:03 PM<BR><B>To:</B>
gme-users<BR><B>Subject:</B> [gme-users] BON Visitor
Question<BR><BR></FONT></DIV>In BON2, when I implement a Visitor class and
pass it to a model, can I make any assumptions about the order of traversal of
the sub-parts (i.e. depth-first vs. breadth-first), or is it generally a bad
idea to make any assumptions about that interface?
<BR><BR>Thanks,<BR>-Joe<BR><BR></BLOCKQUOTE></BODY></HTML>