| # Gaudi Framework, version v22r0 |

Home |  | Generated: 9 Feb 2011

# InputCopyStream Class Reference

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

`#include <InputCopyStream.h>`

Inheritance diagram for InputCopyStream:
[legend]
Collaboration diagram for InputCopyStream:
[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.
IDataStoreLeaves * | m_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.

    00021  : OutputStream(name, pSvcLocator), m_leavesTool(0)
    00022 {
    00023   m_doPreLoad      = false;
    00024   m_doPreLoadOpt   = false;
    00025 }

InputCopyStream::~InputCopyStream | ( |  | ) | `[virtual]`

Standard Destructor.

Definition at line 28 of file InputCopyStream.cpp.

    00028                                     {
    00029 }

## 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.

    00052                                              {
    00053   MsgStream log(msgSvc(), name());
    00054
    00055   // Get the objects in the same file as the root node
    00056   try {
    00057     const IDataStoreLeaves::LeavesList & leaves = m_leavesTool->leaves();
    00058     m_objects.assign(leaves.begin(), leaves.end());
    00059   } catch (GaudiException &e) {
    00060     log << MSG::ERROR << e.message() << endmsg;
    00061     return StatusCode::FAILURE;
    00062   }
    00063
    00064   // Collect the other objects from the transient store (mandatory and optional)
    00065   return OutputStream::collectObjects();
    00066 }

StatusCode InputCopyStream::finalize | ( |  | ) | `[virtual]`

Finalize the instance.

Reimplemented from OutputStream.

Definition at line 44 of file InputCopyStream.cpp.

    00044                                      {
    00045   toolSvc()->releaseTool(m_leavesTool).ignore();
    00046   m_leavesTool = 0;
    00047
    00048   return OutputStream::finalize();
    00049 }

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.

    00048   {
    00049     return true;
    00050   }

StatusCode InputCopyStream::initialize | ( |  | ) | `[virtual]`

Initialize the instance.

Reimplemented from OutputStream.

Definition at line 32 of file InputCopyStream.cpp.

    00032                                        {
    00033   StatusCode sc = OutputStream::initialize();
    00034   if (sc.isFailure()) return sc;
    00035
    00036   sc = toolSvc()->retrieveTool("DataSvcFileEntriesTool", "InputCopyStreamTool",
    00037                                m_leavesTool);
    00038   if (sc.isFailure()) return sc;
    00039
    00040   return StatusCode::SUCCESS;
    00041 }

## Member Data Documentation

IDataStoreLeaves* InputCopyStream::m_leavesTool`[private]`

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

Definition at line 42 of file InputCopyStream.h.

bool InputCopyStream::m_takeOptionalFromTES`[private]`

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:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r0/GaudiSvc/src/PersistencySvc/InputCopyStream.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r0/GaudiSvc/src/PersistencySvc/InputCopyStream.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines