Class OutputPortCollection
A collection of all (non-error) output ports for a worker, always available as Outputs.
This class is used when you either don't need to know the row type of each output port, or you cast the port(s) to have the actual row type (using an explicit cast or ToArray<TOutput>()).
Note that workers with ports typically add additional members that allow access to typed versions of the ports, and workers with an unknown number of output ports of the same type typically adds a OutputPortCollection<TOutput>.
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public class OutputPortCollection : OutputPortBaseCollection, IReadOnlyList<OutputPortBase>, IReadOnlyCollection<OutputPortBase>, IEnumerable<OutputPortBase>, IEnumerable
Methods
Create<TOutput>(String)
Creates and adds an output port to the collection. Cannot be called after the worker parent has started running its children.
Note: This method is thread-safe.
Declaration
public OutputPort<TOutput> Create<TOutput>(string outputPortName)
where TOutput : class
Parameters
| Type | Name | Description |
|---|---|---|
| String | outputPortName | Name of the output port. Must be unique among the output ports on this worker. |
Returns
| Type | Description |
|---|---|
| OutputPort<TOutput> | The created output port, which is often used to assign a typed output port member, e.g. "Output". |
Type Parameters
| Name | Description |
|---|---|
| TOutput | The row type. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| InvalidOperationException | Cannot add port after the worker parent has started running its children. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Note: This method is not thread-safe; use ToArray<TOutput>() to get or iterate over the ports in a thread-safe manner.
Declaration
public IEnumerator<OutputPortBase> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<OutputPortBase> |
ToArray<TOutput>()
Returns the output ports copied to a new array, with the ports cast to the generic output port type including row type. This is useful for workers where all output ports are of the same type.
The caller can manipulate the array without affecting the worker, e.g. reordering the array items.
Note: This method is thread-safe.
Declaration
public OutputPort<TOutput>[] ToArray<TOutput>()
where TOutput : class
Returns
| Type | Description |
|---|---|
| OutputPort<TOutput>[] |
Type Parameters
| Name | Description |
|---|---|
| TOutput | The row type. |
Exceptions
| Type | Condition |
|---|---|
| InvalidCastException | An element in the sequence cannot be cast to the specified type. |