Building your Tailored SpecTclSetting Up SpecTclWriting a class derived from CEventProcessorHooking the Event Processor Into SpecTcl

Hooking the Event Processor Into SpecTcl

Now that we have built an event processor, we need to arrange for SpecTcl to call it's operator() for each event. Recall from the figure SpecTcl's event Processing Model that SpecTcl maintains a pipeline of event processors. This pipeline is usually created when SpecTcl is initialized. Hooks into SpecTcl's initialization code are provided in the skeleton source file you received named: MySpecTclApp.cpp.

Edit that file and:

CMySpecTclApp::CreateAnalysisPipeline is called when SpecTcl is initializing. It is expected to register all elements of the event pipeline. "Out of the box" the function looks like:

void 
CMySpecTclApp::CreateAnalysisPipeline(CAnalyzer& rAnalyzer)  
{ 

#ifdef WITHF77UNPACKER
  RegisterEventProcessor(legacyunpacker);
#endif
  
    RegisterEventProcessor(Stage1);
    RegisterEventProcessor(Stage2);
}  

Remove all lines in the body (they are examples only). And add a line that reads:

    RegisterEventProcessor(MyProcessor);

If you have additional event processors, register them in the order in which you want them called. In our case, our final version of this function will read:

void 
CMySpecTclApp::CreateAnalysisPipeline(CAnalyzer& rAnalyzer)  
{ 

RegisterEventProcessor(MyProcessor);

}  

Report documentation errors to Ron Fox (fox@nscl.msu.edu)or NSCL's Bugzilla page

Building your Tailored SpecTclSetting Up SpecTclWriting a class derived from CEventProcessorHooking the Event Processor Into SpecTcl