aboutsummaryrefslogtreecommitdiffstats
path: root/include/modules.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-06-25 14:31:43 +0000
committerlloyd <[email protected]>2006-06-25 14:31:43 +0000
commitcbdfc3aff3d9ef7b422f48efe22a11fc2115e248 (patch)
tree33e7c029cb542edf82a93879c41c306f8ae16373 /include/modules.h
parente6f36f3a64bee29f22f0f3b68a51ab5308a2c186 (diff)
Change how builtin modules are loaded - provide an interface to a
factory class. Currently hardcoded (Builtin_Modules, instantiated in init_def.cpp), but this will allow for some flexibility later on.
Diffstat (limited to 'include/modules.h')
-rw-r--r--include/modules.h42
1 files changed, 26 insertions, 16 deletions
diff --git a/include/modules.h b/include/modules.h
index e09c18e9b..7441134d1 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -6,32 +6,42 @@
#ifndef BOTAN_MODULE_FACTORIES_H__
#define BOTAN_MODULE_FACTORIES_H__
-#include <vector>
#include <string>
+#include <vector>
namespace Botan {
/*************************************************
-* Forward Declarations *
+* Module Builder Interface *
*************************************************/
-class Mutex_Factory;
-class Timer;
-class EntropySource;
-class Engine;
-class Allocator;
+class Modules
+ {
+ public:
+ void load(class Library_State&) const;
+
+ virtual class Mutex_Factory* mutex_factory() const;
+ virtual class Timer* timer() const;
-namespace Modules {
+ virtual std::vector<class Allocator*> allocators() const;
+ virtual std::vector<class EntropySource*> entropy_sources() const;
+ virtual std::vector<class Engine*> engines() const;
+
+ virtual ~Modules() {}
+ };
/*************************************************
-* Get the module objects *
+* Built In Modules *
*************************************************/
-class Mutex_Factory* get_mutex_factory();
-class Timer* get_timer();
-std::vector<EntropySource*> get_entropy_sources();
-std::vector<Engine*> get_engines();
-std::vector<Allocator*> get_allocators();
-
-}
+class Builtin_Modules : public Modules
+ {
+ public:
+ class Mutex_Factory* mutex_factory() const;
+ class Timer* timer() const;
+
+ std::vector<class Allocator*> allocators() const;
+ std::vector<class EntropySource*> entropy_sources() const;
+ std::vector<class Engine*> engines() const;
+ };
}