/* * SpecificFragmentController.hpp * * Created on: Aug 27, 2012 * Author: heber */ #ifndef SPECIFICFRAGMENTCONTROLLER_HPP_ #define SPECIFICFRAGMENTCONTROLLER_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "JobMarket/Controller/FragmentController.hpp" #include "JobMarket/JobId.hpp" #include "JobMarket/Results/FragmentResult.hpp" #include #include #include /** This class extends FragmentController by some commodity functions used * within FragmentationAutomationAction. * */ class SpecificFragmentController : public FragmentController { public: SpecificFragmentController(boost::asio::io_service &_io_service) : FragmentController(_io_service), io_service(_io_service) {} virtual ~SpecificFragmentController() {} void requestIds(const size_t numberjobs); void waitforResults(const size_t NoExpectedResults); void RunService(const std::string message); /// getter and setter void setHost(const std::string &_host) { host = _host; } void setPort(const std::string &_port) { port = _port; } protected: template void getResults(std::map &IdData); private: /** Extracts specific Data type from received vector of FragmentResults. * * @param results results to extract specific Data type from * @param fragmentData on return array filled with extracted specific Data type */ template void ConvertFragmentResultTo( const std::vector &results, std::vector &fragmentData); protected: //!> hostname of the server to control std::string host; //!> port of the server to control std::string port; private: //!> reference to io_service for internal purposes boost::asio::io_service &io_service; }; #include "SpecificFragmentController_impl.hpp" #endif /* SPECIFICFRAGMENTCONTROLLER_HPP_ */