summaryrefslogtreecommitdiff
path: root/factory.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-19 03:47:20 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-19 03:47:20 +0000
commit153b79ef5d9b042b23eba9aa332ec025bbc3300e (patch)
tree09d13a6fae123a46962ad82f4b88b7c91bd08335 /factory.h
parent609446928f2c6f2e51cc906a037cd79ef4dfd312 (diff)
downloadcryptopp-153b79ef5d9b042b23eba9aa332ec025bbc3300e.tar.gz
remove Diamond2, code size reductions
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@107 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'factory.h')
-rw-r--r--factory.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/factory.h b/factory.h
index 1dd0bdc..b9c96e6 100644
--- a/factory.h
+++ b/factory.h
@@ -32,7 +32,7 @@ public:
{
for (CPP_TYPENAME Map::iterator i = m_map.begin(); i != m_map.end(); ++i)
{
- delete i->second;
+ delete (ObjectFactory<AbstractClass> *)i->second;
i->second = NULL;
}
}
@@ -45,7 +45,7 @@ public:
const ObjectFactory<AbstractClass> * GetFactory(const char *name) const
{
CPP_TYPENAME Map::const_iterator i = m_map.find(name);
- return i == m_map.end() ? NULL : i->second;
+ return i == m_map.end() ? NULL : (ObjectFactory<AbstractClass> *)i->second;
}
AbstractClass *CreateObject(const char *name) const
@@ -58,7 +58,8 @@ public:
static ObjectFactoryRegistry<AbstractClass, instance> & Registry(...);
private:
- typedef std::map<std::string, ObjectFactory<AbstractClass> *> Map;
+ // use void * instead of ObjectFactory<AbstractClass> * to save code size
+ typedef std::map<std::string, void *> Map;
Map m_map;
};