Changeset f98c8e for src


Ignore:
Timestamp:
Jun 29, 2012, 8:01:45 AM (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:
7dd8bc
Parents:
fe95b7
git-author:
Frederik Heber <heber@…> (03/04/12 15:55:32)
git-committer:
Frederik Heber <heber@…> (06/29/12 08:01:45)
Message:

Renamed Operation -> AsyncOperation in file and class.

Location:
src/Fragmentation/Automation
Files:
20 edited
2 moved

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Automation/Controller/CommandRegistry.cpp

    rfe95b7 rf98c8e  
    3434{}
    3535
    36 CONSTRUCT_REGISTRY(Operation)
     36CONSTRUCT_REGISTRY(AsyncOperation)
  • src/Fragmentation/Automation/Controller/CommandRegistry.hpp

    rfe95b7 rf98c8e  
    1414#endif
    1515
    16 #include "Controller/Commands/Operation.hpp"
     16#include "Controller/Commands/AsyncOperation.hpp"
    1717#include "CodePatterns/Registry.hpp"
    1818
    19 class CommandRegistry : public Registry<Operation>
     19class CommandRegistry : public Registry<AsyncOperation>
    2020{
    2121public:
  • src/Fragmentation/Automation/Controller/Commands/AsyncOperation.cpp

    rfe95b7 rf98c8e  
    77
    88/*
    9  * Operation.cpp
     9 * AsyncOperation.cpp
    1010 *
    1111 *  Created on: Nov 11, 2011
     
    3030#include "CodePatterns/Log.hpp"
    3131
    32 #include "Controller/Commands/Operation.hpp"
     32#include "Controller/Commands/AsyncOperation.hpp"
    3333
    3434
    35 /** Constructor for class Operation.
     35/** Constructor for class AsyncOperation.
    3636 *
    3737 * \param _name name for this Operation for retrieval from a registry
    3838 * \param _connection connection to operate on
    3939 */
    40 Operation::Operation(const std::string &_name, Connection &_connection) :
     40AsyncOperation::AsyncOperation(const std::string &_name, Connection &_connection) :
    4141    connection_(_connection),
    4242    name(_name),
     
    4444{}
    4545
    46 /** Destructor for class Operation.
     46/** Destructor for class AsyncOperation.
    4747 *
    4848 */
    49 Operation::~Operation()
     49AsyncOperation::~AsyncOperation()
    5050{}
    5151
     
    5454 * \param e error code if something went wrong
    5555 */
    56 void Operation::handle_FinishOperation(const boost::system::error_code& e)
     56void AsyncOperation::handle_FinishOperation(const boost::system::error_code& e)
    5757{
    5858  Info info(__FUNCTION__);
    5959  if (!e)
    6060  {
    61     LOG(1, "INFO: Operation completed.");
     61    LOG(1, "INFO: AsyncOperation completed.");
    6262  }
    6363  else
     
    7676 *
    7777 */
    78 void Operation::disconnect()
     78void AsyncOperation::disconnect()
    7979{
    8080  connection_.socket().close();
    8181}
    8282
    83 void Operation::operator()(const std::string& _host, const std::string& _service)
     83void AsyncOperation::operator()(const std::string& _host, const std::string& _service)
    8484{
    8585  Info info(__FUNCTION__);
     
    9494  std::cout << "Connecting to endpoint " << endpoint << " ..." << std::endl;
    9595  connection_.socket().async_connect(endpoint,
    96     boost::bind(&Operation::handle_connect, this,
     96    boost::bind(&AsyncOperation::handle_connect, this,
    9797      boost::asio::placeholders::error, ++endpoint_iterator));
    9898}
  • src/Fragmentation/Automation/Controller/Commands/AsyncOperation.hpp

    rfe95b7 rf98c8e  
    11/*
    2  * Operation.hpp
     2 * AsyncOperation.hpp
    33 *
    44 *  Created on: Nov 11, 2011
     
    66 */
    77
    8 #ifndef FRAGMENTCONTROLLER_OPERATION_HPP_
    9 #define FRAGMENTCONTROLLER_OPERATION_HPP_
     8#ifndef FRAGMENTCONTROLLER_ASYNCOPERATION_HPP_
     9#define FRAGMENTCONTROLLER_ASYNCOPERATION_HPP_
    1010
    1111// include config.h
     
    2020#include "Connection.hpp"
    2121
    22 class Operation {
     22class AsyncOperation {
    2323public:
    24   Operation(const std::string &_name, Connection &_connection);
    25   virtual ~Operation();
     24  AsyncOperation(const std::string &_name, Connection &_connection);
     25  virtual ~AsyncOperation();
    2626public:
    2727  /// The Connection to the server.
     
    6868};
    6969
    70 #endif /* FRAGMENTCONTROLLER_OPERATION_HPP_ */
     70#endif /* FRAGMENTCONTROLLER_ASYNCOPERATION_HPP_ */
  • src/Fragmentation/Automation/Controller/Commands/CheckResultsOperation.hpp

    rfe95b7 rf98c8e  
    1919#include "Connection.hpp"
    2020
    21 #include "Controller/Commands/Operation.hpp"
     21#include "Controller/Commands/AsyncOperation.hpp"
    2222
    2323/** This Operations requests number of present jobs and present results (done
     
    2525 *
    2626 */
    27 class CheckResultsOperation : public Operation  {
     27class CheckResultsOperation : public AsyncOperation  {
    2828public:
    2929  /// Constructor for class CheckResultsOperation.
    3030  CheckResultsOperation(Connection &_connection) :
    31     Operation(std::string("checkresults"), _connection),
     31    AsyncOperation(std::string("checkresults"), _connection),
    3232    jobInfo((size_t)2, 0)
    3333        {}
  • src/Fragmentation/Automation/Controller/Commands/EnrollInPoolOperation.cpp

    rfe95b7 rf98c8e  
    9191    LOG(2, "DEBUG: Enrollment failed.");
    9292
    93   Operation::handle_FinishOperation(e);
     93  AsyncOperation::handle_FinishOperation(e);
    9494}
  • src/Fragmentation/Automation/Controller/Commands/EnrollInPoolOperation.hpp

    rfe95b7 rf98c8e  
    2121#include "Connection.hpp"
    2222
    23 #include "Controller/Commands/Operation.hpp"
     23#include "Controller/Commands/AsyncOperation.hpp"
    2424#include "Jobs/FragmentJob.hpp"
    2525#include "Results/FragmentResult.hpp"
    2626#include "WorkerAddress.hpp"
    2727
    28 class EnrollInPoolOperation : public Operation  {
     28class EnrollInPoolOperation : public AsyncOperation  {
    2929public:
    3030  /// Constructor for class EnrollInPoolOperation.
    3131  EnrollInPoolOperation(Connection &_connection, const WorkerAddress &_address) :
    32     Operation(std::string("enrollinpool"),_connection),
     32    AsyncOperation(std::string("enrollinpool"),_connection),
    3333    address(_address),
    3434    flag(Success)
  • src/Fragmentation/Automation/Controller/Commands/GetNextJobIdOperation.cpp

    rfe95b7 rf98c8e  
    101101
    102102  // and finish operation
    103   Operation::handle_FinishOperation(e);
     103  AsyncOperation::handle_FinishOperation(e);
    104104}
    105105
  • src/Fragmentation/Automation/Controller/Commands/GetNextJobIdOperation.hpp

    rfe95b7 rf98c8e  
    1818#include "Connection.hpp"
    1919
    20 #include "Controller/Commands/Operation.hpp"
     20#include "Controller/Commands/AsyncOperation.hpp"
    2121#include "JobId.hpp"
    2222#include "types.hpp"
     
    2626 *
    2727 */
    28 class GetNextJobIdOperation : public Operation  {
     28class GetNextJobIdOperation : public AsyncOperation  {
    2929public:
    3030  /// Constructor for class GetNextJobIdOperation.
    3131  GetNextJobIdOperation(Connection &_connection) :
    32     Operation(std::string("getnextjobid"), _connection),
     32    AsyncOperation(std::string("getnextjobid"), _connection),
    3333    nextid(JobId::IllegalJob)
    3434  {}
  • src/Fragmentation/Automation/Controller/Commands/ObtainJobOperation.cpp

    rfe95b7 rf98c8e  
    6666  LOG(1, "INFO: Received job #" << job->getId() << ".");
    6767
    68   Operation::handle_FinishOperation(e);
     68  AsyncOperation::handle_FinishOperation(e);
    6969}
  • src/Fragmentation/Automation/Controller/Commands/ObtainJobOperation.hpp

    rfe95b7 rf98c8e  
    2121#include "Connection.hpp"
    2222
    23 #include "Controller/Commands/Operation.hpp"
     23#include "Controller/Commands/AsyncOperation.hpp"
    2424#include "Jobs/FragmentJob.hpp"
    2525#include "Results/FragmentResult.hpp"
    2626
    27 class ObtainJobOperation : public Operation  {
     27class ObtainJobOperation : public AsyncOperation  {
    2828public:
    2929  /// Constructor for class ObtainJobOperation.
    3030  ObtainJobOperation(Connection &_connection) :
    31     Operation(std::string("obtainjob"),_connection) {}
     31    AsyncOperation(std::string("obtainjob"),_connection) {}
    3232  /// Destructor for class ObtainJobOperation
    3333  ~ObtainJobOperation() {}
  • src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.cpp

    rfe95b7 rf98c8e  
    107107  jobs.clear();
    108108
    109   Operation::handle_FinishOperation(e);
     109  AsyncOperation::handle_FinishOperation(e);
    110110}
    111111
  • src/Fragmentation/Automation/Controller/Commands/ReceiveJobsOperation.hpp

    rfe95b7 rf98c8e  
    2121#include "Jobs/FragmentJob.hpp"
    2222
    23 #include "Controller/Commands/Operation.hpp"
     23#include "Controller/Commands/AsyncOperation.hpp"
    2424
    25 class ReceiveJobsOperation : public Operation {
     25class ReceiveJobsOperation : public AsyncOperation {
    2626public:
    2727  /// Constructor for class ReceiveJobsOperation.
    2828  ReceiveJobsOperation(Connection &_connection) :
    29     Operation(std::string("receivejobs"), _connection) {}
     29    AsyncOperation(std::string("receivejobs"), _connection) {}
    3030  /// Destructor for class ReceiveJobsOperation
    3131  ~ReceiveJobsOperation() {}
  • src/Fragmentation/Automation/Controller/Commands/SendJobToWorkerOperation.hpp

    rfe95b7 rf98c8e  
    2020#include "Connection.hpp"
    2121
    22 #include "Controller/Commands/Operation.hpp"
     22#include "Controller/Commands/AsyncOperation.hpp"
    2323#include "Jobs/FragmentJob.hpp"
    2424#include "Jobs/SystemCommandJob.hpp"
    2525#include "WorkerAddress.hpp"
    2626
    27 class SendJobToWorkerOperation : public Operation  {
     27class SendJobToWorkerOperation : public AsyncOperation  {
    2828public:
    2929  /// Constructor for class SendJobToWorkerOperation.
    3030  SendJobToWorkerOperation(Connection &_connection) :
    31     Operation(std::string("sendjobtoworker"),_connection),
     31    AsyncOperation(std::string("sendjobtoworker"),_connection),
    3232    job( new SystemCommandJob(std::string("/bin/true"), std::string("donothing"), JobId::NoJob) )
    3333  {}
  • src/Fragmentation/Automation/Controller/Commands/SendResultsOperation.cpp

    rfe95b7 rf98c8e  
    105105  LOG(1, "INFO: Received "+toString(results.size())+" results.");
    106106
    107   Operation::handle_FinishOperation(e);
     107  AsyncOperation::handle_FinishOperation(e);
    108108}
    109109
  • src/Fragmentation/Automation/Controller/Commands/SendResultsOperation.hpp

    rfe95b7 rf98c8e  
    2121#include "Results/FragmentResult.hpp"
    2222
    23 #include "Controller/Commands/Operation.hpp"
     23#include "Controller/Commands/AsyncOperation.hpp"
    2424
    25 class SendResultsOperation : public Operation  {
     25class SendResultsOperation : public AsyncOperation  {
    2626public:
    2727  /// Constructor for class SendResultsOperation.
    2828  SendResultsOperation(Connection &_connection) :
    29     Operation(std::string("sendresults"), _connection) {}
     29    AsyncOperation(std::string("sendresults"), _connection) {}
    3030  /// Destructor for class SendResultsOperation
    3131  ~SendResultsOperation() {}
  • src/Fragmentation/Automation/Controller/Commands/ShutdownOperation.hpp

    rfe95b7 rf98c8e  
    2020#include "Connection.hpp"
    2121
    22 #include "Controller/Commands/Operation.hpp"
     22#include "Controller/Commands/AsyncOperation.hpp"
    2323
    24 class ShutdownOperation : public Operation  {
     24class ShutdownOperation : public AsyncOperation  {
    2525public:
    2626  /// Constructor for class ShutdownOperation.
    2727  ShutdownOperation(Connection &_connection) :
    28     Operation(std::string("shutdown"),_connection) {}
     28    AsyncOperation(std::string("shutdown"),_connection) {}
    2929  /// Destructor for class ShutdownOperation
    3030  ~ShutdownOperation() {}
  • src/Fragmentation/Automation/Controller/Commands/SubmitResultOperation.cpp

    rfe95b7 rf98c8e  
    8989  if (!e) {
    9090    LOG(1, "INFO: result #" << result->getId() << " sent.");
    91     Operation::handle_FinishOperation(e);
     91    AsyncOperation::handle_FinishOperation(e);
    9292  } else {
    9393    // An error occurred. Log it and return. Since we are not starting a new
  • src/Fragmentation/Automation/Controller/Commands/SubmitResultOperation.hpp

    rfe95b7 rf98c8e  
    2121#include "Connection.hpp"
    2222
    23 #include "Controller/Commands/Operation.hpp"
     23#include "Controller/Commands/AsyncOperation.hpp"
    2424#include "Jobs/FragmentJob.hpp"
    2525#include "Results/FragmentResult.hpp"
    2626#include "WorkerAddress.hpp"
    2727
    28 class SubmitResultOperation : public Operation  {
     28class SubmitResultOperation : public AsyncOperation  {
    2929public:
    3030  /// Constructor for class SubmitResultOperation.
    3131  SubmitResultOperation(Connection &_connection, const WorkerAddress &_address) :
    32     Operation(std::string("submitresult"),_connection),
     32    AsyncOperation(std::string("submitresult"),_connection),
    3333    result( new FragmentResult(JobId::NoJob, std::string("EmptyResult")) ),
    3434    address(_address),
  • src/Fragmentation/Automation/Controller/FragmentController.cpp

    rfe95b7 rf98c8e  
    2828
    2929#include "Controller/FragmentController.hpp"
    30 #include "Controller/Commands/Operation.hpp"
    3130#include "Controller/Commands/CheckResultsOperation.hpp"
    3231#include "Controller/Commands/GetNextJobIdOperation.hpp"
  • src/Fragmentation/Automation/Makefile.am

    rfe95b7 rf98c8e  
    4343
    4444FRAGMENTATIONCOMMANDSSOURCE = \
     45  Controller/Commands/AsyncOperation.cpp \
    4546  Controller/Commands/CheckResultsOperation.cpp \
    4647  Controller/Commands/EnrollInPoolOperation.cpp \
    4748  Controller/Commands/GetNextJobIdOperation.cpp \
    4849  Controller/Commands/ObtainJobOperation.cpp \
    49   Controller/Commands/Operation.cpp \
    5050  Controller/Commands/ReceiveJobsOperation.cpp \
    5151  Controller/Commands/SendJobToWorkerOperation.cpp \
     
    5656FRAGMENTATIONCOMMANDSHEADER = \
    5757  ControllerChoices.hpp \
     58  Controller/Commands/AsyncOperation.hpp \
    5859  Controller/Commands/CheckResultsOperation.hpp \
    5960  Controller/Commands/EnrollInPoolOperation.hpp \
    6061  Controller/Commands/GetNextJobIdOperation.hpp \
    6162  Controller/Commands/ObtainJobOperation.hpp \
    62   Controller/Commands/Operation.hpp \
    6363  Controller/Commands/ReceiveJobsOperation.hpp \
    6464  Controller/Commands/SendJobToWorkerOperation.hpp \
  • src/Fragmentation/Automation/Pool/PoolWorker.cpp

    rfe95b7 rf98c8e  
    6969  enrollOp(connection_, address),
    7070  submitOp(connection_, address),
    71   submitresult(boost::bind(&Operation::operator(),
     71  submitresult(boost::bind(&AsyncOperation::operator(),
    7272      boost::ref(submitOp),
    7373      _host, _service))
Note: See TracChangeset for help on using the changeset viewer.