- Timestamp:
- May 17, 2012, 3:21:15 PM (13 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 167b63
- Parents:
- 1dc209
- git-author:
- Frederik Heber <heber@…> (12/11/11 16:00:42)
- git-committer:
- Frederik Heber <heber@…> (05/17/12 15:21:15)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/Controller/FragmentController.cpp
r1dc209 r73d6fc 35 35 #include "ControllerChoices.hpp" 36 36 37 #include "FragmentController.hpp" 37 #include "Controller/FragmentController.hpp" 38 #include "Controller/Commands/Operation.hpp" 38 39 39 40 /** Constructor of class FragmentController. … … 64 65 {} 65 66 66 /** Constructor for class Operation.67 *68 * \param _connection connection to operate on69 */70 FragmentController::Operation::Operation(Connection &_connection, const std::string& _host, const std::string& _service) :71 connection_(_connection),72 host(_host),73 service(_service),74 Exitflag(OkFlag)75 {}76 77 /** Destructor for class Operation.78 *79 */80 FragmentController::Operation::~Operation()81 {}82 83 67 /** Handle connect operation to receive jobs from controller 84 68 * … … 224 208 } 225 209 226 /** Callback function when an operation has been completed.227 *228 * \param e error code if something went wrong229 */230 void FragmentController::Operation::handle_FinishOperation(const boost::system::error_code& e)231 {232 Info info(__FUNCTION__);233 if (!e)234 {235 LOG(1, "INFO: Operation completed.");236 }237 else238 {239 // An error occurred.240 Exitflag = ErrorFlag;241 ELOG(1, e.message());242 }243 244 // Since we are not starting a new operation the io_service will run out of245 // work to do and the client will exit.246 }247 248 210 /** Callback function when jobs have been sent. 249 211 * … … 260 222 LOG(1, "INFO: Sending "+toString(jobs.size())+" jobs ..."); 261 223 connection_.async_write(jobs, 262 boost::bind(& FragmentController::ReceiveJobsOperation::handle_FinishOperation, this,224 boost::bind(&ReceiveJobsOperation::handle_FinishOperation, this, 263 225 boost::asio::placeholders::error)); 264 226 } … … 326 288 LOG(1, "INFO: Checking number of done jobs ..."); 327 289 connection_.async_read(doneJobs, 328 boost::bind(& FragmentController::Operation::handle_FinishOperation, this,290 boost::bind(&Operation::handle_FinishOperation, this, 329 291 boost::asio::placeholders::error)); 330 292 } … … 335 297 ELOG(1, e.message()); 336 298 } 337 }338 339 /** Internal function to resolve all possible connection endpoints.340 *341 * \return endpoint iterator of connection342 */343 boost::asio::ip::tcp::resolver::iterator FragmentController::Operation::getEndpointIterator()344 {345 // Resolve the host name into an IP address.346 boost::asio::ip::tcp::resolver resolver(connection_.socket().get_io_service());347 boost::asio::ip::tcp::resolver::query query(host, service);348 boost::asio::ip::tcp::resolver::iterator endpoint_iterator =349 resolver.resolve(query);350 351 return endpoint_iterator;352 299 } 353 300 … … 424 371 } 425 372 426 /** Internal function to disconnect connection_ correctly.427 *428 */429 void FragmentController::Operation::disconnect()430 {431 //connection_.socket().close();432 }433 434 373 /** Place number of jobs into this controller. 435 374 *
Note:
See TracChangeset
for help on using the changeset viewer.