/* * WorkOnJobOperation.hpp * * Created on: 22.02.2012 * Author: heber */ #ifndef WORKONJOBOPERATION_HPP_ #define WORKONJOBOPERATION_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "Connection.hpp" #include "Controller/Commands/Operation.hpp" #include "Jobs/FragmentJob.hpp" #include "Results/FragmentResult.hpp" class WorkOnJobOperation : public Operation { public: /// Constructor for class WorkOnJobOperation. WorkOnJobOperation(Connection &_connection) : Operation(std::string("workonjob"),_connection) {} /// Destructor for class WorkOnJobOperation ~WorkOnJobOperation() {} public: enum { OkFlag = 0, ErrorFlag = 1 }; /** Returns the flag of the handled operation. * */ size_t getFlag() const { return exitflag; } protected: // virtual function pointer to the connection handler void handle_connect(const boost::system::error_code& e, boost::asio::ip::tcp::resolver::iterator endpoint_iterator); /// Callback function when job has been received. void handle_ReceiveJob(const boost::system::error_code& e); /// Callback function when result has been sent. void handle_SendResult(const boost::system::error_code& e); private: // static entity of an empty result static FragmentResult::ptr EmptyResult; /// The data received from the server. FragmentJob::ptr job; /// exit flag size_t exitflag; }; #endif /* WORKONJOBOPERATION_HPP_ */