Search code examples
redhawksdr

Is there a fast/recommended way to push raw data?


Many of my components will be dealing with external buffers from C libraries and I'm trying to avoid any extraneous copies. I see two signatures for pushPacket in the output port declaration and both take a vector type. I've searched for examples and the only one I've found in the provided components was in the USRP_UHD where a sequence was created using an existing buffer and a specialized pushPacket implementation was called. This required the author to implement and use a custom port with a specialized pushPacket call.

Is there a standard way of doing this so I don't have to create a special library of port wrappers and customize the ports for every component? Are there any plans to add a raw data version of pushPacket to the output ports like the example shown below?

Given a bulkio::OutLongPort:

void pushPacket(const CORBA::Long* items, size_t nitems, BULIO::PrecisionUTCTime& T, bool EOS, const std::string& streamID);

This question is in regards to Redhawk version 1.9.


Solution

  • There is a plan for something like this in 1.10. You can see source for that on the develop-1.10 branch on github. Checkout builkio_out_port.h.