aboutsummaryrefslogtreecommitdiff
path: root/src/listhash.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-10 21:04:17 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-10 21:04:17 +0000
commit2ba3f84ab559da02a11aa000b3cecb3b3668af61 (patch)
tree266f450b512f607ec54d54af4fa8c13fdbe7ef91 /src/listhash.h
parentea18007633b31901f2ae275cc0576c3f7ce99fc9 (diff)
parent3611f253f6fdfa4954d374ab85ddaa7f799c130c (diff)
downloadlibbu++-2ba3f84ab559da02a11aa000b3cecb3b3668af61.tar.gz
libbu++-2ba3f84ab559da02a11aa000b3cecb3b3668af61.tar.bz2
libbu++-2ba3f84ab559da02a11aa000b3cecb3b3668af61.tar.xz
libbu++-2ba3f84ab559da02a11aa000b3cecb3b3668af61.zip
Merged in the core branch. This is a major update that fixes many things, and
changes many others, including source files that were deleted and renamed. Before doing this update, I reccomend a full clean, or even a fresh checkout. Things to note, most outstanding about this update: - Bu::Socket was changed to Bu::TcpSocket and the default mode is blocking. - All templatized container classes are SharedCore now, which is good, but SharedCore is inherently non-reentrant safe. However, all SharedCore classes have a "clone" function that return a non-shared copy of the object, safe for passing into a reentrant safe function accessing shared memory.
Diffstat (limited to 'src/listhash.h')
-rw-r--r--src/listhash.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/listhash.h b/src/listhash.h
deleted file mode 100644
index e5ec4ee..0000000
--- a/src/listhash.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * Copyright (C) 2007-2010 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
8#ifndef BU_LIST_HASH_H
9#define BU_LIST_HASH_H
10
11#include "bu/hash.h"
12#include "bu/list.h"
13
14namespace Bu
15{
16 template<typename key, typename value, typename sizecalc = __calcNextTSize_fast, typename keyalloc = std::allocator<key>, typename valuealloc = std::allocator<Bu::List<value> >, typename challoc = std::allocator<uint32_t> >
17 class ListHash : public Hash<key, Bu::List<value>, sizecalc, keyalloc, valuealloc, challoc>
18 {
19 typedef Hash<key, Bu::List<value>, sizecalc, keyalloc, valuealloc, challoc> ParentType;
20 public:
21 ListHash()
22 {
23 }
24
25 ListHash( const ListHash &src ) :
26 ParentType( src )
27 {
28 }
29
30 virtual ~ListHash()
31 {
32 }
33
34 ListHash &operator=( const ListHash &src )
35 {
36 *dynamic_cast<ParentType *>(this) =
37 dynamic_cast<ParentType &>(src);
38 }
39
40 virtual void insert( const key &k, const value &v )
41 {
42 if( !has( k ) )
43 {
44 ParentType::insert( k, List<value>() );
45 }
46 get( k ).append( v );
47 }
48
49 private:
50 };
51
52};
53
54#endif