diff options
author | Patrick Ruoff <c14-radioactive@19e81ba0-9b1a-49c3-bd6c-561e1906d5fb> | 2012-09-21 14:00:34 +0000 |
---|---|---|
committer | Patrick Ruoff <c14-radioactive@19e81ba0-9b1a-49c3-bd6c-561e1906d5fb> | 2012-09-21 14:00:34 +0000 |
commit | ab0d60becc2d1b89c812193c179892d6acd4912f (patch) | |
tree | 2dae7d2c10e1cc3a5bd73ee8ae2ee609c69a1b7b /FaceTrackNoIR/tracker.h | |
parent | ddc63cdda186fe31435fde839c3d5b68040a0d0f (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 'FaceTrackNoIR/tracker.h')
-rw-r--r-- | FaceTrackNoIR/tracker.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/FaceTrackNoIR/tracker.h b/FaceTrackNoIR/tracker.h index d7c0506e..fd5c1d61 100644 --- a/FaceTrackNoIR/tracker.h +++ b/FaceTrackNoIR/tracker.h @@ -46,16 +46,10 @@ #include "..\ftnoir_tracker_base\FTNoIR_Tracker_base.h"
#include "..\ftnoir_protocol_base\FTNoIR_Protocol_base.h"
#include "..\ftnoir_filter_base\FTNoIR_Filter_base.h"
-//#include "AutoClosePtr.h"
-
-// 1a. COM-Like usage with smart pointer.
-// No need to call `ITracker::Release'; the instance will
-// be released automatically in destructor of the smart pointer.
-//typedef AutoClosePtr<ITracker, void, &ITracker::Release> ITrackerPtr;
-typedef ITracker *(WINAPI *importGetTracker)(void);
-typedef AutoClosePtr<IProtocol, void, &IProtocol::Release> IProtocolPtr;
-typedef IProtocol *(WINAPI *importGetProtocol)(void);
+typedef ITrackerPtr (WINAPI *importGetTracker)(void);
+typedef IProtocolPtr (WINAPI *importGetProtocol)(void);
+typedef IFilterPtr (WINAPI *importGetFilter)(void);
// include the DirectX Library files
#pragma comment (lib, "dinput8.lib")
@@ -179,7 +173,7 @@ private: static T6DOF new_camera;
static T6DOF output_camera;
- ITracker *pTracker; // Pointer to Tracker instance (in DLL)
+ ITrackerPtr pTracker; // Pointer to Tracker instance (in DLL)
static IProtocolPtr pProtocol; // Pointer to Protocol instance (in DLL)
static IFilterPtr pFilter; // Pointer to Filter instance (in DLL)
|