diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-09 20:09:45 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-09 20:09:45 -0700 |
commit | c898ca9751d1b274ae8f8f7afc2d5bc54b6ef30c (patch) | |
tree | 68608f738c82c43ba0ace42089011f51723afdd8 /host/include | |
parent | 75537e896bbd0aeb8d988b6ad33b5ab2d35b316f (diff) | |
download | uhd-c898ca9751d1b274ae8f8f7afc2d5bc54b6ef30c.tar.gz uhd-c898ca9751d1b274ae8f8f7afc2d5bc54b6ef30c.tar.bz2 uhd-c898ca9751d1b274ae8f8f7afc2d5bc54b6ef30c.zip |
uhd: ssize_t for phony zero copy return types, null sptr for timeout/error with get managed buffers
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/transport/zero_copy.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/host/include/uhd/transport/zero_copy.hpp b/host/include/uhd/transport/zero_copy.hpp index da10bfbe2..513291b63 100644 --- a/host/include/uhd/transport/zero_copy.hpp +++ b/host/include/uhd/transport/zero_copy.hpp @@ -82,8 +82,9 @@ namespace uhd{ namespace transport{ * This should be called to commit the write to the transport object. * After calling, the referenced memory should be considered invalid. * \param num_bytes the number of bytes written into the buffer + * \return the number of bytes written, 0 for timeout, negative for error */ - virtual void commit(size_t num_bytes) = 0; + virtual ssize_t commit(size_t num_bytes) = 0; /*! * Get the size of the underlying buffer. @@ -121,6 +122,7 @@ namespace uhd{ namespace transport{ /*! * Get a new receive buffer from this transport object. + * \return a managed buffer, or null sptr on timeout/error */ virtual managed_recv_buffer::sptr get_recv_buff(void) = 0; @@ -135,6 +137,7 @@ namespace uhd{ namespace transport{ /*! * Get a new send buffer from this transport object. + * \return a managed buffer, or null sptr on timeout/error */ virtual managed_send_buffer::sptr get_send_buff(void) = 0; @@ -175,9 +178,9 @@ namespace uhd{ namespace transport{ /*! * Perform a private copying recv. * \param buff the buffer to write data into - * \return the number of bytes written to buff + * \return the number of bytes written to buff, 0 for timeout, negative for error */ - virtual size_t recv(const boost::asio::mutable_buffer &buff) = 0; + virtual ssize_t recv(const boost::asio::mutable_buffer &buff) = 0; UHD_PIMPL_DECL(impl) _impl; }; @@ -208,9 +211,9 @@ namespace uhd{ namespace transport{ /*! * Perform a private copying send. * \param buff the buffer to read data from - * \return the number of bytes read from buff + * \return the number of bytes read from buff, 0 for timeout, negative for error */ - virtual size_t send(const boost::asio::const_buffer &buff) = 0; + virtual ssize_t send(const boost::asio::const_buffer &buff) = 0; UHD_PIMPL_DECL(impl) _impl; }; |