Changeset 96c83b for src


Ignore:
Timestamp:
May 17, 2012, 3:21:54 PM (13 years ago)
Author:
Frederik Heber <heber@…>
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:
25b30aa
Parents:
9948a7
git-author:
Frederik Heber <heber@…> (12/11/11 17:14:24)
git-committer:
Frederik Heber <heber@…> (05/17/12 15:21:54)
Message:

Neither FragmentController not Operation need host or service as params to Cstor anymore.

  • due to the last change these are given directly to Operation::operator(), hence we have removed them from FragmentController's and Operation's cstor.
  • removed Operation::getEndpointIterator().
  • all small controller executables have been adapted accordingly.
Location:
src/Fragmentation/Automation/Controller
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Automation/Controller/Commands/CheckResultsOperation.hpp

    r9948a7 r96c83b  
    2525public:
    2626  /// Constructor for class CheckResultsOperation.
    27   CheckResultsOperation(Connection &_connection, const std::string& _host, const std::string& _service) :
    28     Operation(_connection, _host, _service),
     27  CheckResultsOperation(Connection &_connection) :
     28    Operation(_connection),
    2929    doneJobs(0)
    30   {}
     30        {}
    3131  /// Destructor for class CheckResultsOperation
    3232  ~CheckResultsOperation() {}
  • src/Fragmentation/Automation/Controller/Commands/Operation.cpp

    r9948a7 r96c83b  
    3838 * \param _connection connection to operate on
    3939 */
    40 Operation::Operation(Connection &_connection, const std::string& _host, const std::string& _service) :
     40Operation::Operation(Connection &_connection) :
    4141    connection_(_connection),
    42     host(_host),
    43     service(_service),
    4442    Exitflag(OkFlag)
    4543{}
     
    7371}
    7472
    75 /** Internal function to resolve all possible connection endpoints.
    76  *
    77  * \return endpoint iterator of connection
    78  */
    79 boost::asio::ip::tcp::resolver::iterator Operation::getEndpointIterator()
    80 {
    81   // Resolve the host name into an IP address.
    82   boost::asio::ip::tcp::resolver resolver(connection_.socket().get_io_service());
    83   boost::asio::ip::tcp::resolver::query query(host, service);
    84   boost::asio::ip::tcp::resolver::iterator endpoint_iterator =
    85     resolver.resolve(query);
    86 
    87   return endpoint_iterator;
    88 }
    89 
    9073/** Internal function to disconnect connection_ correctly.
    9174 *
     
    9376void Operation::disconnect()
    9477{
    95   //connection_.socket().close();
     78  connection_.socket().close();
    9679}
    9780
  • src/Fragmentation/Automation/Controller/Commands/Operation.hpp

    r9948a7 r96c83b  
    2222class Operation {
    2323public:
    24   Operation(Connection &_connection, const std::string& _host, const std::string& _service);
     24  Operation(Connection &_connection);
    2525  virtual ~Operation();
    2626public:
     
    5353
    5454protected:
    55   /// internal function to resolve host name and ip address
    56   boost::asio::ip::tcp::resolver::iterator getEndpointIterator();
    57 
    5855  /// internal function to disconnect from server
    5956  void disconnect();
    60 
    61 protected:
    62   /// host name of server
    63   const std::string host;
    64 
    65   // service to connect to to
    66   const std::string service;
    6757
    6858  // exit flag of this operation
  • src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.hpp

    r9948a7 r96c83b  
    2626public:
    2727  /// Constructor for class ReceiveJobsOperation.
    28   ReceiveJobsOperation(Connection &_connection, const std::string& _host, const std::string& _service) :
    29     Operation(_connection, _host, _service) {}
     28  ReceiveJobsOperation(Connection &_connection) :
     29    Operation(_connection) {}
    3030  /// Destructor for class ReceiveJobsOperation
    3131  ~ReceiveJobsOperation() {}
  • src/Fragmentation/Automation/Controller/Commands/SendResultsOperation.hpp

    r9948a7 r96c83b  
    2626public:
    2727  /// Constructor for class SendResultsOperation.
    28   SendResultsOperation(Connection &_connection, const std::string& _host, const std::string& _service) :
    29     Operation(_connection, _host, _service) {}
     28  SendResultsOperation(Connection &_connection) :
     29    Operation(_connection) {}
    3030  /// Destructor for class SendResultsOperation
    3131  ~SendResultsOperation() {}
  • src/Fragmentation/Automation/Controller/Commands/ShutdownOperation.hpp

    r9948a7 r96c83b  
    2525public:
    2626  /// Constructor for class ShutdownOperation.
    27   ShutdownOperation(Connection &_connection, const std::string& _host, const std::string& _service) :
    28     Operation(_connection, _host, _service) {}
     27  ShutdownOperation(Connection &_connection) :
     28    Operation(_connection) {}
    2929  /// Destructor for class ShutdownOperation
    3030  ~ShutdownOperation() {}
  • src/Fragmentation/Automation/Controller/FragmentController.cpp

    r9948a7 r96c83b  
    3737 */
    3838FragmentController::FragmentController(
    39     boost::asio::io_service& io_service,
    40     const std::string& _host,
    41     const std::string& _service) :
     39    boost::asio::io_service& io_service) :
    4240    connection_(io_service),
    43     recjobs(connection_, _host, _service),
    44     checkres(connection_, _host, _service),
    45     sendres(connection_, _host, _service),
    46     shutdown(connection_, _host, _service)
     41    recjobs(connection_),
     42    checkres(connection_),
     43    sendres(connection_),
     44    shutdown(connection_)
    4745{
    4846  Info info(__FUNCTION__);
  • src/Fragmentation/Automation/Controller/FragmentController.hpp

    r9948a7 r96c83b  
    4040{
    4141public:
    42   FragmentController(boost::asio::io_service& io_service, const std::string& _host, const std::string& _service);
     42  FragmentController(boost::asio::io_service& io_service);
    4343  ~FragmentController();
    4444
  • src/Fragmentation/Automation/Controller/JobAdder.cpp

    r9948a7 r96c83b  
    5858    const int NoJobs = boost::lexical_cast<int>(argv[3]);
    5959    boost::asio::io_service io_service;
    60     FragmentController controller(io_service, argv[1], argv[2]);
     60    FragmentController controller(io_service);
    6161
    6262    LOG(1, "INFO: Creating " << NoJobs << " jobs for the server.");
  • src/Fragmentation/Automation/Controller/ResultChecker.cpp

    r9948a7 r96c83b  
    5757
    5858    boost::asio::io_service io_service;
    59     FragmentController controller(io_service, argv[1], argv[2]);
     59    FragmentController controller(io_service);
    6060
    6161    controller.checkres(argv[1], argv[2]);
  • src/Fragmentation/Automation/Controller/ResultGetter.cpp

    r9948a7 r96c83b  
    5757
    5858    boost::asio::io_service io_service;
    59     FragmentController controller(io_service, argv[1], argv[2]);
     59    FragmentController controller(io_service);
    6060
    6161    std::vector<FragmentJob> jobs;
  • src/Fragmentation/Automation/Controller/Shutdowner.cpp

    r9948a7 r96c83b  
    5757
    5858    boost::asio::io_service io_service;
    59     FragmentController controller(io_service, argv[1], argv[2]);
     59    FragmentController controller(io_service);
    6060
    6161    controller.shutdown(argv[1], argv[2]);
Note: See TracChangeset for help on using the changeset viewer.