Package bbflow
Class ff_node<T,U>
java.lang.Object
bbflow.block<T,U>
bbflow.ff_node<T,U>
- Type Parameters:
T
- Custom type of the channels
- Direct Known Subclasses:
ff_all2all
,ff_comb
,ff_farm
,ff_pipeline
Fundamental building block rapresenting a node
Implemented and used by other building blocks
Support multiple input and output channels
Single lock for all input channels and a single lock for all output channels
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInputChannel
(ff_queue<T> input) add a Input channel to the bbflow.ff_node.void
addOutputChannel
(ff_queue<U> output) add a Output channel to the bbflow.ff_node LinkedList is O(1) adding/removing first elementgetInputChannel
(int index) get input channelgetOutputChannel
(int index) get output channelvoid
join()
default join functionstatic void
preload()
boolean
removeInputChannel
(int index) add a Input channel to the bbflow.ff_node.boolean
removeOutputChannel
(int index) add a Output channel to the bbflow.ff_node LinkedList is O(1) adding/removing first elementvoid
start()
-
Field Details
-
mynode
-
-
Constructor Details
-
ff_node
public ff_node()default constructor for different blocks extending ff_node -
ff_node
default constructor- Parameters:
job
- generic Runnable of type default Job extending Runnable
-
ff_node
-
-
Method Details
-
preload
public static void preload() -
addInputChannel
add a Input channel to the bbflow.ff_node. LinkedList is O(1) adding/removing first element- Overrides:
addInputChannel
in classblock<T,
U> - Parameters:
input
- input channel
-
addOutputChannel
add a Output channel to the bbflow.ff_node LinkedList is O(1) adding/removing first element- Overrides:
addOutputChannel
in classblock<T,
U> - Parameters:
output
- output channel
-
removeInputChannel
public boolean removeInputChannel(int index) add a Input channel to the bbflow.ff_node. LinkedList is O(1) adding/removing first element- Parameters:
index
- index of channel to remove- Returns:
-
removeOutputChannel
public boolean removeOutputChannel(int index) add a Output channel to the bbflow.ff_node LinkedList is O(1) adding/removing first element- Parameters:
index
- index of channel to remove- Returns:
-
start
public void start() -
join
public void join()default join function -
getOutputChannel
get output channel- Parameters:
index
- get output channel at index. Indexes starting from 0- Returns:
- return channel retrieved
-
getInputChannel
get input channel- Parameters:
index
- get input channel at index. Indexes starting from 0- Returns:
- return channel retrieved
-