Fail* directories reorganized, Code-cleanup (-> coding-style), Typos+comments fixed.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1321 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
adrian
2012-06-08 20:09:43 +00:00
parent d474a5b952
commit 2575604b41
866 changed files with 1848 additions and 1879 deletions

View File

@ -0,0 +1,57 @@
#ifndef __JOB_CLIENT_H__
#define __JOB_CLIENT_H__
#include <string>
#include <ctime>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
#include "comm/SocketComm.hpp"
#include "comm/ExperimentData.hpp"
#include "comm/msg/FailControlMessage.pb.h"
#include "config/FailConfig.hpp"
namespace fail {
/**
* \class JobClient
*
* \brief Manages communication with JobServer
* The Minion's JobClient requests ExperimentData and returns results.
*/
class JobClient {
private:
std::string m_server;
int m_server_port;
struct hostent* m_server_ent;
int m_sockfd;
bool connectToServer();
FailControlMessage_Command tryToGetExperimentData(ExperimentData& exp);
public:
JobClient(const std::string& server = "localhost", int port = 1111);
/**
* Receive experiment data set from (remote) JobServer
* The caller (experiment developer) is responsible for
* allocating his ExperimentData object.
*
* @param exp Reference to a ExperimentData object allocated by the caller!
* @return \c true if parameter have been received and put into \c exp, \c false else.
*/
bool getParam(ExperimentData& exp);
/**
* Send back experiment result to the (remote) JobServer
* The caller (experiment developer) is responsible for
* destroying his ExperimentData object afterwards.
*
* @param result Reference to the ExperimentData holding result values
* @return \c true Result successfully sent, \c false else.
*/
bool sendResult(ExperimentData& result);
};
} // end-of-namespace: fail
#endif // __JOB_CLIENT_H__