phaser-server  0.0.2
commander.h
Go to the documentation of this file.
1 #ifndef COMMANDER_H
2 #define COMMANDER_H
8 #include "Socket.h"
9 #include <queue>
10 class JSONValue;
11 
16 class Commander
17 { public:
18  Commander(const std::string &, int);
19  void Command(const std::vector<std::string> &);
20  void Interactive(void);
21  void SimplePlan(void);
22  void Apply(const std::vector<std::string> &);
23 
24  private:
25  bool IsResponse(const std::string &);
26  std::string GetFromServer(void);
27  static std::string Encode(const std::string &);
28  void OutputResponse(const std::string &);
29  std::string MakeInfo(const std::string &, const JSONValue *);
30 
31  private:
32  void Execute(const std::string &);
33  cpplib::Connection m_con;
34  std::queue<std::string> m_queue;
35  std::string m_partial;
36 };
37 
38 #endif
A command session to the server.
Definition: commander.h:17
void Interactive(void)
Accept commands from stdin.
Definition: commander.cpp:116
Commander(const std::string &, int)
Create a server command session.
Definition: commander.cpp:36
void Apply(const std::vector< std::string > &)
Apply phase corrections.
Definition: commander.cpp:154
void SimplePlan(void)
Send a simple Cavity phasing plan to the server.
Definition: commander.cpp:143
void Command(const std::vector< std::string > &)
Command the server.
Definition: commander.cpp:106