DOKK / manpages / debian 10 / libbobcat-dev / hash.3bobcat.en
FBB::Hash(3bobcat) Key hashing containers FBB::Hash(3bobcat)

FBB::Hash - Various mapping template classes using hashing

#include <bobcat/hash>

The FBB:Hash group of template classes offer hashing-based mapping. Various variants are available, all based on the facilities offered by the unordered_map.

The hash-map offered in the unordered_map container has a fairly complex construction interface, and Hash is an attempt to simplify this part of its interface. In practice, hashing uses a textual key, which may be std::string or char * based, and the keys may be used either case sensitively or case insensitively. Hash merely requires its users to specify the map’s value type, while the key may be a char const * or std::string, used case sensitively or case insensitively.

FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.

std::unordered_map, using various instantiations.

All variants define value_type as the corresponding unordered_map value_type. In practice a value_type defines a std::pair<Key, Value>, where Key represents the hash’s key-type and Value represents the hash’s value type.

Variants of the FBB::Hash container are available for char const * or std::string keys, used case sensitively or case insensitively. All variants support default, copy, and move construction, support construction from initializer lists and support construction from iterators defining a half-open range of value_type values.

The following variants are available (showing their default constructors). Value refers to the value type stored in the hash table.

HashCharPtr<Value>():
this hash table uses case sensitive char const * keys;
HashCharCasePtr<Value>():
this hash table uses case insensitive char const * keys;
HashString<Value>():
this hash table uses case sensitive std::string keys;
HashStringCase<Value>():
this hash table uses case insensitive std::string keys;

In addition to the index operator inherited from unordered_map the overloaded copy and move assignment operators are available for all Hash containers.

All members of the unordered_map container are available, as Hash inherits from this template class.


#include <iostream>
#include <bobcat/hash>

using namespace std;
using namespace FBB;

pair<char const *, size_t> ap[] =
{
pair<char const *, size_t>("one", 1),
pair<char const *, size_t>("two", 2),
};

int main()
{
HashCharPtr<size_t> hcp;
HashCharPtr<size_t> hcp2(ap, ap + 2);
HashCharPtr<size_t> hcp3(hcp2);
hcp = hcp2;

cout << hcp2["one"] << endl;
}

bobcat/hash - defines the class interface

bobcat(7)

None Reported.

bobcat_4.08.06-x.dsc: detached signature;
bobcat_4.08.06-x.tar.gz: source archive;
bobcat_4.08.06-x_i386.changes: change log;
libbobcat1_4.08.06-x_*.deb: debian package holding the libraries;
libbobcat1-dev_4.08.06-x_*.deb: debian package holding the libraries, headers and manual pages;
http://sourceforge.net/projects/bobcat: public archive location;

Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.

This is free software, distributed under the terms of the GNU General Public License (GPL).

Frank B. Brokken (f.b.brokken@rug.nl).

2005-2018 libbobcat-dev_4.08.06-x.tar.gz