1 #ifndef AESALON_GUI_PROGRAM_H
2 #define AESALON_GUI_PROGRAM_H
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"
16 class ProgramSocketThread
: public QThread
{
18 Misc::SmartPointer
<Platform::TCPSocket
> socket
;
19 Misc::SmartPointer
<Platform::Memory
> memory
;
21 ProgramSocketThread(Misc::SmartPointer
<Platform::TCPSocket
> socket
, Misc::SmartPointer
<Platform::Memory
> memory
);
22 virtual ~ProgramSocketThread() {}
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
;
39 Misc::SmartPointer
<Platform::BidirectionalPipe
> bi_pipe
;
40 Misc::SmartPointer
<ProgramSocketThread
> socket_thread
;
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; }
53 } // namespace Aesalon