summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Protocol_Base
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_Protocol_Base
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_Protocol_Base')
-rw-r--r--FTNoIR_Protocol_Base/ftnoir_protocol_base.h36
1 files changed, 17 insertions, 19 deletions
diff --git a/FTNoIR_Protocol_Base/ftnoir_protocol_base.h b/FTNoIR_Protocol_Base/ftnoir_protocol_base.h
index 1711a08e..d8ab755f 100644
--- a/FTNoIR_Protocol_Base/ftnoir_protocol_base.h
+++ b/FTNoIR_Protocol_Base/ftnoir_protocol_base.h
@@ -24,6 +24,7 @@
*********************************************************************************/
/*
Modifications (last one on top):
+
20110415 - WVR: Added overloaded operator - and -=
*/
@@ -39,6 +40,14 @@
#include "windows.h"
//#include "winable.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.
@@ -46,7 +55,7 @@
// Instances are obtained via factory function.
struct IProtocol
{
- virtual void Release() = 0; // Member required to enable Auto-remove
+ virtual ~IProtocol() {}
virtual void Initialize() = 0;
virtual bool checkServerInstallationOK ( HANDLE handle ) = 0;
virtual void sendHeadposeToGame( T6DOF *headpose ) = 0;
@@ -57,26 +66,16 @@ struct IProtocol
virtual void getDescription(QString *strToBeFilled) = 0;
};
-// Handle type. In C++ language the iterface type is used.
-typedef IProtocol* PROTOCOLHANDLE;
-
-////////////////////////////////////////////////////////////////////////////////
-//
-#ifdef __cplusplus
-# define EXTERN_C extern "C"
-#else
-# define EXTERN_C
-#endif // __cplusplus
+typedef IProtocol* IProtocolPtr;
// Factory function that creates instances of the Protocol object.
EXTERN_C
FTNOIR_PROTOCOL_BASE_EXPORT
-PROTOCOLHANDLE
+IProtocolPtr
__stdcall
-GetProtocol(
- void);
-
+GetProtocol(void);
+////////////////////////////////////////////////////////////////////////////////
// COM-Like abstract interface.
// This interface doesn't require __declspec(dllexport/dllimport) specifier.
// Method calls are dispatched via virtual table.
@@ -84,7 +83,7 @@ GetProtocol(
// Instances are obtained via factory function.
struct IProtocolDialog
{
- virtual void Release() = 0; // Member required to enable Auto-remove
+ virtual ~IProtocolDialog() {}
virtual void Initialize(QWidget *parent) = 0;
virtual void getFullName(QString *strToBeFilled) = 0;
@@ -93,13 +92,12 @@ struct IProtocolDialog
virtual void getIcon(QIcon *icon) = 0;
};
-// Handle type. In C++ language the iterface type is used.
-typedef IProtocolDialog* PROTOCOLDIALOGHANDLE;
+typedef IProtocolDialog* IProtocolDialogPtr;
// Factory function that creates instances of the Protocol object.
EXTERN_C
FTNOIR_PROTOCOL_BASE_EXPORT
-PROTOCOLDIALOGHANDLE
+IProtocolDialogPtr
__stdcall
GetProtocolDialog(void);