/* * ReceiveJobsOperation.hpp * * Created on: Dec 11, 2011 * Author: heber */ #ifndef FRAGMENTCONTROLLER_RECEIVEJOBSOPERATION_HPP_ #define FRAGMENTCONTROLLER_RECEIVEJOBSOPERATION_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "Connection.hpp" #include "Jobs/FragmentJob.hpp" #include "Controller/Commands/AsyncOperation.hpp" class ReceiveJobsOperation : public AsyncOperation { public: /// Constructor for class ReceiveJobsOperation. ReceiveJobsOperation(Connection &_connection) : AsyncOperation(std::string("receivejobs"), _connection) {} /// Destructor for class ReceiveJobsOperation ~ReceiveJobsOperation() {} public: // virtual function pointer to the connection handler virtual void handle_connect(const boost::system::error_code& e, boost::asio::ip::tcp::resolver::iterator endpoint_iterator); /// Callback function when bunch of jobs have been sent. void handle_SendJobs(const boost::system::error_code& e); /// Setter for jobs void addJobs(const std::vector &jobs); /** Getter for number of jobs present in the queue. * * \return jobs.size() */ size_t getPresentJobs() const { return jobs.size(); } protected: void handle_FinishOperation(const boost::system::error_code& e); /// bunch of jobs std::vector jobs; }; #endif /* FRAGMENTCONTROLLER_RECEIVEJOBSOPERATION_HPP_ */