Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_Canvas_JNI / INC / CanvasNativeService.h
1 #ifndef CANVAS_NATIVE_SERVICE_H
2 #define CANVAS_NATIVE_SERVICE_H
3 #include "envCanvasJNI.h"
4 #include "CanvasNative.h"
5 #include <map>
6
7 using std::map;
8
9 /*----------------------------------------------------------------------*\
10 |* Declaration *|
11 \*---------------------------------------------------------------------*/
12
13 /*--------------------------------------*\
14 |* Public *|
15 \*-------------------------------------*/
16 /**
17 * Singleton
18 * Not thread Safe!
19 */
20 class CBI_CANVAS_JNI CanvasNativeService
21 {
22
23 /*--------------------------------------*\
24 |* Constructor *|
25 \*-------------------------------------*/
26
27 private:
28
29 CanvasNativeService();
30
31 CanvasNativeService(const CanvasNativeService& src);
32
33 /*--------------------------------------*\
34 |* Destructor *|
35 \*-------------------------------------*/
36
37 public:
38
39 virtual ~CanvasNativeService();
40
41 /*--------------------------------------*\
42 |* Methodes *|
43 \*-------------------------------------*/
44
45 public:
46
47 int registerCanvasNative(CanvasNative* ptrCanvasNative);
48
49 void unregister(int id);
50
51 /*--------------------------------------*\
52 |* Get *|
53 \*-------------------------------------*/
54
55 public :
56
57 CanvasNative* getCanvasNative(int id);
58
59 static CanvasNativeService* getInstance();
60
61 /*--------------------------------------*\
62 |* Attributs *|
63 \*-------------------------------------*/
64
65 private:
66
67 //Tools
68 map<int, CanvasNative*> mapIdNativeCanvas;
69
70 //Singleton
71 static CanvasNativeService* INSTANCE;
72 };
73
74 #endif
75
76 /*----------------------------------------------------------------------*\
77 |* End *|
78 \*---------------------------------------------------------------------*/