diff options
author | lloyd <[email protected]> | 2008-11-11 01:33:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-11 01:33:33 +0000 |
commit | f77d5c0499b6d8dd301e66585330a86eb73090a4 (patch) | |
tree | 41811d4cd1037e185157497738889c1af9fa7211 /src | |
parent | 37955fb85460069cbef4dbe95222ed80d2b4152b (diff) |
After finding myself typing global_state().algorithm_factory() instead
of algo_factory() several times, I decided to rename the functions.
algorithm_factory() just forwards to algo_factory as an inline.
Diffstat (limited to 'src')
-rw-r--r-- | src/libstate/libstate.cpp | 18 | ||||
-rw-r--r-- | src/libstate/libstate.h | 3 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/libstate/libstate.cpp b/src/libstate/libstate.cpp index 14b63293c..b5e5d0de1 100644 --- a/src/libstate/libstate.cpp +++ b/src/libstate/libstate.cpp @@ -221,9 +221,9 @@ Return a reference to the Algorithm_Factory */ Algorithm_Factory& Library_State::algo_factory() { - if(!algorithm_factory) + if(!m_algorithm_factory) throw Invalid_State("Uninitialized in Library_State::algo_factory"); - return *algorithm_factory; + return *m_algorithm_factory; } /************************************************* @@ -267,21 +267,21 @@ void Library_State::initialize(bool thread_safe) load_default_config(); - algorithm_factory = new Algorithm_Factory; + m_algorithm_factory = new Algorithm_Factory; #if defined(BOTAN_HAS_ENGINE_GNU_MP) - algorithm_factory->add_engine(new GMP_Engine); + m_algorithm_factory->add_engine(new GMP_Engine); #endif #if defined(BOTAN_HAS_ENGINE_OPENSSL) - algorithm_factory->add_engine(new OpenSSL_Engine); + m_algorithm_factory->add_engine(new OpenSSL_Engine); #endif #if defined(BOTAN_HAS_ENGINE_ASSEMBLER) - algorithm_factory->add_engine(new Assembler_Engine); + m_algorithm_factory->add_engine(new Assembler_Engine); #endif - algorithm_factory->add_engine(new Default_Engine); + m_algorithm_factory->add_engine(new Default_Engine); } /** @@ -289,7 +289,7 @@ void Library_State::initialize(bool thread_safe) */ void Library_State::add_engine(Engine* engine) { - algorithm_factory->add_engine(engine); + m_algorithm_factory->add_engine(engine); } /************************************************* @@ -308,7 +308,7 @@ Library_State::Library_State() *************************************************/ Library_State::~Library_State() { - delete algorithm_factory; + delete m_algorithm_factory; cached_default_allocator = 0; diff --git a/src/libstate/libstate.h b/src/libstate/libstate.h index 3ca97a53c..ac500b42f 100644 --- a/src/libstate/libstate.h +++ b/src/libstate/libstate.h @@ -28,6 +28,7 @@ class BOTAN_DLL Library_State void initialize(bool thread_safe); Algorithm_Factory& algo_factory(); + Algorithm_Factory& algorithm_factory() { return algo_factory(); } void add_engine(class Engine*); @@ -110,7 +111,7 @@ class BOTAN_DLL Library_State mutable Allocator* cached_default_allocator; std::vector<Allocator*> allocators; - Algorithm_Factory* algorithm_factory; + Algorithm_Factory* m_algorithm_factory; }; /************************************************* |