Boost logo

Boost :

Subject: Re: [boost] [GSoC] Request for Feedback on Boost.Bloom Filter Project
From: Arash Partow (arash_at_[hidden])
Date: 2011-06-27 20:21:13


Vicente Botet wrote:
> Could you give a concrete example of insertion of different types? any type?
>

A valid use-case could be that you have a struct called ipv4 and another called ipv6 which represent ip addresses (though not necessarily inheriting from a common base). Now it is true that they are nothing more than arrays of chars (or a string), but lets assume we'd like to treat them as the objects they are without knowing their underlying detail. Following on from this I'd like to be able to do something like the following:

  bloom_filter<AHashFunc> bf(.....);

  ipv4 i4(....);
  ipv6 i6(....);

  bf.insert(i4);
  bf.insert(i6);

Where the only requirement is that the types ipv4 and ipv6 have the correct hash function specialization in the namespace std::tr1

Something to ponder over, when inserting a boost:any is it the any-type as a whole, the underlying type or the serialized type that will be inserted into the BF? What about a Person class? would it be the Person type as a whole, or the serialized form of every field in the Person type that will be inserted? - I supposed it all depends on the way the hash input is generated.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk