#include "ISOFFTaskManager.hxx" /// Constructor ISOFFTaskManager::ISOFFTaskManager(){ // Set flag to false. We only want to run initialization for first event in first file. fInitialized = false; } /// Initialization of task (at start of first file) int ISOFFTaskManager::Initialize(){ if(!fInitialized){ // Initialize all tasks int status = 0; for(unsigned int i = 0; i < fTasks.size(); i++){ status = fTasks[i]->Initialize(); if(status != 0) break; } fInitialized = true; return status; } return 0; } /// Method to be run on every event. /// Must be implemented in any inherited class. int ISOFFTaskManager::Process(COMET::ICOMETEvent& event){ // Run Process on event for all tasks int status = 0; for(unsigned int i = 0; i < fTasks.size(); i++){ status = fTasks[i]->Process(event); if(status != 0) break; } fInitialized = true; return status; } /// Finalization of task (at end of last file). int ISOFFTaskManager::Finalize(){ // Run Finalize for all tasks int status = 0; for(unsigned int i = 0; i < fTasks.size(); i++){ status = fTasks[i]->Finalize(); if(status != 0) break; } fInitialized = true; return status; } bool ISOFFTaskManager::SetOption( std::string option, std::string value ) { bool optionSet = false; for(unsigned int i = 0; i < fTasks.size(); i++){ optionSet = optionSet || fTasks[i]->SetOption(option,value); } return optionSet; }