summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-02-08 15:35:12 +0100
committerAlexander Larsson <alexl@redhat.com>2010-02-23 14:43:20 +0100
commit7537acd630e8973c92bb769b56d78836372b30c2 (patch)
tree6d18e55ac863551f38af04c7d1d5c6921b5a39ec
parent79d8c5c6a48e3b10d93d67dfd777b626dadafab9 (diff)
downloadspice-7537acd630e8973c92bb769b56d78836372b30c2.tar.gz
spice-7537acd630e8973c92bb769b56d78836372b30c2.tar.xz
spice-7537acd630e8973c92bb769b56d78836372b30c2.zip
Add optional templated base class to Cache and SharedCache
We want this for integration with C-style classes.
-rw-r--r--client/cache.hpp4
-rw-r--r--client/shared_cache.hpp4
-rw-r--r--client/utils.h3
3 files changed, 7 insertions, 4 deletions
diff --git a/client/cache.hpp b/client/cache.hpp
index 72340e16..0b53676c 100644
--- a/client/cache.hpp
+++ b/client/cache.hpp
@@ -26,8 +26,8 @@
const char* name();
};*/
-template <class T, class Treat, int HASH_SIZE>
-class Cache {
+template <class T, class Treat, int HASH_SIZE, class Base = EmptyBase>
+class Cache : public Base {
public:
Cache()
{
diff --git a/client/shared_cache.hpp b/client/shared_cache.hpp
index ee966386..96a476f7 100644
--- a/client/shared_cache.hpp
+++ b/client/shared_cache.hpp
@@ -27,8 +27,8 @@
const char* name();
};*/
-template <class T, class Treat, int HASH_SIZE>
-class SharedCache {
+template <class T, class Treat, int HASH_SIZE, class Base = EmptyBase>
+class SharedCache : public Base {
public:
SharedCache()
: _aborting (false)
diff --git a/client/utils.h b/client/utils.h
index 9a29cfbc..6ed3eea2 100644
--- a/client/utils.h
+++ b/client/utils.h
@@ -149,5 +149,8 @@ private:
T* _array;
};
+class EmptyBase {
+};
+
#endif