Changeset af3aed for src/Fragmentation/Automation/Connection.hpp
- Timestamp:
- May 4, 2012, 2:17:20 PM (14 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, Candidate_v1.7.0, 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:
- 926a49
- Parents:
- c6bcd0
- git-author:
- Frederik Heber <heber@…> (11/18/11 20:29:36)
- git-committer:
- Frederik Heber <heber@…> (05/04/12 14:17:20)
- File:
-
- 1 moved
-
src/Fragmentation/Automation/Connection.hpp (moved) (moved from src/Fragmentation/Automation/connection.hpp ) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/Automation/Connection.hpp
rc6bcd0 raf3aed 1 // 2 // connection.hpp 3 // ~~~~~~~~~~~~~~ 4 // 5 // Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 // 7 // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 // 1 /* 2 * Connection.hpp 3 * 4 * Created on: Oct 21, 2011 5 * Author: heber 6 */ 10 7 11 #ifndef SERIALIZATION_CONNECTION_HPP 12 #define SERIALIZATION_CONNECTION_HPP 8 #ifndef CONNECTION_HPP_ 9 #define CONNECTION_HPP_ 10 11 // include config.h 12 #ifdef HAVE_CONFIG_H 13 #include <config.h> 14 #endif 15 16 #include <boost/archive/text_iarchive.hpp> 17 #include <boost/archive/text_oarchive.hpp> 13 18 14 19 #include <boost/asio.hpp> 15 #include <boost/archive/text_iarchive.hpp>16 #include <boost/archive/text_oarchive.hpp>17 20 #include <boost/bind.hpp> 18 21 #include <boost/shared_ptr.hpp> … … 23 26 #include <vector> 24 27 25 /// The connection class provides serialization primitives on top of a socket. 26 /** 28 /** The Connection class provides serialization primitives on top of a socket. 27 29 * Each message sent using this class consists of: 28 30 * @li An 8-byte header containing the length of the serialized data in … … 30 32 * @li The serialized data. 31 33 */ 32 class connection34 class Connection 33 35 { 34 36 public: 35 37 /// Constructor. 36 connection(boost::asio::io_service& io_service)38 Connection(boost::asio::io_service& io_service) 37 39 : socket_(io_service) 38 40 { 39 41 } 40 42 41 /// Get the underlying socket. Used for making a connection or for accepting42 /// an incoming connection.43 /// Get the underlying socket. Used for making a Connection or for accepting 44 /// an incoming Connection. 43 45 boost::asio::ip::tcp::socket& socket() 44 46 { … … 82 84 { 83 85 // Issue a read operation to read exactly the number of bytes in a header. 84 void ( connection::*f)(86 void (Connection::*f)( 85 87 const boost::system::error_code&, 86 88 T&, boost::tuple<Handler>) 87 = & connection::handle_read_header<T, Handler>;89 = &Connection::handle_read_header<T, Handler>; 88 90 boost::asio::async_read(socket_, boost::asio::buffer(inbound_header_), 89 91 boost::bind(f, … … 118 120 // Start an asynchronous call to receive the data. 119 121 inbound_data_.resize(inbound_data_size); 120 void ( connection::*f)(122 void (Connection::*f)( 121 123 const boost::system::error_code&, 122 124 T&, boost::tuple<Handler>) 123 = & connection::handle_read_data<T, Handler>;125 = &Connection::handle_read_data<T, Handler>; 124 126 boost::asio::async_read(socket_, boost::asio::buffer(inbound_data_), 125 127 boost::bind(f, this, … … 180 182 }; 181 183 182 typedef boost::shared_ptr< connection> connection_ptr;184 typedef boost::shared_ptr<Connection> connection_ptr; 183 185 184 #endif / / SERIALIZATION_CONNECTION_HPP186 #endif /* CONNECTION_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.
