All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
stream.hpp
Go to the documentation of this file.
//
// Copyright 2011-2012 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef INCLUDED_UHD_STREAM_HPP
#define INCLUDED_UHD_STREAM_HPP
#include <uhd/config.hpp>
#include <uhd/types/metadata.hpp>
#include <uhd/types/device_addr.hpp>
#include <uhd/types/ref_vector.hpp>
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>
#include <vector>
#include <string>
namespace uhd{
struct UHD_API stream_args_t{
stream_args_t(
const std::string &cpu = "",
const std::string &otw = ""
){
cpu_format = cpu;
otw_format = otw;
}
std::string cpu_format;
std::string otw_format;
device_addr_t args;
std::vector<size_t> channels;
};
class UHD_API rx_streamer : boost::noncopyable{
public:
typedef boost::shared_ptr<rx_streamer> sptr;
virtual size_t get_num_channels(void) const = 0;
virtual size_t get_max_num_samps(void) const = 0;
typedef ref_vector<void *> buffs_type;
virtual size_t recv(
const buffs_type &buffs,
const size_t nsamps_per_buff,
rx_metadata_t &metadata,
const double timeout = 0.1,
const bool one_packet = false
) = 0;
};
class UHD_API tx_streamer : boost::noncopyable{
public:
typedef boost::shared_ptr<tx_streamer> sptr;
virtual size_t get_num_channels(void) const = 0;
virtual size_t get_max_num_samps(void) const = 0;
typedef ref_vector<const void *> buffs_type;
virtual size_t send(
const buffs_type &buffs,
const size_t nsamps_per_buff,
const tx_metadata_t &metadata,
const double timeout = 0.1
) = 0;
};
} //namespace uhd
#endif /* INCLUDED_UHD_STREAM_HPP */