|
Gaudi Framework, version v23r2 |
| Home | Generated: Thu Jun 28 2012 |
Extension of OutputStream to copy the content of the main input file. More...
#include <InputCopyStream.h>


Public Member Functions | |
| InputCopyStream (const std::string &name, ISvcLocator *pSvcLocator) | |
| Standard algorithm Constructor. | |
| virtual | ~InputCopyStream () |
| Standard Destructor. | |
| virtual StatusCode | initialize () |
| Initialize the instance. | |
| virtual StatusCode | finalize () |
| Finalize the instance. | |
| virtual StatusCode | collectObjects () |
| Collect all objects to be written to the output stream. | |
Protected Member Functions | |
| virtual bool | hasInput () const |
| Overriden from the base class (InputCopyStream has always input). | |
Private Attributes | |
| bool | m_takeOptionalFromTES |
| Allow optional items to be on TES instead of input file. | |
| IDataStoreLeaves * | m_leavesTool |
| Pointer to the (public) tool used to retrieve the objects in a file. | |
| std::vector< std::string > | m_tesVetoList |
| Names of TES locations to Veto. | |
Extension of OutputStream to copy the content of the main input file.
On top of the standard behavior of OutputStream, this class takes also all the entries that come from the same file as the root entry in the data service.
Definition at line 21 of file InputCopyStream.h.
| InputCopyStream::InputCopyStream | ( | const std::string & | name, |
| ISvcLocator * | pSvcLocator | ||
| ) |
Standard algorithm Constructor.
Definition at line 20 of file InputCopyStream.cpp.
: OutputStream ( name, pSvcLocator), m_leavesTool ( NULL ), m_tesVetoList ( ) { m_doPreLoad = false; m_doPreLoadOpt = false; declareProperty( "TESVetoList", m_tesVetoList ); }
| InputCopyStream::~InputCopyStream | ( | ) | [virtual] |
| StatusCode InputCopyStream::collectObjects | ( | ) | [virtual] |
Collect all objects to be written to the output stream.
Reimplemented from OutputStream.
Definition at line 54 of file InputCopyStream.cpp.
{
// Get the objects in the same file as the root node
try
{
// Get all the leaves on the input stream
const IDataStoreLeaves::LeavesList & leaves = m_leavesTool->leaves();
// Do we need to veto anything ?
if ( UNLIKELY( !m_tesVetoList.empty() ) )
{
// Veto out locations
IDataStoreLeaves::LeavesList filteredLeaves;
filteredLeaves.reserve( leaves.size() );
for ( IDataStoreLeaves::LeavesList::const_iterator iL = leaves.begin();
iL != leaves.end(); ++iL )
{
if ( *iL && (*iL)->registry() )
{
if ( std::find( m_tesVetoList.begin(),
m_tesVetoList.end(),
(*iL)->registry()->identifier() ) == m_tesVetoList.end() )
{
filteredLeaves.push_back( (*iL) );
}
}
}
// saved the veto'ed list
m_objects.assign( filteredLeaves.begin(), filteredLeaves.end() );
}
else
{
// no veto'ing, so save everything
m_objects.assign( leaves.begin(), leaves.end() );
}
}
catch ( const GaudiException & e )
{
MsgStream log(msgSvc(), name());
log << MSG::ERROR << e.message() << endmsg;
return StatusCode::FAILURE;
}
// Collect the other objects from the transient store (mandatory and optional)
return OutputStream::collectObjects();
}
| StatusCode InputCopyStream::finalize | ( | ) | [virtual] |
Finalize the instance.
Reimplemented from OutputStream.
Definition at line 46 of file InputCopyStream.cpp.
{
toolSvc()->releaseTool(m_leavesTool).ignore();
m_leavesTool = NULL;
return OutputStream::finalize();
}
| virtual bool InputCopyStream::hasInput | ( | ) | const [inline, protected, virtual] |
Overriden from the base class (InputCopyStream has always input).
Reimplemented from OutputStream.
Definition at line 55 of file InputCopyStream.h.
{
return true;
}
| StatusCode InputCopyStream::initialize | ( | ) | [virtual] |
Initialize the instance.
Reimplemented from OutputStream.
Definition at line 34 of file InputCopyStream.cpp.
{
StatusCode sc = OutputStream::initialize();
if ( sc.isFailure() ) return sc;
sc = toolSvc()->retrieveTool("DataSvcFileEntriesTool", "InputCopyStreamTool",
m_leavesTool);
return sc;
}
IDataStoreLeaves* InputCopyStream::m_leavesTool [private] |
Pointer to the (public) tool used to retrieve the objects in a file.
Definition at line 47 of file InputCopyStream.h.
bool InputCopyStream::m_takeOptionalFromTES [private] |
Allow optional items to be on TES instead of input file.
Definition at line 44 of file InputCopyStream.h.
std::vector<std::string> InputCopyStream::m_tesVetoList [private] |
Names of TES locations to Veto.
Definition at line 50 of file InputCopyStream.h.