Gaudi Framework, version v23r5
Home
Generated: Wed Nov 28 2012
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GaudiCommonSvc
src
PersistencySvc
InputCopyStream.cpp
Go to the documentation of this file.
1
// $Id: InputCopyStream.cpp,v 1.2 2006/01/10 20:09:27 hmd Exp $
2
#define GAUDISVC_PERSISTENCYSVC_INPUTCOPYSTREAM_CPP
3
4
// Framework include files
5
#include "
GaudiKernel/AlgFactory.h
"
6
#include "
GaudiKernel/IRegistry.h
"
7
#include "
GaudiKernel/IDataManagerSvc.h
"
8
#include "
GaudiKernel/IDataProviderSvc.h
"
9
#include "
GaudiKernel/IOpaqueAddress.h
"
10
#include "
GaudiKernel/DataStoreItem.h
"
11
#include "
GaudiKernel/DataObject.h
"
12
#include "
GaudiKernel/IDataStoreLeaves.h
"
13
#include "
GaudiKernel/MsgStream.h
"
14
#include "
InputCopyStream.h
"
15
16
// Define the algorithm factory for the standard output data writer
17
DECLARE_ALGORITHM_FACTORY
(
InputCopyStream
)
18
19
// Standard Constructor
20
InputCopyStream
::
InputCopyStream
(const
std
::
string
& name,
ISvcLocator
* pSvcLocator)
21
:
OutputStream
( name, pSvcLocator),
22
m_leavesTool ( NULL ),
23
m_tesVetoList ( )
24
{
25
m_doPreLoad =
false
;
26
m_doPreLoadOpt =
false
;
27
declareProperty(
"TESVetoList"
, m_tesVetoList );
28
}
29
30
// Standard Destructor
31
InputCopyStream::~InputCopyStream
() { }
32
33
// Initialize the instance.
34
StatusCode
InputCopyStream::initialize
()
35
{
36
StatusCode
sc
=
OutputStream::initialize
();
37
if
( sc.
isFailure
() )
return
sc;
38
39
sc =
toolSvc
()->retrieveTool(
"DataSvcFileEntriesTool"
,
"InputCopyStreamTool"
,
40
m_leavesTool
);
41
42
return
sc
;
43
}
44
45
// Finalize the instance.
46
StatusCode
InputCopyStream::finalize
()
47
{
48
toolSvc
()->releaseTool(
m_leavesTool
).ignore();
49
m_leavesTool
= NULL;
50
return
OutputStream::finalize
();
51
}
52
54
StatusCode
InputCopyStream::collectObjects
()
55
{
56
// Get the objects in the same file as the root node
57
try
58
{
59
// Get all the leaves on the input stream
60
const
IDataStoreLeaves::LeavesList
& leaves =
m_leavesTool
->
leaves
();
61
62
// Do we need to veto anything ?
63
if
(
UNLIKELY
( !
m_tesVetoList
.
empty
() ) )
64
{
65
// Veto out locations
66
IDataStoreLeaves::LeavesList
filteredLeaves;
67
filteredLeaves.
reserve
( leaves.
size
() );
68
for
(
IDataStoreLeaves::LeavesList::const_iterator
iL = leaves.
begin
();
69
iL != leaves.
end
(); ++iL )
70
{
71
if
( *iL && (*iL)->registry() )
72
{
73
if
(
std::find
(
m_tesVetoList
.
begin
(),
74
m_tesVetoList
.
end
(),
75
(*iL)->registry()->identifier() ) ==
m_tesVetoList
.
end
() )
76
{
77
filteredLeaves.
push_back
( (*iL) );
78
}
79
}
80
}
81
82
// saved the veto'ed list
83
m_objects
.
assign
( filteredLeaves.
begin
(), filteredLeaves.
end
() );
84
85
}
86
else
87
{
88
// no veto'ing, so save everything
89
m_objects
.
assign
( leaves.
begin
(), leaves.
end
() );
90
}
91
}
92
catch
(
const
GaudiException
& e )
93
{
94
MsgStream
log
(
msgSvc
(),
name
());
95
log <<
MSG::ERROR
<< e.
message
() <<
endmsg
;
96
return
StatusCode::FAILURE
;
97
}
98
99
// Collect the other objects from the transient store (mandatory and optional)
100
return
OutputStream::collectObjects
();
101
}
Generated at Wed Nov 28 2012 12:17:11 for Gaudi Framework, version v23r5 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004