A bag is a unique collection of values. You can add values to the bag and test if the value is in the bag.
The generated bag class is suited for adding, testing, retrieving, clearing items from the bag. It does not currently impelement delete, you will need to update the template if you want that ability.
The first template included is TMP_Bag.inc. This file contains the template for generating a typed unique collection of items. The template uses two include files. SharedSupport.inc computes a hash table size. {TKEY}Support.inc should contain two functions. 1) a hash function. Given a key and hash table size, it computes the index where the key should go. 2) a comparison function. The comparison function returns 0 if two key values are the same.
There are a couple example parameter files included.
This provides the parameters for creating a unique collection of Long's. The Specific include file it uses is LongSupport.inc, because TKEY = Long.
Generating:
PbReplace gen_LongBag.param
Tokens:
This provides the parameters for creating a unique collection of String's. The Specific include file it uses is StringSupport.inc, because TKEY = String.
Generating:
PbReplace gen_StringBag.param
Tokens: