Jump to content

Programming Reference:ParallelCombination

From BCI2000 Wiki
Revision as of 15:09, 5 September 2023 by Mellinger (talk | contribs) (Created page with "==Function== The ParallelCombination class is a template that takes as arguments two filter class names. The instantiated template is then a combined filter, and must be given its own class name by defining a struct that publicly inherits from the instantiated template: struct MyCombination : ParallelCombination<Filter1, Filter2> {} *The combination's ''input'' channels may be fed selectively into the inputs of the two filters. *The combination's ''output'' is joined...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Function

The ParallelCombination class is a template that takes as arguments two filter class names. The instantiated template is then a combined filter, and must be given its own class name by defining a struct that publicly inherits from the instantiated template:

struct MyCombination : ParallelCombination<Filter1, Filter2> {}
  • The combination's input channels may be fed selectively into the inputs of the two filters.
  • The combination's output is joined together from the output of the two filters.

Any of the two filters may be a SubchainFilter, which allows for two parallel chains of filters, as well as more complex topologies because SubchainFilters may again contain ParallelCombination instantiations.

Parameters

<FilterName>Channels

The name of this parameter depends on the class name given to the instantiated combination as described under "Function", or the name given to the filter programmatically. In the example above, the parameter's name will be MyCombinationChannels.

The parameter is matrix-valued, and contains only a single column with two entries. The two rows correspond to the two filters given as template arguments, and each row's label gives the name of the filter it corresponds to. Matrix elements themselves contain a list of channels each, determing which channels are transmitted to which of the two subfilters, or chains. In channel lists, channel names are separated by white space, and may contain wildcards: * to represent one or more arbitrary characters, and ? to represent a single arbitrary character. Character ranges may be enclosed by [], and wilcard patterns may be negated by prepending an exclamation mark. Ranges of channels may be specified using : or - to separate begin from end.