User Tools

Site Tools


steereo:classes:steereosimsteering

SteereoSimSteering

Description

The name says it all. This class provides the central functions to enable steering in your simulation. An example how it is used can be seen in the Howto. It manages also the connections to the clients as well as the command queue(s).

Important Functions

Functions you will need

If these functions aren't used in your simulation, then steering is not enabled.

  •  void setCommunicator (SteereoCommunicator* newComm) 

    Sets the communicator for your SimSteering instance. It will be used for accepting connections and data transfer to and from clients.

  •  void startListening () 

    With this the simulation will start listening and thus accepting connections from clients (in an own thread so your simulations shouldn't be disturbed that much). You should have set a SteereoCommunicator before calling this function.

  •  void processQueue(int queueNumber = 0) 

    Process the requests that are stored in the queue queueNumber (usually you will have only one queue and the default value 0 is ok). You should probably put this into the simulation loop, so that the requests can be processed not to long after receiving them.

Functions that you may need

If you need some more functionality you can't ignore these functions.

  •  void registerCommand (PtrToGenerator ptr, std::string commandName) 

    With this you register your own commands under the name commandName with which this command can be requested from the clients. PtrToGenerator is the pointer to the generateNewInstance function of your command (e.g. &MyCommand::generateNewInstance).

  •  void registerSignalHandler (PtrToGenerator ptr, int sig) 

    Register your own command for the signal number sig. With this your command gets executed, when the simulation gets a signal (from the operating system or an user).

  •  void setNumberOfQueues (int nr) 

    Set the number of queues in your simulation.

steereo/classes/steereosimsteering.txt · Last modified: 2010/08/03 12:20 by hpcdjenz