FBB::Hash

FBB::Hash

libbobcat1-dev_2.02.03-x.tar.gz

2005-2009


FBB::Hash(3bobcat)

FBB::Hash(3bobcat)

libbobcat1-dev_2.02.03-x.tar.gz Key hashing containers

2005-2009

NAME

FBB::Hash - Various mapping template classes using hashing

SYNOPSIS

#include <bobcat/hash>

DESCRIPTION

The FBB:Hash group of template classes offer hashing-based mapping. Various variants are availabe, all based on the facilities offered by the GNU g++(1) ext/hash_map header file. Hashing containers are not (yet) part of the ANSI-ISO C++ standard, and an extension to the standard is offered by GNU's g++(1) compiler. GNU's hash map is defined in the __gnu_cxx namespace, indicating that this container is not one that is offered in the C++ standard.

Unfortunately, the hash-map offered in the ext/hash_map header file has a fairly complex interface, and FBB::Hash is an attempt to simplify this 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. FBB::Hash simplifies the use of the hash map offered in ext/hash_map by requiring its users to specify only the map's value type.

NAMESPACE

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

INHERITS FROM

__gnu_cxx::hash_map, using various instantiations.

CONSTRUCTORS

Using case sensitive char const * keys:

Using case insensitive char const * keys:

Using case sensitive std::string keys:

Using case insensitive std::string keys:

The copy constructor is available for all FBB:Hash... hash-map containers.

OVERLOADED OPERATOR

The overloaded assignment operator is available for all FBB:Hash hash-map containers.

MEMBER FUNCTIONS

All members of __gnu_cxx::hash_map are available, as FBB::Hash inherits from this template class. These members are (expected to be) the same members as available for the std::map container.

EXAMPLE


    #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;
    }
        

FILES

bobcat/hash - defines the class interface

SEE ALSO

bobcat(7), g++(1), ext/hash_map

BUGS

None Reported.

DISTRIBUTION FILES

BOBCAT

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

COPYRIGHT

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

AUTHOR

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