aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate/libstate.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-13 18:06:31 +0000
committerlloyd <[email protected]>2010-03-13 18:06:31 +0000
commit47dbe2b1ab08dad17b157f9ed59767c44256f11d (patch)
tree3e664ae407107990519a8865580477aa734d2af3 /src/libstate/libstate.h
parent7859fcfd64579d0539b7d16e7a576f936ccc1f97 (diff)
parent6a8c00e903ea63828319460133a651c410b86185 (diff)
propagate from branch 'net.randombit.botan' (head 5e9c6107cbb15744c2edf2eb0e23f4bfe949f432)
to branch 'net.randombit.botan.c++0x' (head 79e5920a8bba479b9e5734f8649b8c36d27d403c)
Diffstat (limited to 'src/libstate/libstate.h')
-rw-r--r--src/libstate/libstate.h30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/libstate/libstate.h b/src/libstate/libstate.h
index ade17c17e..36c428ecb 100644
--- a/src/libstate/libstate.h
+++ b/src/libstate/libstate.h
@@ -12,14 +12,13 @@
#include <botan/allocate.h>
#include <botan/algo_factory.h>
+#include <mutex>
#include <string>
#include <vector>
#include <map>
namespace Botan {
-class Mutex;
-
/*
* Global State Container Base
*/
@@ -29,7 +28,10 @@ class BOTAN_DLL Library_State
Library_State();
~Library_State();
- void initialize(bool thread_safe);
+ Library_State(const Library_State&) = delete;
+ Library_State& operator=(const Library_State&) = delete;
+
+ void initialize();
/**
* @return the global Algorithm_Factory
@@ -40,7 +42,7 @@ class BOTAN_DLL Library_State
* @param name the name of the allocator
* @return allocator matching this name, or NULL
*/
- Allocator* get_allocator(const std::string& name = "") const;
+ Allocator* get_allocator(const std::string& name = "");
/**
* Add a new allocator to the list of available ones
@@ -61,7 +63,7 @@ class BOTAN_DLL Library_State
* @result the value of the parameter
*/
std::string get(const std::string& section,
- const std::string& key) const;
+ const std::string& key);
/**
* Check whether a certain parameter is set
@@ -72,7 +74,7 @@ class BOTAN_DLL Library_State
* false otherwise
*/
bool is_set(const std::string& section,
- const std::string& key) const;
+ const std::string& key);
/**
* Set a configuration parameter.
@@ -100,24 +102,14 @@ class BOTAN_DLL Library_State
* @param alias the alias to resolve.
* @return what the alias stands for
*/
- std::string deref_alias(const std::string& alias) const;
-
- /**
- * @return a newly created Mutex (free with delete)
- */
- Mutex* get_mutex() const;
+ std::string deref_alias(const std::string&);
private:
void load_default_config();
- Library_State(const Library_State&) {}
- Library_State& operator=(const Library_State&) { return (*this); }
-
- class Mutex_Factory* mutex_factory;
-
+ std::mutex config_lock;
std::map<std::string, std::string> config;
- Mutex* config_lock;
- Mutex* allocator_lock;
+ std::mutex allocator_lock;
std::string default_allocator_name;
std::map<std::string, Allocator*> alloc_factory;
mutable Allocator* cached_default_allocator;