mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
git-svn-id: https://subversion.gsi.de/fairroot/fairbase/trunk@22451 0381ead4-6506-0410-b988-94b70fbc4730
56 lines
1.1 KiB
C++
56 lines
1.1 KiB
C++
/*
|
|
* FairMQSamplerTask.cxx
|
|
*
|
|
* Created on: Nov 22, 2012
|
|
* Author: dklein
|
|
*/
|
|
|
|
#include "FairMQSamplerTask.h"
|
|
|
|
|
|
FairMQSamplerTask::FairMQSamplerTask(const Text_t* name, Int_t iVerbose) :
|
|
FairTask(name, iVerbose),
|
|
fInput(NULL),
|
|
fBranch(""),
|
|
fOutput(new FairMQMessage)
|
|
{
|
|
}
|
|
|
|
FairMQSamplerTask::FairMQSamplerTask() :
|
|
FairTask( "Abstract base task used for loading a branch from a root file into memory"),
|
|
fInput(NULL),
|
|
fBranch(""),
|
|
fOutput(new FairMQMessage)
|
|
{
|
|
}
|
|
|
|
FairMQSamplerTask::~FairMQSamplerTask()
|
|
{
|
|
delete fInput;
|
|
//delete fOutput; // leave fOutput in memory, because it is needed even after FairMQSamplerTask is terminated. ClearOutput will clean it when it is no longer needed.
|
|
}
|
|
|
|
InitStatus FairMQSamplerTask::Init()
|
|
{
|
|
FairRootManager* ioman = FairRootManager::Instance();
|
|
fInput = (TClonesArray*) ioman->GetObject(fBranch.Data());
|
|
|
|
return kSUCCESS;
|
|
}
|
|
|
|
void FairMQSamplerTask::SetBranch(TString branch)
|
|
{
|
|
fBranch = branch;
|
|
}
|
|
|
|
FairMQMessage* FairMQSamplerTask::GetOutput()
|
|
{
|
|
return fOutput;
|
|
}
|
|
|
|
void FairMQSamplerTask::ClearOutput(void* data, void* hint)
|
|
{
|
|
free (data);
|
|
}
|
|
|