diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-10-14 22:27:51 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-10-14 22:27:51 +0000 |
commit | e72d6077b475bc6142afc3b5967db113922c76f5 (patch) | |
tree | 45bdb7b69ec4c1dbcfadc1fa568b1d6b341a6f0f /src/hash.cpp | |
parent | 44eac9521632f8da42f73085db945bdba45f8311 (diff) | |
download | libbu++-e72d6077b475bc6142afc3b5967db113922c76f5.tar.gz libbu++-e72d6077b475bc6142afc3b5967db113922c76f5.tar.bz2 libbu++-e72d6077b475bc6142afc3b5967db113922c76f5.tar.xz libbu++-e72d6077b475bc6142afc3b5967db113922c76f5.zip |
Fixed an interesting ideosyncacy in Bu::Hash in a safe way, I should try to do
this with the Bu::Archive next. Basically, there's one generic template
function that will convert anything that can safely cast to a uint32_t and that
supports direct comparisson, and doesn't have it's own override already to be
a Hash key, such as char, uint8_t, uint64_t, etc.
The Telnet protocol handler does everything I need it too for now, next up for
it is escape sequence handling, it would be nice to make this general too, by
using the termcap database or something, but there is an ANSI/ISO standard now,
I may just go ahead and use that. Also, it looks like it'd be pretty easy to
make the canonical mode editing functions be pluggable to facilitate different
types of editing, but that can be done down the road as well.
Diffstat (limited to 'src/hash.cpp')
-rw-r--r-- | src/hash.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/hash.cpp b/src/hash.cpp index a207c29..9b8a1c1 100644 --- a/src/hash.cpp +++ b/src/hash.cpp | |||
@@ -2,26 +2,6 @@ | |||
2 | 2 | ||
3 | namespace Bu { subExceptionDef( HashException ) } | 3 | namespace Bu { subExceptionDef( HashException ) } |
4 | 4 | ||
5 | template<> uint32_t Bu::__calcHashCode<int>( const int &k ) | ||
6 | { | ||
7 | return k; | ||
8 | } | ||
9 | |||
10 | template<> bool Bu::__cmpHashKeys<int>( const int &a, const int &b ) | ||
11 | { | ||
12 | return a == b; | ||
13 | } | ||
14 | |||
15 | template<> uint32_t Bu::__calcHashCode<unsigned int>( const unsigned int &k ) | ||
16 | { | ||
17 | return k; | ||
18 | } | ||
19 | |||
20 | template<> bool Bu::__cmpHashKeys<unsigned int>( const unsigned int &a, const unsigned int &b ) | ||
21 | { | ||
22 | return a == b; | ||
23 | } | ||
24 | |||
25 | template<> | 5 | template<> |
26 | uint32_t Bu::__calcHashCode<const char *>( const char * const &k ) | 6 | uint32_t Bu::__calcHashCode<const char *>( const char * const &k ) |
27 | { | 7 | { |