diff options
author | lloyd <[email protected]> | 2006-08-05 11:38:34 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-08-05 11:38:34 +0000 |
commit | 9b6d086eb20b08efbbc63cfbe70b61647fc27f2f (patch) | |
tree | 73ec49b82ee8417c780c249a403b540016f9daab /src | |
parent | 1942fdac5ccad80b42f23083e2f8c8e1281989b3 (diff) |
Make it possible to insert Engines into the front of the queue;
otherwise any Engines added after startup (eg, application-specific
ones) would only be used for new algorithm - it wouldn't be possible
for them to override existing implementations.
Diffstat (limited to 'src')
-rw-r--r-- | src/libstate.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libstate.cpp b/src/libstate.cpp index dd6e5e7c1..8c183c4f7 100644 --- a/src/libstate.cpp +++ b/src/libstate.cpp @@ -235,10 +235,14 @@ Engine* Library_State::get_engine_n(u32bit n) const /************************************************* * Add a new engine to the list * *************************************************/ -void Library_State::add_engine(Engine* engine) +void Library_State::add_engine(Engine* engine, bool in_front) { Named_Mutex_Holder lock("engine"); - engines.push_back(engine); + + if(in_front) + engines.insert(engines.begin(), engine); + else + engines.push_back(engine); } /************************************************* @@ -311,7 +315,7 @@ void Library_State::load(Modules& modules) std::vector<Engine*> engines = modules.engines(); for(u32bit j = 0; j != engines.size(); ++j) - add_engine(engines[j]); + add_engine(engines[j], false); std::vector<EntropySource*> sources = modules.entropy_sources(); for(u32bit j = 0; j != sources.size(); ++j) |