diff options
author | lloyd <[email protected]> | 2010-03-24 13:52:11 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-24 13:52:11 +0000 |
commit | 550dc44e247dfb5a8cbac0afcfc065fb6990c386 (patch) | |
tree | 58eaff59749bfd9130e8de811f5d7f5a036b06d1 /src/algo_factory/algo_factory.cpp | |
parent | 24aba24f73f1717548b82f1d6bf8e4f773afa015 (diff) |
Allow adding engines dynamically
Diffstat (limited to 'src/algo_factory/algo_factory.cpp')
-rw-r--r-- | src/algo_factory/algo_factory.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/algo_factory/algo_factory.cpp b/src/algo_factory/algo_factory.cpp index ad8b1215f..030a32b9f 100644 --- a/src/algo_factory/algo_factory.cpp +++ b/src/algo_factory/algo_factory.cpp @@ -83,11 +83,8 @@ const T* factory_prototype(const std::string& algo_spec, /** * Setup caches */ -Algorithm_Factory::Algorithm_Factory(const std::vector<Engine*>& engines_in, - Mutex_Factory& mf) +Algorithm_Factory::Algorithm_Factory(Mutex_Factory& mf) { - engines = engines_in; - block_cipher_cache = new Algorithm_Cache<BlockCipher>(mf.make()); stream_cipher_cache = new Algorithm_Cache<StreamCipher>(mf.make()); hash_cache = new Algorithm_Cache<HashFunction>(mf.make()); @@ -107,6 +104,11 @@ Algorithm_Factory::~Algorithm_Factory() delete mac_cache; } +void Algorithm_Factory::add_engine(Engine* engine) + { + engines.push_back(engine); + } + /** * Set the preferred provider for an algorithm */ |