Continued ripping up the source.
[aesalon.git] / monitor / src / Initializer.h
blobd05d0b268a68c150049e760db34b7748f1d276c2
1 #ifndef AESALON_MONITOR_INITIALIZER_H
2 #define AESALON_MONITOR_INITIALIZER_H
4 #include "misc/SmartPointer.h"
5 #include "misc/Singleton.h"
6 #include "TCPServerSocket.h"
7 #include "platform/BidirectionalPipe.h"
8 #include "misc/EventQueue.h"
9 #include "ProgramManager.h"
11 namespace Aesalon {
12 namespace Monitor {
14 /** Initializer class. Basically handles initialization of the Monitor namespace. */
15 class Initializer : public Misc::Singleton<Initializer> {
16 private:
17 /** A copy of argv, used for initializing the ArgumentParser. */
18 char **argv;
19 /** The socket used to communicate with the GUI. */
20 Misc::SmartPointer<TCPServerSocket> server_socket;
21 /** The EventQueue instance; used to keep the local copy of the program's memory updated. */
22 Misc::SmartPointer<Misc::EventQueue> event_queue;
24 Misc::SmartPointer<ProgramManager> program_manager;
26 /** Initialize the aesalon monitor. */
27 void initialize();
28 /** Deinitialize the aesalon monitor. */
29 void deinitialize();
31 /** Print usage information about aesalon, including a list of all flags. */
32 void usage();
34 /** Main execution loop. */
35 void run();
37 int return_value;
38 public:
39 /** Constructor for the Initializer class. This is where the magic begins.
40 @param argv argv, as passed into main().
42 Initializer(char **argv);
43 /** Destructor for the Initializer class. Here is where the magic ends. */
44 virtual ~Initializer();
46 /** Returns a SmartPointer to the named pipe; mostly used internally but
47 public for other classes to use when required.
48 @return The named pipe created by this aesalon gdb instance.
50 Misc::SmartPointer<TCPServerSocket> get_socket() const { return server_socket; }
52 Misc::SmartPointer<ProgramManager> get_program_manager() const { return program_manager; }
53 Misc::SmartPointer<Misc::EventQueue> get_event_queue() const { return event_queue; }
55 int get_return_value() const { return return_value; }
56 void set_return_value(int new_return_value) { return_value = new_return_value; }
59 } // namespace Monitor
60 } // namespace Aesalon
62 #endif