From 0a57e26171596a2729eea9a74ba23a21b0d3ee92 Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Sat, 25 Feb 2012 14:01:41 -0200 Subject: [PATCH] Replaced boost::shared_ptr by PingerItem. --- src/host/pingerfactory.cpp | 14 +++++++------- src/host/pingerfactory.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/host/pingerfactory.cpp b/src/host/pingerfactory.cpp index 943338f..1d1a0e2 100644 --- a/src/host/pingerfactory.cpp +++ b/src/host/pingerfactory.cpp @@ -64,7 +64,7 @@ PingerFactory::~PingerFactory() * packet will be sent. * @return a Pinger object to able to ping using the given protocol. */ -shared_ptr PingerFactory::createPinger( +PingerItem PingerFactory::createPinger( const PingProtocol protocol, io_service &io_serv, const string &network_interface @@ -81,24 +81,24 @@ shared_ptr PingerFactory::createPinger( switch ( protocol ) { case PingProtocol_ICMP: - return shared_ptr( + return PingerItem( new IcmpPinger( io_serv, icmp::v4(), network_interface, ping_reply_timeout_in_sec ) ); case PingProtocol_ICMPv6: - return shared_ptr( + return PingerItem( new IcmpPinger( io_serv, icmp::v6(), network_interface, ping_reply_timeout_in_sec ) ); case PingProtocol_TCP: - return shared_ptr( + return PingerItem( new TcpPinger( io_serv, tcp_raw_protocol::v4(), network_interface, ping_reply_timeout_in_sec ) ); case PingProtocol_TCP_IPv6: - return shared_ptr( + return PingerItem( new TcpPinger( io_serv, tcp_raw_protocol::v6(), network_interface, ping_reply_timeout_in_sec ) ); default: BOOST_ASSERT( !"Try to create a pinger from an invalid protocol" ); //lint !e506 - return shared_ptr(); //lint !e527 + return PingerItem(); //lint !e527 } } catch ( const system_error &ex ) @@ -109,5 +109,5 @@ shared_ptr PingerFactory::createPinger( exit( EXIT_FAILURE ); } - return shared_ptr(); //lint !e527 + return PingerItem(); //lint !e527 } diff --git a/src/host/pingerfactory.h b/src/host/pingerfactory.h index 08f4cd4..4e21b88 100644 --- a/src/host/pingerfactory.h +++ b/src/host/pingerfactory.h @@ -36,7 +36,7 @@ class PingerFactory { public: - static boost::shared_ptr createPinger( + static PingerItem createPinger( const PingProtocol protocol, boost::asio::io_service &io_serv, const std::string &network_interface -- 1.7.1