Changed the breakpoint system to use the afore-mentioned system.
[aesalon.git] / src / gui / Program.h
blob4d868a8a6553f73d6e3bc21acf5b1689ddb1fd18
1 #ifndef AESALON_GUI_PROGRAM_H
2 #define AESALON_GUI_PROGRAM_H
4 #include <QThread>
6 #include "platform/EventQueue.h"
7 #include "platform/TCPSocket.h"
8 #include "platform/Memory.h"
9 #include "platform/BidirectionalPipe.h"
11 #include "misc/SmartPointer.h"
13 namespace Aesalon {
14 namespace GUI {
16 class ProgramSocketThread : public QThread {
17 private:
18 Misc::SmartPointer<Platform::TCPSocket> socket;
19 Misc::SmartPointer<Platform::Memory> memory;
20 public:
21 ProgramSocketThread(Misc::SmartPointer<Platform::TCPSocket> socket, Misc::SmartPointer<Platform::Memory> memory);
22 virtual ~ProgramSocketThread() {}
23 protected:
24 void run();
28 class Program {
29 private:
30 Misc::SmartPointer<Platform::EventQueue> event_queue;
31 Misc::SmartPointer<Platform::Memory> memory;
32 Misc::SmartPointer<Platform::TCPSocket> socket;
34 std::string executable;
35 std::string arguments;
36 int port;
37 bool in_xterm;
39 Misc::SmartPointer<Platform::BidirectionalPipe> bi_pipe;
40 Misc::SmartPointer<ProgramSocketThread> socket_thread;
41 public:
42 Program();
43 virtual ~Program() {}
45 std::string get_executable() const { return executable; }
46 std::string get_arguments() const { return arguments; }
47 bool is_in_xterm() const { return in_xterm; }
49 bool is_running() const { if(bi_pipe.is_valid()) return bi_pipe->is_open(); return false; }
52 } // namespace GUI
53 } // namespace Aesalon
55 #endif