Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_Canvas_JNI / INC / CanvasNativeService.h
diff --git a/WCudaMSE/API_Bilat_Canvas_JNI/INC/CanvasNativeService.h b/WCudaMSE/API_Bilat_Canvas_JNI/INC/CanvasNativeService.h
new file mode 100755 (executable)
index 0000000..477b78a
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef CANVAS_NATIVE_SERVICE_H
+#define CANVAS_NATIVE_SERVICE_H
+#include "envCanvasJNI.h"
+#include "CanvasNative.h"
+#include <map>
+
+using std::map;
+
+/*----------------------------------------------------------------------*\
+ |*                    Declaration                                     *|
+ \*---------------------------------------------------------------------*/
+
+/*--------------------------------------*\
+ |*            Public                  *|
+ \*-------------------------------------*/
+/**
+ * Singleton
+ * Not thread Safe!
+ */
+class CBI_CANVAS_JNI CanvasNativeService
+    {
+
+       /*--------------------------------------*\
+        |*             Constructor             *|
+        \*-------------------------------------*/
+
+    private:
+
+       CanvasNativeService();
+
+       CanvasNativeService(const CanvasNativeService& src);
+
+       /*--------------------------------------*\
+        |*             Destructor              *|
+        \*-------------------------------------*/
+
+    public:
+
+       virtual ~CanvasNativeService();
+
+       /*--------------------------------------*\
+        |*             Methodes                *|
+        \*-------------------------------------*/
+
+    public:
+
+       int registerCanvasNative(CanvasNative* ptrCanvasNative);
+
+       void unregister(int id);
+
+       /*--------------------------------------*\
+        |*             Get                     *|
+        \*-------------------------------------*/
+
+    public :
+
+       CanvasNative* getCanvasNative(int id);
+
+       static CanvasNativeService* getInstance();
+
+       /*--------------------------------------*\
+        |*             Attributs               *|
+        \*-------------------------------------*/
+
+    private:
+
+       //Tools
+       map<int, CanvasNative*> mapIdNativeCanvas;
+
+       //Singleton
+       static CanvasNativeService* INSTANCE;
+    };
+
+#endif 
+
+/*----------------------------------------------------------------------*\
+ |*                    End                                             *|
+ \*---------------------------------------------------------------------*/