summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Filter_Base/ftnoir_filter_base.h
diff options
context:
space:
mode:
authorPatrick Ruoff <c14-radioactive@19e81ba0-9b1a-49c3-bd6c-561e1906d5fb>2012-09-21 14:00:34 +0000
committerPatrick Ruoff <c14-radioactive@19e81ba0-9b1a-49c3-bd6c-561e1906d5fb>2012-09-21 14:00:34 +0000
commitab0d60becc2d1b89c812193c179892d6acd4912f (patch)
tree2dae7d2c10e1cc3a5bd73ee8ae2ee609c69a1b7b /FTNoIR_Filter_Base/ftnoir_filter_base.h
parentddc63cdda186fe31435fde839c3d5b68040a0d0f (diff)
RAII-style dll management 1: Replaced autoptr and release with virtual destructors
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@155 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
Diffstat (limited to 'FTNoIR_Filter_Base/ftnoir_filter_base.h')
-rw-r--r--FTNoIR_Filter_Base/ftnoir_filter_base.h46
1 files changed, 21 insertions, 25 deletions
diff --git a/FTNoIR_Filter_Base/ftnoir_filter_base.h b/FTNoIR_Filter_Base/ftnoir_filter_base.h
index 600243fc..71d2faf0 100644
--- a/FTNoIR_Filter_Base/ftnoir_filter_base.h
+++ b/FTNoIR_Filter_Base/ftnoir_filter_base.h
@@ -10,8 +10,14 @@
#include <QMessageBox>
#include <QSettings>
-#include "..\FaceTrackNoIR\AutoClosePtr.h"
+////////////////////////////////////////////////////////////////////////////////
+#ifdef __cplusplus
+# define EXTERN_C extern "C"
+#else
+# define EXTERN_C
+#endif // __cplusplus
+////////////////////////////////////////////////////////////////////////////////
// COM-Like abstract interface.
// This interface doesn't require __declspec(dllexport/dllimport) specifier.
// Method calls are dispatched via virtual table.
@@ -19,32 +25,22 @@
// Instances are obtained via factory function.
struct IFilter
{
- virtual void Release() = 0;
+ virtual ~IFilter() {}
virtual void Initialize() = 0;
virtual void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget) = 0;
};
-// Handle type. In C++ language the interface type is used.
-typedef IFilter* FILTERHANDLE;
-typedef AutoClosePtr<IFilter, void, &IFilter::Release> IFilterPtr;
-typedef IFilter *(__stdcall *importGetFilter)(void);
-
-////////////////////////////////////////////////////////////////////////////////
-//
-#ifdef __cplusplus
-# define EXTERN_C extern "C"
-#else
-# define EXTERN_C
-#endif // __cplusplus
+typedef IFilter* IFilterPtr;
+//typedef IFilter *(__stdcall *importGetFilter)(void);
// Factory function that creates instances of the Filter object.
EXTERN_C
FTNOIR_FILTER_BASE_EXPORT
-FILTERHANDLE
+IFilterPtr
__stdcall
-GetFilter(
- void);
+GetFilter(void);
+////////////////////////////////////////////////////////////////////////////////
// COM-Like abstract interface.
// This interface doesn't require __declspec(dllexport/dllimport) specifier.
// Method calls are dispatched via virtual table.
@@ -52,20 +48,21 @@ GetFilter(
// Instances are obtained via factory function.
struct IFilterDialog
{
- virtual void Release() = 0; // Member required to enable Auto-remove
+ virtual ~IFilterDialog() {}
virtual void Initialize(QWidget *parent, IFilterPtr ptr) = 0;
};
-// Handle type. In C++ language the interface type is used.
-typedef IFilterDialog* FILTERDIALOGHANDLE;
+typedef IFilterDialog* IFilterDialogPtr;
+
// Factory function that creates instances of the Filter object.
EXTERN_C
FTNOIR_FILTER_BASE_EXPORT
-FILTERDIALOGHANDLE
+IFilterDialogPtr
__stdcall
GetFilterDialog(void);
+////////////////////////////////////////////////////////////////////////////////
// COM-Like abstract interface.
// This interface doesn't require __declspec(dllexport/dllimport) specifier.
// Method calls are dispatched via virtual table.
@@ -73,7 +70,7 @@ GetFilterDialog(void);
// Instances are obtained via factory function.
struct IFilterDll
{
- virtual void Release() = 0; // Member required to enable Auto-remove
+ virtual ~IFilterDll() {}
virtual void Initialize() = 0;
virtual void getFullName(QString *strToBeFilled) = 0;
@@ -82,13 +79,12 @@ struct IFilterDll
virtual void getIcon(QIcon *icon) = 0;
};
-// Handle type. In C++ language the interface type is used.
-typedef IFilterDll* FILTERDLLHANDLE;
+typedef IFilterDll* IFilterDllPtr;
// Factory function that creates instances of the Filter object.
EXTERN_C
FTNOIR_FILTER_BASE_EXPORT
-FILTERDLLHANDLE
+IFilterDllPtr
__stdcall
GetFilterDll(void);