source: src/JobMarket/Operations/Controllers/ReceiveResultsOperation.hpp@ 404d2b

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_JobMarket Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 404d2b was 404d2b, checked in by Frederik Heber <heber@…>, 8 years ago

Squashed 'ThirdParty/JobMarket/' content from commit e194722

git-subtree-dir: ThirdParty/JobMarket
git-subtree-split: e19472277e62c493f6c10f1483fe21e64c1039e9

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 * ReceiveResultsOperation.hpp
3 *
4 * Created on: Dec 11, 2011
5 * Author: heber
6 */
7
8#ifndef FRAGMENTCONTROLLER_RECEIVERESULTSOPERATION_HPP_
9#define FRAGMENTCONTROLLER_RECEIVERESULTSOPERATION_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 <set>
18#include <string>
19#include <vector>
20
21#include "JobMarket/Connection.hpp"
22#include "JobMarket/Operations/AsyncOperation.hpp"
23#include "JobMarket/Results/FragmentResult.hpp"
24#include "JobMarket/types.hpp"
25
26class ReceiveResultsOperation : public AsyncOperation {
27public:
28 /// Constructor for class ReceiveResultsOperation.
29 ReceiveResultsOperation(Connection &_connection,
30 const boost::function<void ()> _callback_on_success = NoOpCallback,
31 const boost::function<void ()> _callback_on_failure = NoOpCallback) :
32 AsyncOperation(std::string("receiveresults"), _connection, _callback_on_success, _callback_on_failure),
33 jobids(emptyids)
34 {}
35 /// Destructor for class ReceiveResultsOperation
36 ~ReceiveResultsOperation() {}
37
38public:
39 // virtual function pointer to the connection handler
40 virtual void handle_connect(const boost::system::error_code& e,
41 boost::asio::ip::tcp::resolver::iterator endpoint_iterator);
42
43 /// Callback function when sending desired job ids.
44 void handle_SendJobIds(const boost::system::error_code& e);
45
46 /// Callback function when results are about to be received.
47 void handle_ReceivingResults(const boost::system::error_code& e);
48
49 /// Callback function when results have been received.
50 void handle_ReceivedResults(const boost::system::error_code& e);
51
52 /// Getter for results
53 std::vector<FragmentResult::ptr> getResults();
54
55 /// Setter for internal vector of jobids to check
56 void setJobIds(const std::set<JobId_t> &_jobids)
57 { const_cast<std::set<JobId_t> &>(jobids) = _jobids; }
58
59protected:
60 //!> internal ref to the jobids to check
61 const std::set<JobId_t> &jobids;
62
63 /// bunch of results
64 std::vector<FragmentResult::ptr> results;
65
66private:
67 //!> internal empty ids vector to use as default ref
68 static const std::set<JobId_t> emptyids;
69
70};
71
72#endif /* FRAGMENTCONTROLLER_RECEIVERESULTSOPERATION_HPP_ */
Note: See TracBrowser for help on using the repository browser.