USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-g6563c537
UHD and USRP Manual
muxed_zero_copy_if.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2016 Ettus Research LLC
3 // Copyright 2018 Ettus Research, a National Instruments Company
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 
8 #ifndef INCLUDED_LIBUHD_TRANSPORT_MUXED_ZERO_COPY_IF_HPP
9 #define INCLUDED_LIBUHD_TRANSPORT_MUXED_ZERO_COPY_IF_HPP
10 
11 #include <uhd/config.hpp>
13 #include <stdint.h>
14 #include <boost/function.hpp>
16 
17 namespace uhd { namespace transport {
18 
29 {
30 public:
31  typedef boost::shared_ptr<muxed_zero_copy_if> sptr;
32 
43  typedef boost::function<uint32_t(void* buff, size_t size)> stream_classifier_fn;
44 
46  virtual ~muxed_zero_copy_if() {}
47 
49  virtual zero_copy_if::sptr make_stream(const uint32_t stream_num) = 0;
50 
52  virtual void remove_stream(const uint32_t stream_num) = 0;
53 
55  virtual size_t get_num_dropped_frames() const = 0;
56 
58  static sptr make(zero_copy_if::sptr base_xport,
59  stream_classifier_fn classify_fn,
60  size_t max_streams);
61 };
62 
63 }} // namespace uhd::transport
64 
65 #endif /* INCLUDED_LIBUHD_TRANSPORT_MUXED_ZERO_COPY_IF_HPP */
Definition: muxed_zero_copy_if.hpp:28
boost::noncopyable noncopyable
Definition: noncopyable.hpp:46
boost::shared_ptr< zero_copy_if > sptr
Definition: zero_copy.hpp:169
virtual ~muxed_zero_copy_if()
virtual dtor
Definition: muxed_zero_copy_if.hpp:46
Definition: build_info.hpp:13
boost::function< uint32_t(void *buff, size_t size)> stream_classifier_fn
Definition: muxed_zero_copy_if.hpp:43
virtual size_t get_num_dropped_frames() const =0
Get number of frames dropped due to unregistered streams.
virtual zero_copy_if::sptr make_stream(const uint32_t stream_num)=0
Make a virtual transport for the specified stream number.
boost::shared_ptr< muxed_zero_copy_if > sptr
Definition: muxed_zero_copy_if.hpp:31
static sptr make(zero_copy_if::sptr base_xport, stream_classifier_fn classify_fn, size_t max_streams)
Make a new demuxer from a transport and parameters.
virtual void remove_stream(const uint32_t stream_num)=0
Unregister the stream number. All packets destined to the stream will be dropped. ...