Package bbflow
Class pipeline_generic<T,U,V>
java.lang.Object
bbflow.block<T,V>
bbflow.pipeline_generic<T,U,V>
Pipeline building block allows auto-connection between all types of ff_blocks
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInputChannel
(ff_queue<T> input) add input channel to first block in pipevoid
addOutputChannel
(ff_queue<V> output) add output channel to the last element in pipevoid
appendBlock
(block<Object, Object> newblock, byte MULTI) void
connect 1-1 the two blocksvoid
connect two blocks.void
connect 1-1 the two blocks and add to pipelinevoid
connect 1-1 the two blocks and add to pipelinevoid
connect two blocks and add to pipeline.void
connect two blocks and add to pipeline.get first farm of the pipelineget last farm of pipelinevoid
join()
wait end of all blocks in pipestatic void
preload()
void
start()
start all blocks in pipe
-
Field Details
-
pipe
LinkedList<block> pipe -
bufferSize
int bufferSize
-
-
Constructor Details
-
pipeline_generic
public pipeline_generic(int bufferSize)
-
-
Method Details
-
preload
public static void preload() -
createPipe
connect 1-1 the two blocks and add to pipeline- Parameters:
b1
- first blockb2
- second blockBLOCKING
- type of channelBOUNDED
- type of channel
-
connect
connect 1-1 the two blocks- Parameters:
b1
- first blockb2
- second blockBLOCKING
- type of channelBOUNDED
- type of channel
-
createPipe
connect 1-1 the two blocks and add to pipeline- Parameters:
b1
- first blockb2
- second block
-
createPipeMulti
public void createPipeMulti(block<T, U> b1, block<U, V> b2, boolean BLOCKING, boolean BOUNDED, byte MULTI) connect two blocks and add to pipeline. See ff_pipeline for reference- Parameters:
b1
- first blockb2
- second blockBLOCKING
- type of channelBOUNDED
- type of channelMULTI
- TYPE_1_1, TYPE_1_N, TYPE_Nx1, TYPE_N_N, TYPE_NxM
-
connectPipeMulti
public void connectPipeMulti(block<T, U> b1, block<U, V> b2, boolean BLOCKING, boolean BOUNDED, byte MULTI) connect two blocks. See ff_pipeline for reference- Parameters:
b1
- first blockb2
- second blockBLOCKING
- type of channelBOUNDED
- type of channelMULTI
- TYPE_1_1, TYPE_1_N, TYPE_Nx1, TYPE_N_N, TYPE_NxM
-
createPipeMulti
connect two blocks and add to pipeline. See ff_pipeline for reference- Parameters:
b1
- first blockb2
- second blockMULTI
- TYPE_1_1, TYPE_1_N, TYPE_Nx1, TYPE_N_N, TYPE_NxM
-
addInputChannel
add input channel to first block in pipe- Overrides:
addInputChannel
in classblock<T,
V> - Parameters:
input
-
-
addOutputChannel
add output channel to the last element in pipe- Overrides:
addOutputChannel
in classblock<T,
V> - Parameters:
output
-
-
start
public void start()start all blocks in pipe -
join
public void join()wait end of all blocks in pipe -
getFirstFarm
get first farm of the pipeline- Returns:
- first farm or null
-
getLastFarm
get last farm of pipeline- Returns:
- last farm or null
-
appendBlock
-