This example is illustrating :
Duplicate node to have a one-to-many connection at an outputIt is possible to use a custom datatype:
complexType=CStructType("complex","MyComplex",8)
This is defining a new datatype that is mapped to the type complex in C/C++ and the class MyComplex in Python. The last argument is the size in bytes of the struct in C.
The type complex may be defined with:
typedef struct {
float re;
float im;
} complex;
Note that:
The size of the C structure should take into account the padding that may be added to the struct.
When no buffer sharing is used, the size of buffers is always expressed in number of samples.
But in case of buffer sharing, the datatype of the buffer is int8_t and the size of the buffer must be computed by the Compute Graph taking into account ay padding that may exist.
In case of a one-to-many connections, the Python code will automatically add Duplicate nodes in the graph. Those Duplicate nodes do not appear directly in the graphviz but only as a stylized way : a dot.
Currently it is limited to 3. If you need more that 3 outputs on an IO you'll have to insert the Duplicate nodes explicitly in the graph.
In the generated code, you'll see the Duplicate nodes. For instance, in this example:
Duplicate3<complex,5,complex,5,complex,5,complex,5> dup0(fifo2,fifo3,fifo4,fifo5);