summaryrefslogtreecommitdiff
path: root/src/ModuleRegistry.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ModuleRegistry.hpp')
-rw-r--r--src/ModuleRegistry.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ModuleRegistry.hpp b/src/ModuleRegistry.hpp
new file mode 100644
index 0000000..fbbdd40
--- /dev/null
+++ b/src/ModuleRegistry.hpp
@@ -0,0 +1,21 @@
+#ifndef __MODULEINTERFACE_H
+#define __MODULEINTERFACE_H
+
+#include <string>
+
+template< typename Interface >
+struct ModuleRegistry {
+ std::string name;
+ Interface *(*create)( );
+ void (*destroy)( Interface *obj );
+
+ ModuleRegistry( ) { }
+
+ ModuleRegistry<Interface>( std::string _name, Interface *(*_create)( ),
+ void (*_destroy)( Interface *obj ) )
+ : name( _name ), create( _create ), destroy( _destroy )
+ {
+ }
+};
+
+#endif