source: src/JobMarket/Operations/Controllers/CheckResultsOperation.hpp@ d69bfc

Last change on this file since d69bfc was d69bfc, checked in by Frederik Heber <heber@…>, 14 years ago

Moved all Fragmentation/Automation into new subpackage JobMarket.

  • adapted most files (which have been copied from sub-package LinearAlgebra).
  • adapted all Makefile.ams to splitting.
  • unit tests are ok.
  • there is one very strange issue: Whereas for LinearAlgebra in its header files a prefix of "LinearAlgebra/" is _not_ required (and even has been removed when LinearAlgebra was placed in its own folder), the same does not hold for "JobMarket/". Here, we have to use both includes, one with the prefix and one without.
  • NOTE: We force libJobMarket to be linked with c++ linker via dummy.cxx file.
  • Removed all reference to FRAGMENT... in JobMarket's Makefile.am.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 * CheckResultsOperation.hpp
3 *
4 * Created on: Dec 11, 2011
5 * Author: heber
6 */
7
8#ifndef FRAGMENTCONTROLLER_CHECKRESULTSOPERATION_HPP_
9#define FRAGMENTCONTROLLER_CHECKRESULTSOPERATION_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <boost/asio.hpp>
17#include <string>
18
19#include "Connection.hpp"
20
21#include "Operations/AsyncOperation.hpp"
22
23/** This Operations requests number of present jobs and present results (done
24 * jobs) from the server.
25 *
26 */
27class CheckResultsOperation : public AsyncOperation {
28public:
29 /// Constructor for class CheckResultsOperation.
30 CheckResultsOperation(Connection &_connection,
31 const boost::function<void ()> &_callback_on_success = NoOpCallback,
32 const boost::function<void ()> &_callback_on_failure = NoOpCallback) :
33 AsyncOperation(std::string("checkresults"), _connection, _callback_on_success, _callback_on_failure),
34 jobInfo((size_t)2, 0)
35 {}
36 /// Destructor for class CheckResultsOperation
37 ~CheckResultsOperation() {}
38
39public:
40 // virtual function pointer to the connection handler
41 virtual void handle_connect(const boost::system::error_code& e,
42 boost::asio::ip::tcp::resolver::iterator endpoint_iterator);
43
44 /// Callback function when doneJobs have been received.
45 void handle_ReceiveJobInfo(const boost::system::error_code& e);
46
47 /// Getter for presentJobs
48 size_t getPresentJobs() const;
49
50 /// Getter for doneJobs
51 size_t getDoneJobs() const;
52
53protected:
54 /// current jobs left to calculate and currently calculated results
55 std::vector<size_t> jobInfo;
56};
57
58#endif /* FRAGMENTCONTROLLER_CHECKRESULTSOPERATION_HPP_ */
Note: See TracBrowser for help on using the repository browser.