diff options
author | Josh Blum <josh@joshknows.com> | 2010-06-02 15:21:56 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-06-02 15:21:56 -0700 |
commit | a4494bc2c985919aee7119ed401c72f41cde206e (patch) | |
tree | c1ff7ff39521e39f976f2f2318575561cc2742a2 /host/lib/usrp/usrp2/io_impl.cpp | |
parent | 92fd3a514b6808e7b94f172c75afb2026b849fce (diff) | |
download | uhd-a4494bc2c985919aee7119ed401c72f41cde206e.tar.gz uhd-a4494bc2c985919aee7119ed401c72f41cde206e.tar.bz2 uhd-a4494bc2c985919aee7119ed401c72f41cde206e.zip |
use smart pointer for io impl, simplify send buffer callback
Diffstat (limited to 'host/lib/usrp/usrp2/io_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/io_impl.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index 43d6e814a..5d425bd8a 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -122,20 +122,12 @@ void usrp2_impl::io_init(void){ std::cout << "TX samples per packet: " << get_max_send_samps_per_packet() << std::endl; //create new io impl - _io_impl = new io_impl(_data_transport); -} - -void usrp2_impl::io_done(void){ - delete _io_impl; + _io_impl = boost::shared_ptr<io_impl>(new io_impl(_data_transport)); } /*********************************************************************** * Send Data **********************************************************************/ -static inline managed_send_buffer::sptr get_send_buff(zero_copy_if::sptr zc_if){ - return zc_if->get_send_buff(); -} - size_t usrp2_impl::send( const asio::const_buffer &buff, const tx_metadata_t &metadata, @@ -147,7 +139,7 @@ size_t usrp2_impl::send( buff, metadata, send_mode, //buffer to empty and samples metadata io_type, _tx_otw_type, //input and output types to convert get_master_clock_freq(), //master clock tick rate - boost::bind(get_send_buff, _data_transport), + boost::bind(&zero_copy_if::get_send_buff, _data_transport), get_max_send_samps_per_packet() ); } |