From: Guilherme Maciel Ferreira Date: Sat, 25 Feb 2012 16:01:41 +0000 (-0200) Subject: Replaced boost::shared_ptr by PingerItem. X-Git-Tag: v1.5~1^2~33 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=0a57e26171596a2729eea9a74ba23a21b0d3ee92;p=pingcheck Replaced boost::shared_ptr by PingerItem. --- 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