From f77d5c0499b6d8dd301e66585330a86eb73090a4 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 11 Nov 2008 01:33:33 +0000 Subject: 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. --- src/libstate/libstate.cpp | 18 +++++++++--------- src/libstate/libstate.h | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/libstate') 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 allocators; - Algorithm_Factory* algorithm_factory; + Algorithm_Factory* m_algorithm_factory; }; /************************************************* -- cgit v1.2.3