===== SteereoWrapper =====

==== Description ====
The wrapper functions for Fortran 90/95 and C are contained in //steereoWrapper.cpp// and //steereoWrapper.h//.
An example for the use of it can be seen in the [[steereo:fortran_90_c#enable_steering | Fortran / C]] section.
Here I will list the available functions and their pendants.

==== Important Functions ====

=== SimSteering === 
You provide the instance you want to use usually as first parameter (//ssID//).
  * <code c> int simsteer_new_ () </code> constructs a new [[steereosimsteering|SimSteering]] instance and returns a reference to it.  
  * <code c> void simsteer_delete_ (int* ssID) </code> destroys the given SimSteering instance.
  * <code c> void simsteer_processqueue_ (int* ssID) </code> wraps //SimSteering::processQueue()//
  * <code c> void simsteer_setcommunicator_ (int* ssID, int* commID) </code> wraps //SimSteering::setCommunicator(SteereoCommunicator*)//
  * <code c> void simsteer_startlistening_ (int* ssID) </code> wraps //SimSteering::startListening//

=== ClientSteering ===
You provide the instance you want to use usually as first parameter (//csID//). The only thing that is a little bit more complicated is the registration of 
a response handler, as there are problems to pass a Fortran function. Therefore you have to specify a command, from which the execute method will serve as the
response handler.
  * <code c> int clientsteering_new_ () </code> constructs a new [[steereoclientsteering|ClientSteering]] instance and returns a reference to it.  
  * <code c> void clientsteering_delete_ (int* csID)</code> destroys the given ClientSteering instance.
  * <code c> void clientsteering_startconnection_ (int* csID, int* commID, char* ip, int* ipLength, char port, int* portLength, int* connNr)</code> wraps //ClientSteering::startConnection (SteereoCommunicator* commu, std::string ip, std::string port, int connNr)//                                
  * <code c> void clientsteering_startaccepting_ (int* csID, int* connNr) </code> wraps //ClientSteering::startAccepting (int connNr)//
  * <code c> void clientsteering_makerequest_ (int* csID, char* commandName, int* nameSize, char* params, int* paramSize, int* connNr) </code> wraps //ClientSteering::makeRequest (std::string reqName, std::string reqParam, int connNr)//
  * <code c> void clientsteering_addcommandaction_ (int* csID, char* commandName, int* nameSize, char* responseCommandName, int* responseCommandSize) </code> wraps //ClientSteering::addAction (std::string forCommand, PtrToGenerator gen)// and is the only way for Fortran to register a response handler.

=== SteereoSocketCommunicator ===
The Wrapper for [[steereosocketcommunicator|SteereoSocketCommunicator]] lets you create and delete instances.
  * <code c> int socketcommunicator_simple_new_ () </code> constructs a new //SteereoSocketCommunicator// without specifying a port. 
  * <code c> int socketcommunicator_new_ (int* port) </code> constructs a new //SteereoSocketCommunicator//.
  * <code c> void socketcommunicator_delete_ (int* commID) </code> destroys the referenced //SteereoSocketCommunicator//.

=== SteereoMPICommunicator ===
Also available is a communicator using MPI [[steereompicommunicator|SteereoMPICommunicator]], although at the moment only MPICH2 seems to support
the used MPI commands (OpenMPI has problem with MPI calls in threads, and Intel MPI hasn't implemented some of the needed commands)
  * <code c> int mpicommunicator_simple_new_ () </code> constructs a new //SteereoSocketCommunicator// without specifying a port. 
  * <code c> int mpicommunicator_new_ (int* port) </code> constructs a new //SteereoSocketCommunicator//.
  * <code c> void mpicommunicator_delete_ (int* commID) </code> destroys the referenced //SteereoSocketCommunicator//.

=== SteereoMPIIntraCommunicator ===
For internal communication inside a simulation partition a [[steereompiintracommunicator|SteereoMPIIntraCommunicator]] is at the moment the only choice.
  * <code c> int mpiintracommunicator_new_ (); </code> constructs a new //SteereoMPIIntraCommunicator// 
  * <code c> void mpiintracommunicator_delete_ (int* commID); </code> destroy the specified //SteereoMPIIntraCommunicator//.
  * <code c> void mpiintracommunicator_generateequally_ (int* commID, int* ownRank, int* partNum, int* ownSize); </code> using the given //SteereoMPIIntraCommunicator// this function (called on every process with the same partNum and ownSize values !) generates //partNum// partitions out of //ownSize// processes in total (partNum should also divide ownSize without rest)  
  * <code c> int mpiintracommunicator_amiroot_ (int* commID); </code> returns 1, if the current process is the root of its partition

=== SteereoCommand ===
Some functions to add data (and its size), that should be passed on to the specified [[steereocommand|SteereoCommand]]. 
  * <code c> void add_command_data_ (char* commandName, int* nameSize, void* dataPtr) </code>  wraps //SteereoCommand::addData (void* dataPtr)//
  * <code c> void add_command_data_and_size_ (char* commandName, int* nameSize, void* dataPtr, int* size) </code> a combination of the above two functions.
  
=== SteerParameterCommand ===
As there is no template support in Fortran you have to choose the appropriate function yourself, with which you register your parameter to [[steerparametercommand|SteerParameterCommand]].
  * <code c> void register_scalar_float_parameter_ (char* name, int* nameSize, float* val, float* min, float* max) </code> <code c> void register_scalar_double_parameter_ (char* name, int* nameSize, double* val, double* min, double* max) </code> <code c> void register_scalar_int_parameter_ (char* name, int* nameSize, int* val, int* min, int* max) </code> wrap //SteerParameterCommand::registerScalarParameter (std::string paramName, T* ptrToParam, std::string minVal, std::string maxVal)//
  * <code c> void register_array_float_parameter_ (char* name, int* nameSize, float* valArr, int* lgth) </code> <code c> void register_array_double_parameter_ (char* name, int* nameSize, double* valArr, int* lgth) </code> <code c> void register_array_int_parameter_ (char* name, int* nameSize, int* valArr, int* lgth) </code> wrap //SteereoParameterCommand::registerArrayParameter  (std::string paramName, T* ptrToParam, int arrayLength)//

=== Other Functions ===
  * <code c> void load_commands_ (int* simSteerInstance, char* path, int* pathSize) </code> loads the commands which have been compiled as a dynamic library and reside in the given path
  * <code c> void set_logger_level_ (int* lv) </code> sets the logger level, details at [[steereologger|SteereoLogger]]
  * <code c> void sleep_ (int sec) </code> wait for //sec// seconds
  