summaryrefslogtreecommitdiff
path: root/include/namespace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/namespace.h')
-rw-r--r--include/namespace.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/include/namespace.h b/include/namespace.h
index ef625fc..4cbf43e 100644
--- a/include/namespace.h
+++ b/include/namespace.h
@@ -78,7 +78,6 @@ public:
/**
* Add a native class to the extension by moving it
- * @param name Name of the class
* @param type The class implementation
*/
template<typename T>
@@ -93,7 +92,6 @@ public:
/**
* Add a native class to the extension by copying it
- * @param name Name of the class
* @param type The class implementation
*/
template<typename T>
@@ -105,6 +103,32 @@ public:
// and add it to the list of classes
_classes.push_back(std::unique_ptr<ClassBase>(copy));
}
+
+ /**
+ * Add an interface to the extension by moving it
+ * @param interface The interface properties
+ */
+ void add(Interface &&interface)
+ {
+ // make a copy of the object
+ auto *copy = new Interface(std::move(interface));
+
+ // and add it to the list of classes
+ _classes.push_back(std::unique_ptr<ClassBase>(copy));
+ }
+
+ /**
+ * Add an interface to the extension by copying it
+ * @param interface The interface properties
+ */
+ void add(const Interface &interface)
+ {
+ // make a copy of the object
+ auto *copy = new Interface(interface);
+
+ // and add it to the list of classes
+ _classes.push_back(std::unique_ptr<ClassBase>(copy));
+ }
/**
* Add a namespace to the extension by moving it