Changeset af3aed for src


Ignore:
Timestamp:
May 4, 2012, 2:17:20 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:
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)
Message:

Introduced Info in several functions, replaced connection.hpp by Connection.hpp.

Location:
src/Fragmentation/Automation
Files:
5 edited
1 moved

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 */
    107
    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>
    1318
    1419#include <boost/asio.hpp>
    15 #include <boost/archive/text_iarchive.hpp>
    16 #include <boost/archive/text_oarchive.hpp>
    1720#include <boost/bind.hpp>
    1821#include <boost/shared_ptr.hpp>
     
    2326#include <vector>
    2427
    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.
    2729 * Each message sent using this class consists of:
    2830 * @li An 8-byte header containing the length of the serialized data in
     
    3032 * @li The serialized data.
    3133 */
    32 class connection
     34class Connection
    3335{
    3436public:
    3537  /// Constructor.
    36   connection(boost::asio::io_service& io_service)
     38  Connection(boost::asio::io_service& io_service)
    3739    : socket_(io_service)
    3840  {
    3941  }
    4042
    41   /// Get the underlying socket. Used for making a connection or for accepting
    42   /// an incoming connection.
     43  /// Get the underlying socket. Used for making a Connection or for accepting
     44  /// an incoming Connection.
    4345  boost::asio::ip::tcp::socket& socket()
    4446  {
     
    8284  {
    8385    // Issue a read operation to read exactly the number of bytes in a header.
    84     void (connection::*f)(
     86    void (Connection::*f)(
    8587        const boost::system::error_code&,
    8688        T&, boost::tuple<Handler>)
    87       = &connection::handle_read_header<T, Handler>;
     89      = &Connection::handle_read_header<T, Handler>;
    8890    boost::asio::async_read(socket_, boost::asio::buffer(inbound_header_),
    8991        boost::bind(f,
     
    118120      // Start an asynchronous call to receive the data.
    119121      inbound_data_.resize(inbound_data_size);
    120       void (connection::*f)(
     122      void (Connection::*f)(
    121123          const boost::system::error_code&,
    122124          T&, boost::tuple<Handler>)
    123         = &connection::handle_read_data<T, Handler>;
     125        = &Connection::handle_read_data<T, Handler>;
    124126      boost::asio::async_read(socket_, boost::asio::buffer(inbound_data_),
    125127        boost::bind(f, this,
     
    180182};
    181183
    182 typedef boost::shared_ptr<connection> connection_ptr;
     184typedef boost::shared_ptr<Connection> connection_ptr;
    183185
    184 #endif // SERIALIZATION_CONNECTION_HPP
     186#endif /* CONNECTION_HPP_ */
  • src/Fragmentation/Automation/Makefile.am

    rc6bcd0 raf3aed  
    1313
    1414servers11n_SOURCES = \
    15   connection.hpp \
     15  Connection.hpp \
    1616  server.cpp \
    1717  FragmentJob.cpp \
     
    3030clients11n_SOURCES = \
    3131  client.cpp \
    32   connection.hpp \
     32  Connection.hpp \
    3333  FragmentJob.cpp \
    3434  FragmentJob.hpp \
  • src/Fragmentation/Automation/StockClient.cpp

    rc6bcd0 raf3aed  
    1919#include <iostream>
    2020#include <vector>
    21 #include "connection.hpp" // Must come before boost/serialization headers.
     21#include "Connection.hpp" // Must come before boost/serialization headers.
    2222#include <boost/serialization/vector.hpp>
     23#include "CodePatterns/Info.hpp"
    2324#include "FragmentJob.hpp"
    2425#include "StockClient.hpp"
     
    3132  connection_(io_service)
    3233{
     34    Info info(__FUNCTION__);
    3335  // Resolve the host name into an IP address.
    3436  boost::asio::ip::tcp::resolver resolver(io_service);
     
    4749void StockClient::handle_connect(const boost::system::error_code& e)
    4850{
     51    Info info(__FUNCTION__);
    4952  if (!e)
    5053  {
     
    6871void StockClient::handle_read(const boost::system::error_code& e)
    6972{
     73    Info info(__FUNCTION__);
    7074  if (!e)
    7175  {
  • src/Fragmentation/Automation/StockClient.hpp

    rc6bcd0 raf3aed  
    1717#include <boost/asio.hpp>
    1818#include <vector>
    19 #include "connection.hpp" // Must come before boost/serialization headers.
     19#include "Connection.hpp" // Must come before boost/serialization headers.
    2020#include "FragmentJob.hpp"
    2121
     
    3636private:
    3737  /// The connection to the server.
    38   connection connection_;
     38  Connection connection_;
    3939
    4040  /// The data received from the server.
  • src/Fragmentation/Automation/StockServer.cpp

    rc6bcd0 raf3aed  
    2020#include <iostream>
    2121#include <vector>
    22 #include "connection.hpp" // Must come before boost/serialization headers.
     22#include "Connection.hpp" // Must come before boost/serialization headers.
    2323#include <boost/serialization/vector.hpp>
     24#include "CodePatterns/Info.hpp"
    2425#include "FragmentJob.hpp"
    2526
     
    3132  )
    3233{
     34    Info info(__FUNCTION__);
    3335  FragmentJob s(std::string("test"), 1);
    3436  jobs_.push_back(s);
    3537
    3638  // Start an accept operation for a new connection.
    37   connection_ptr new_conn(new connection(acceptor_.get_io_service()));
     39  connection_ptr new_conn(new Connection(acceptor_.get_io_service()));
    3840  acceptor_.async_accept(new_conn->socket(),
    3941    boost::bind(&StockServer::handle_accept, this,
     
    4345void StockServer::handle_accept(const boost::system::error_code& e, connection_ptr conn)
    4446{
     47    Info info(__FUNCTION__);
    4548  std::cout << "handle_accept called." << std::endl;
    4649  if (!e)
     
    5457  }
    5558
    56   connection_ptr new_conn(new connection(acceptor_.get_io_service()));
     59  connection_ptr new_conn(new Connection(acceptor_.get_io_service()));
    5760  acceptor_.async_accept(new_conn->socket(),
    5861    boost::bind(&StockServer::handle_accept, this,
     
    6265void StockServer::handle_write(const boost::system::error_code& e, connection_ptr conn)
    6366{
     67    Info info(__FUNCTION__);
    6468  // Nothing to do. The socket will be closed automatically when the last
    6569  // reference to the connection object goes away.
  • src/Fragmentation/Automation/StockServer.hpp

    rc6bcd0 raf3aed  
    1717#include <boost/asio.hpp>
    1818#include <vector>
    19 #include "connection.hpp" // Must come before boost/serialization headers.
     19#include "Connection.hpp" // Must come before boost/serialization headers.
    2020#include "FragmentJob.hpp"
    2121
Note: See TracChangeset for help on using the changeset viewer.