Given below is the constructor in vector_to_stream block. The block size
is
passed as a parameter to the constructor.
vector_to_stream_impl::vector_to_stream_impl(size_t itemsize, size_t
nitems_per_block)
: sync_interpolator (“vector_to_stream”,
io_signature::make (1, 1, itemsize *
nitems_per_block),
io_signature::make (1, 1, itemsize),
nitems_per_block)
{
}
Suppose I don’t know the block size before hand, and I want to pass a
parameter “x” to toe constructor such that block size can be obtained
from
x using certain computation (that will be defined inside the
constructor).
Can I do this? If so how?
When I add a new block “encoder”, to the module “ldpc”, modtool add
files
“include/ldpc/encoder.h”, “lib/encoder_impl.cc”, and
“lib/encoder_impl.h”.
And the work function is to be declared and defined in encoder_impl.h
and
encoder_impl.cc respectively. Consider that I have the function “encode”
defined and declared in ldpc.h and ldpc.cc respectively. ldpc.* does not
define any signal processing block, so I don’t add them using modtool.
But
they are required as they have the definition for the “encode” function
and
inside the work function in encoder_impl.cc I just want to call the
encode
function defined inside this ldpc class.
Am I supposed to put ldpc.h in inlclude/ldpc/ and ldpc.cc in lib/? Or
should I put both of them inside lib/ ? Which section of CMakeLists.txt
am
I supposed to modify?