===== SteereoClientSteering =====

==== Description ====
With this class assists you in writing your steering clients. It provides functions for connecting, making requests, and getting responses. \\
To handle responses to your requests you have to register functions for each command. You can see this in action in the [[steereo:simple_howto|Howto]].
It also manages you connections, as your client can have connections to more than one simulation.

==== Functions ====

=== Function you will need ===
  * <code cpp> SteereoConnection* startConnection (SteereoCommunicator* commu, std::string ip, std::string port, int connNr = 0) </code> connects to the simulation listening at //ip// and //port// using the [[steereocommunicator|SteereoCommunicator]] commu. It establishes a data and control connections and returns the descriptions as [[steereoconnection|SteereoConnection]]. With //connNr// you specify which number this connection has (needed when this is at least the second connection of your client). This function tries to connect until it has success. This way you can start the simulation also after the client.
  * <code cpp> void startAccepting (int connNr = 0) </code> With this your client starts accepting responses from the simulation at connection number //connNr//. 

=== Function you may also consider very useful ===
Especially if your not only using [[steerparameterclient|SteerParameterClient]] you will need these functions.
  * <code cpp> int makeRequest (request req, SteereoStream* data, int connNr = 0) </code> <code cpp> int makeRequest (std::string reqName, int connNr = 0)</code> <code cpp> int makeRequest (std::string reqName, std::string reqParam, int connNr = 0) </code> <code cpp> int makeRequest (std::string reqName, SteereoStream* data, int connNr = 0) </code> <code cpp> int makeRequest (std::string reqName, std::string reqParam, int queue, SteereoStream* data, int connNr = 0) </code> <code cpp> int makeRequest (std::string reqName, int queue, SteereoStream* data, int connNr = 0) </code> <code cpp> int makeRequest (std::string reqName, std::string reqParam, SteereoStream* data, int connNr = 0) </code> Many possibilities to make a request to the simulation at connection //connNr//. You have to specify the name of the command you request and can also give a string with parameters (separated with a space) and a [[steereostream|SteereoStream]] with additional data for the command as well as the queue number of the simulation in which the request should be inserted. You will get the ID of your request as return value.
  * <code cpp> bool hasBeenExecuted (int id) </code> Checks if the request with ID //id// has already been executed in the simulation.
  * <code cpp> void addAction (std::string forCommand, PtrToAcceptFct action) </code> Specify the function that handles the responses from //forCommand//. The function //action// returns nothing and gets a [[request|request]] structure (e.g. void myHandler(request req)). You have to take care to eventually receive data from the simulation, if //forCommand// sends some, yourself !
  * <code cpp> std::list<std::string> SteereoClientSteering::receiveSteeringMethods (int connNr) </code> Receive a list of available commands from the simulation at connection //connNr//.
  * <code cpp> void closeConnection (int connNr = 0) </code> <code cpp> void closeConnections () </code> Close either one connection or all. It is good style to close your connections, just before exiting the client.


 