/* * EnrollInPoolOperation.hpp * * Created on: Feb 26, 2012 * Author: heber */ #ifndef ENROLLINPOOLOPERATION_HPP_ #define ENROLLINPOOLOPERATION_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "Connection.hpp" #include "Jobs/FragmentJob.hpp" #include "Operations/AsyncOperation.hpp" #include "Results/FragmentResult.hpp" #include "WorkerAddress.hpp" class EnrollInPoolOperation : public AsyncOperation { public: /// Constructor for class EnrollInPoolOperation. EnrollInPoolOperation(Connection &_connection, const WorkerAddress &_address) : AsyncOperation(std::string("enrollinpool"),_connection), address(_address), flag(Success) {} /// Destructor for class EnrollInPoolOperation ~EnrollInPoolOperation() {} enum EnrollFlag { Success, Fail }; 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); /// Handle sending choice void handle_SendChoice(const boost::system::error_code& e); /// Handle receiving flag void handle_ReceiveFlag(const boost::system::error_code& e); /// Handle received flag void handle_FinishOperation(const boost::system::error_code& e); private: //!> address to enroll with WorkerAddress address; //!> flag returned by worker pool after enroll request enum EnrollFlag flag; }; #endif /* ENROLLINPOOLOPERATION_HPP_ */