Changes between Version 13 and Version 14 of Configuration

Show
Ignore:
Timestamp:
12/03/12 16:45:46 (12 years ago)
Author:
jorisborgdorff
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Configuration

    v13 v14  
    6363||{{{pipe}}}                ||{{{PipeFilter}}}                      ||none                ||any                 ||Forwards all incoming messages unchanged|| 
    6464||{{{console}}}             ||{{{ConsoleWriterFilter}}}             ||none                ||any                 ||Prints all messages to console and forwards them|| 
     65||{{{thread}}}             ||{{{ThreadedFilter}}}             ||none                ||any                 ||Runs a thread, so the following filter will run in a separate thread|| 
     66||{{{serialize}}}             ||{{{SerializeFilter}}}             ||none                ||any to {{{byte[]}}}                 ||Serializes any serializable Java object to a byte array|| 
     67||{{{deserialize}}}             ||{{{DeserializeFilter}}}             ||none                ||{{{byte[]}}} to object      ||Deserializes a serialized byte array to a Java object|| 
     68||{{{compress}}}             ||{{{CompressFilter}}}             ||none                ||{{{byte[]}}}                 ||Compresses byte arrays using the Deflate algorithm|| 
     69||{{{decompress}}}             ||{{{DecompressFilter}}}             ||none                ||{{{byte[]}}}                 ||Decompresses compressed byte arrays|| 
     70||{{{chunk}}}             ||{{{ChunkFilter}}}             ||{{{int chunks}}}                ||{{{byte[]}}}                ||Splits up a byte array into {{{chunks}}} smaller byte arrays for separate processing.|| 
     71||{{{dechunk}}}             ||{{{DechunkFilter}}}             ||{{{int chunks}}}                ||{{{byte[]}}}                ||Combines a byte array that was split up by the chunk filter.|| 
    6572||{{{linearinterpolation}}} ||{{{LinearInterpolationFilterDouble}}} ||none                ||{{{double[]}}}      ||Creates a {{{double[]}}} of length-1 of the original, and linearly interpolates between the original values: {{{k'_i <- (k_i+k_{i+1})/2}}}|| 
    6673||{{{multiply}}}            ||{{{MultiplyFilterDouble}}}            ||{{{double factor}}} ||{{{double[]}}}      ||Multiplies each value of the incoming message by {{{factor}}}|| 
     
    7582cs.attach('w' => 'r') { 
    7683        tie('dataOut', 'dataIn',['multiply_0.5','console']) 
     84} 
     85}}} 
     86 
     87By default, the conduit filters get applied at the receiving submodel. If a filter should be applied at the sending submodel, or if filters should be applied at both locations, the tie argument can take an additional argument, so that the first list of filters is applied at the sending side and the second list of filters is applied at the receiving side. 
     88The following fragment multiplies the data with a constant on the sending side, and prints it on the receiving side: 
     89{{{ 
     90cs.attach('w' => 'r') { 
     91        tie('dataOut', 'dataIn',['multiply_0.5'],['console']) 
     92} 
     93}}} 
     94 
     95And the following fragment compresses data on the sending side and uncompresses it on the receiving side: 
     96{{{ 
     97cs.attach('w' => 'r') { 
     98        tie('dataOut', 'dataIn',['serialize','compress'],['decompress','deserialize']) 
     99} 
     100}}} 
     101 
     102For large sets of data it might even make sense to split the data up before compressing, so that it gets sent in separate chunks and the compressing is done in a separate thread from sending: 
     103{{{ 
     104cs.attach('w' => 'r') { 
     105        tie('dataOut', 'dataIn',['serialize','chunk_16','compress','thread'],['decompress','dechunk_16','deserialize']) 
    77106} 
    78107}}}