[Debtags-devel] Hello, and a few improved tag descriptions

Enrico Zini enrico@enricozini.org
Mon, 6 Jun 2005 01:57:24 +0200

Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

On Sun, Jun 05, 2005 at 08:47:53PM +0200, Benjamin Mesing wrote:

> Enrico do you actually call the consume(const OpSet<string>& items,
> const OpSet<string>& tags) function? Only asking out of curiousity.

Yes, from all containers that cluster together items with the same
tagset.  One of them is ItemGrouper, another one is TagCollection.

The deserializer also calls it when the input file has items grouped
together, such as in:

  pkga, pkgb, pkgc: taga, tagb, tagc

> Please don't drop the OpSet. I use it excessively in packagesearch
> because it is so convenient to use.

I'm not doing it anytime soon: I use it everywhere as well!

> However perhaps one could extract an interface which defines the
> operators as virtual (are virtual operators allowed in C++)? This
> would avoid the dependency on libtagcoll when using the OpSet only,
> but probably it is not worth the effort.

Virtual operators are possible (they are just functions).  But if you
want to use the OpSet only, can't you just copy OpSet.{h,cc} in your
source tree?  They're LGPL after all, and they don't include anything
else from libtagcoll.

> And for "it's hard to figure out" part: You could always document their
> purpose :-) Eclipse/Java would be so helpful here with hinting what the
> type is supposed to do!

Uhm, the OpSet class if fully documented already.  Does Eclipse parse
and make good use of doxygen comments as well?

> :-) This is something I complained about to Enrico some time ago. I
> already had those std::unexpected exceptions! Perhaps together we have
> the power to shift his attention towards this point ;-)

Point taken!  I complain about it myself as well, and I've started
getting rid of them.

And in templates it's almost impossible to use them, as one of the
template parameters could be a class which throws exceptions in copy
operators or other places unexpected by the template.

You should admit, however, that I came up with a nice unexpected
function that can even print a stack trace when the source is compiled
with debugging symbols ;-)



GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <enrico@enricozini.org>

Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

Version: GnuPG v1.4.1 (GNU/Linux)