I have tried multiple approaches. <div>The difficulty comes from the fact that each class can have multiple sync/async functions. For example, Enquire has atleast get_mset, get_matching_terms and get_eset.<div>Another problem is that from the pool methods (which should be templatized) I have to call methods from the class (GetMset_process, GetMset_convert, GetMatchingTerm_process, ...). This means that I also probably have to pass a function as a template parameter.</div>
<div>The thirt problem is that func##_pool and func##_done need to be (int (eio_req *req)), so I can not pass a function pointer.</div><div><br></div><div>At the moment I am trying a hybrid approach (bot templates and macroes).  </div>
<div><br><div class="gmail_quote">On Wed, May 16, 2012 at 8:10 PM, Liam <span dir="ltr">&lt;<a href="mailto:xapian@networkimprov.net" target="_blank">xapian@networkimprov.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class="gmail_quote"><div class="im">On Wed, May 16, 2012 at 3:30 AM, Marius Tibeica <span dir="ltr">&lt;<a href="mailto:mtibeica@gmail.com" target="_blank">mtibeica@gmail.com</a>&gt;</span> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br><br><div class="gmail_quote"><div class="im"><div>On Wed, May 16, 2012 at 8:55 AM, Liam <span dir="ltr">&lt;<a href="mailto:xapian@networkimprov.net" target="_blank">xapian@networkimprov.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br></blockquote></div></div><div class="im"><div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>
<br>Did you consider how those macro functions could be templatized?</div></div></blockquote></div><div>Will do.</div></div></div></blockquote><div><br>Alternatively, the DECLARE_POOL methods could possibly live in a base class...<br>

</div></div>
<br>_______________________________________________<br>
Xapian-devel mailing list<br>
<a href="mailto:Xapian-devel@lists.xapian.org">Xapian-devel@lists.xapian.org</a><br>
<a href="http://lists.xapian.org/mailman/listinfo/xapian-devel" target="_blank">http://lists.xapian.org/mailman/listinfo/xapian-devel</a><br>
<br></blockquote></div><br></div></div>