10.2. Step by step recipe for adding support for a new data format

From the discussion in the previous section, we can derive a step by step recipe for adding support for a new data format to SpecTcl.

  1. Write a buffer decoder that invokes appropriate methods of the CAnalyzer at appropriate times given blocks of data from the data source.

  2. Write a creator object for the buffer decoder we created in the first step.

  3. In MySpecTclApp.cpp create an instance of our creator and associate it with a new attach -format keyword so that when that format is requested, the attach command can make an instance of our buffer decoder and attach it to the analyzer.

In the next section, we will write code to do this for a simple data acquisition system data format.