arcsappmode.h
1 /*
2  name: include/arcs/arcsappmode.h
3 
4  This file is part of ARCS - Augmented Reality Component System
5  (version 2-current), written by Jean-Yves Didier
6  for IBISC Laboratory (http://www.ibisc.univ-evry.fr)
7 
8  Copyright (C) 2013 Université d'Evry-Val d'Essonne
9 
10  This program is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program. If not, see <http://www.gnu.org/licenses/>.
22 
23 
24  Please send bugreports with examples or suggestions to
25  jean-yves.didier__at__ibisc.univ-evry.fr
26 */
27 
28 
29 #ifndef __ARCSAPPMODE_H__
30 #define __ARCSAPPMODE_H__
31 
32 //#include <QObject>
33 #include <QThread>
34 //#include <QEvent>
35 #include <QLibrary>
36 
37 //class ARCSApplicationComponent;
38 class ARCSProcess;
39 
46 {
47  public:
48  ARCSAppMode(ARCSProcess* parent);//ARCSApplicationComponent* parent);
49  virtual ~ARCSAppMode() {}
53  virtual void startHook() = 0;
57  virtual void tokenHook() = 0;
58 
62  virtual void stopHook() = 0 ;
63 
64 protected:
65  ARCSProcess* parent() { return parentProcess; }
66 
67 private:
68  ARCSProcess* parentProcess;
69 
70 };
71 
77 class ARCSAppBase : public ARCSAppMode
78 {
79 public:
80  ARCSAppBase(ARCSProcess* parent);
81  virtual ~ARCSAppBase() {}
82  virtual void startHook();
83  virtual void tokenHook();
84  virtual void stopHook();
85 };
86 
92 class ARCSAppEvent : public ARCSAppMode
93 {
94 public:
95  ARCSAppEvent(ARCSProcess* parent);
96  virtual ~ARCSAppEvent() {}
97  virtual void startHook();
98  virtual void tokenHook();
99  virtual void stopHook();
100 
101  static int eventType;
102 
103 protected:
104  virtual void initHook();
105 
106 
107 };
108 
109 
115 class ARCSAppGUI : public ARCSAppBase
116 {
117 public:
118  ARCSAppGUI(ARCSProcess* parent);
119  virtual ~ARCSAppGUI() {}
120  virtual void startHook() ;
121  virtual void tokenHook();
122  virtual void stopHook();
123 
124 protected:
125  typedef void (*VoidProto)();
126 
127  virtual void initHook();
128 
129 private:
130  QLibrary lib;
131  VoidProto init;
132  VoidProto start;
133 };
134 
135 
141 class ARCSAppThread : public QThread, public ARCSAppBase
142 {
143 public:
144  ARCSAppThread(ARCSProcess* parent);
145  virtual ~ARCSAppThread() {}
146  virtual void startHook();
147  virtual void stopHook();
148 
149 protected:
150  virtual void run();
151 };
152 
158 class ARCSAppThreadEvent : public QThread, public ARCSAppEvent
159 {
160 
161 public:
163  virtual ~ARCSAppThreadEvent() {}
164  virtual void startHook();
165  virtual void tokenHook();
166  virtual void stopHook();
167 
168 
169 protected:
170  virtual void run();
171 };
172 
173 #endif //__ARCSAPPMODE_H__
virtual void startHook()
Hook for starting applications Subclasses should reimplement this.
Definition: arcsappmode.cpp:53
virtual void stopHook()=0
Hook for stopping applications Subclasses should reimplement this.
Threaded application handler.
Definition: arcsappmode.h:141
virtual void startHook()=0
Hook for starting applications Subclasses should reimplement this.
This class is representing a process under ARCS.
Definition: arcsprocess.h:52
virtual void startHook()
Hook for starting applications Subclasses should reimplement this.
virtual void stopHook()
Hook for stopping applications Subclasses should reimplement this.
virtual void startHook()
Hook for starting applications Subclasses should reimplement this.
Definition: arcsappmode.cpp:91
virtual void startHook()
Hook for starting applications Subclasses should reimplement this.
virtual void startHook()
Hook for starting applications Subclasses should reimplement this.
virtual void tokenHook()=0
Hook for handling tokens Subclasses should reimplement this.
Base class for launching and handling ARCS applications.
Definition: arcsappmode.h:45
virtual void stopHook()
Hook for stopping applications Subclasses should reimplement this.
Event-loop based GUI application handler.
Definition: arcsappmode.h:115
virtual void tokenHook()
Hook for handling tokens Subclasses should reimplement this.
virtual void stopHook()
Hook for stopping applications Subclasses should reimplement this.
Definition: arcsappmode.cpp:66
virtual void stopHook()
Hook for stopping applications Subclasses should reimplement this.
Event-loop based application handler.
Definition: arcsappmode.h:92
virtual void tokenHook()
Hook for handling tokens Subclasses should reimplement this.
Definition: arcsappmode.cpp:61
virtual void tokenHook()
Hook for handling tokens Subclasses should reimplement this.
virtual void tokenHook()
Hook for handling tokens Subclasses should reimplement this.
virtual void stopHook()
Hook for stopping applications Subclasses should reimplement this.
Threaded and event-loop based application handler.
Definition: arcsappmode.h:158
Basic application handler.
Definition: arcsappmode.h:77