aboutsummaryrefslogtreecommitdiff
path: root/include/cru/common/auto_delete.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/common/auto_delete.hpp')
-rw-r--r--include/cru/common/auto_delete.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/cru/common/auto_delete.hpp b/include/cru/common/auto_delete.hpp
new file mode 100644
index 00000000..ae66f7bf
--- /dev/null
+++ b/include/cru/common/auto_delete.hpp
@@ -0,0 +1,14 @@
+#pragma once
+#include "base.hpp"
+
+namespace cru {
+// A instance of class implementing this interface is able to
+// delete itseft when program exits. Such as IGraphFactory,
+// IUiApplication.
+struct IAutoDelete : virtual Interface {
+ // Get whether it will delete itself when program exits.
+ virtual bool IsAutoDelete() const = 0;
+ // Set whether it will delete itself when program exits.
+ virtual void SetAutoDelete(bool value) = 0;
+};
+} // namespace cru