<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">While I'm a huge advocate for information-hiding and clean APIs, the purpose of this flag is to implement an optimization in GRExprEngine, so this is really a tightly coupled dance between GRExprEngine and the Checker objects. Note that GRExprEngine is already a 'friend' of the Checker class. There's no need for an accessor at all if we basically want it to be a hidden detail between Checker and GRExprEngine. It then doesn't pollute the public interface of Checker.<div><br><div><div><div><div>On Aug 5, 2010, at 6:35 PM, Jordy Rose wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br>I was adhering strictly to information-hiding -- once we're at this point,<br>it's little better than just accessing respondsToCallback directly. But it<br>is simpler. I think I went overboard.<br><br><br>On Fri, 6 Aug 2010 09:31:17 +0800, Zhongxing Xu <<a href="mailto:xuzhongxing@gmail.com">xuzhongxing@gmail.com</a>><br>wrote:<br><blockquote type="cite">Why can't we just do that:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">in Checker.h:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> bool &getCallbackFlag() {<br></blockquote><blockquote type="cite"> return respondsToCallback;<br></blockquote><blockquote type="cite"> }<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">In GRExprEngine.cpp:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+ SaveAndRestore<bool> OldFlag(checker->getCallbackFlag(), true);<br></blockquote><blockquote type="cite"><br></blockquote></span><br class="Apple-interchange-newline"></blockquote></div><br></div></div></div></body></html>