Gaudi Framework, version v22r4

Home   Generated: Fri Sep 2 2011
Public Member Functions | Protected Member Functions | Private Attributes

InputCopyStream Class Reference

Extension of OutputStream to copy the content of the main input file. More...

#include <InputCopyStream.h>

Inheritance diagram for InputCopyStream:
Inheritance graph
[legend]
Collaboration diagram for InputCopyStream:
Collaboration graph
[legend]

List of all members.

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.
IDataStoreLeavesm_leavesTool
 Pointer to the (public) tool used to retrieve the objects in a file.

Detailed Description

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.

Author:
: M. Frank
: P. Koppenburg
: M. Clemencic

Definition at line 21 of file InputCopyStream.h.


Constructor & Destructor Documentation

InputCopyStream::InputCopyStream ( const std::string name,
ISvcLocator pSvcLocator 
)

Standard algorithm Constructor.

Definition at line 20 of file InputCopyStream.cpp.

 : OutputStream(name, pSvcLocator), m_leavesTool(0)
{
  m_doPreLoad      = false;
  m_doPreLoadOpt   = false;
}
InputCopyStream::~InputCopyStream (  ) [virtual]

Standard Destructor.

Definition at line 28 of file InputCopyStream.cpp.

                                    {
}

Member Function Documentation

StatusCode InputCopyStream::collectObjects (  ) [virtual]

Collect all objects to be written to the output stream.

Reimplemented from OutputStream.

Definition at line 52 of file InputCopyStream.cpp.

                                             {
  MsgStream log(msgSvc(), name());

  // Get the objects in the same file as the root node
  try {
    const IDataStoreLeaves::LeavesList & leaves = m_leavesTool->leaves();
    m_objects.assign(leaves.begin(), leaves.end());
  } catch (GaudiException &e) {
    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 ( void   ) [virtual]

Finalize the instance.

Reimplemented from OutputStream.

Definition at line 44 of file InputCopyStream.cpp.

                                     {
  toolSvc()->releaseTool(m_leavesTool).ignore();
  m_leavesTool = 0;

  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 47 of file InputCopyStream.h.

  {
    return true;
  }
StatusCode InputCopyStream::initialize ( void   ) [virtual]

Initialize the instance.

Reimplemented from OutputStream.

Definition at line 32 of file InputCopyStream.cpp.

                                       {
  StatusCode sc = OutputStream::initialize();
  if (sc.isFailure()) return sc;

  sc = toolSvc()->retrieveTool("DataSvcFileEntriesTool", "InputCopyStreamTool",
                               m_leavesTool);
  if (sc.isFailure()) return sc;

  return StatusCode::SUCCESS;
}

Member Data Documentation

Pointer to the (public) tool used to retrieve the objects in a file.

Definition at line 42 of file InputCopyStream.h.

Allow optional items to be on TES instead of input file.

Definition at line 39 of file InputCopyStream.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Fri Sep 2 2011 16:25:28 for Gaudi Framework, version v22r4 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004