Go to the documentation of this file.
36 #define ON_DEBUG if ( msgLevel( MSG::DEBUG ) )
41 return algState.state() == AlgExecState::State::Done && algState.filterPassed();
55 if ( status.isFailure() )
return status;
58 fatal() <<
"property Output not set. OutputStream instances require an output" <<
endmsg;
67 fatal() <<
"Unable to locate IDataManagerSvc interface" <<
endmsg;
73 warning() <<
"Error retrieving IncidentSvc." <<
endmsg;
79 fatal() <<
"Unable to locate IDataProviderSvc interface of " <<
m_storeName <<
endmsg;
85 fatal() <<
"Unable to connect to conversion service." <<
endmsg;
110 if ( theAlgorithm ) {
116 for (
const auto& i : a.second )
addItem( items, i );
185 if (
sel->begin() !=
sel->end() ) {
190 for (
auto&
j : *
sel ) {
200 const std::string loc = (
j->registry() ?
j->registry()->identifier() :
"UnRegistered" );
201 fatal() <<
"std::exception during createRep for '" << loc <<
"' " <<
System::typeinfoName(
typeid( *
j ) )
207 for (
auto&
j : *
sel ) {
213 const std::string loc = (
j->registry() ?
j->registry()->identifier() :
"UnRegistered" );
214 fatal() <<
"std::exception during fillRepRefs for '" << loc <<
"'" <<
System::typeinfoName(
typeid( *
j ) )
234 if ( level < m_currentItem->depth() ) {
282 auto alg = iAlgItems.first;
283 const Items& items = iAlgItems.second;
284 if ( passed(
alg ) ) {
286 debug() <<
"Algorithm '" <<
alg->name() <<
"' fired. Adding " << items <<
endmsg;
287 for (
const auto& i : items ) {
295 error() <<
"Cannot write mandatory (algorithm dependent) object(s) (Not found) " <<
m_currentItem->
path()
309 if ( !unique.count( o ) ) {
326 for (
auto& i : itms )
delete i;
344 auto sep = descriptor.
rfind(
"#" );
346 if ( sep != std::string::npos ) {
351 size_t idx = obj_path.
find(
"/", 1 );
352 while ( idx != std::string::npos ) {
355 idx = obj_path.
find(
"/", idx + 1 );
359 const auto& item = itms.
back();
361 debug() <<
"Adding OutputStream item " << item->path() <<
" with " << item->depth() <<
" level(s)." <<
endmsg;
372 switch ( ::
toupper( tag[0] ) ) {
380 switch ( ::
toupper( tag[1] ) ) {
390 switch ( ::
toupper( val[0] ) ) {
392 if ( ::strncasecmp( val.
c_str(),
"RECREATE", 3 ) == 0 )
394 else if ( ::strncasecmp( val.
c_str(),
"READ", 3 ) == 0 )
423 fatal() <<
"Unable to locate IPersistencySvc interface of " <<
m_persName <<
endmsg;
427 status = ipers->getService( typ, cnvSvc );
429 fatal() <<
"Unable to locate IConversionSvc interface of database type " << typ <<
endmsg;
435 fatal() <<
"Unable to locate IConversionSvc interface (Unknown technology) " <<
endmsg
436 <<
"You either have to specify a technology name or a service name!" <<
endmsg
437 <<
"Please correct the job option \"" <<
name() <<
".Output\" !" <<
endmsg;
459 fatal() <<
"Can't locate ApplicationMgr!!!" <<
endmsg;
462 if ( !theAlgorithm ) { warning() <<
"Failed to decode Algorithm name " << theName <<
endmsg; }
473 for (
const auto& it : theNames.value() ) {
476 if ( theAlgorithm ) {
479 theAlgorithm->addRef();
483 info() << it <<
" doesn't exist - ignored" <<
endmsg;
A small to stream Data I/O.
virtual StatusCode collectObjects()
Collect all objects to be written to the output stream.
Gaudi::Property< bool > m_verifyItems
std::vector< Gaudi::Algorithm * > m_requireAlgs
Vector of Algorithms that this stream requires.
void toupper(std::string &s)
DataStoreItem * m_currentItem
Keep track of the current item.
void clearItems(Items &itms)
Clear item list.
Gaudi::Property< std::vector< std::string > > m_vetoNames
bool m_fireIncidents
should I fire incidents for writing opening/closing etc? in the baseclass, always fire the incidents ...
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
Items m_optItemList
Vector of optional items to be saved to this stream.
GAUDI_API const EventContext & currentContext()
const std::string & name() const override
The identifying name of the algorithm object.
std::string m_outputType
Output type: NEW(NEW,CREATE,WRITE,RECREATE), UPDATE)
int m_events
Number of events written to this output stream.
Gaudi::Property< ItemNames > m_optItemNames
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Gaudi::Property< std::string > m_output
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
StatusCode finalize() override
Terminate OutputStream.
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
IDataSelector * selectedObjects()
Return the list of selected objects.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Gaudi::Property< bool > m_doPreLoad
SmartIF< IConversionSvc > m_pConversionSvc
Keep reference to the data conversion service.
Gaudi::Property< std::string > m_outputName
std::vector< Gaudi::Algorithm * > m_vetoAlgs
Vector of Algorithms that this stream is vetoed by.
Gaudi::Property< std::vector< std::string > > m_requireNames
StatusCode initialize() override
Initialize OutputStream.
virtual bool collect(IRegistry *dir, int level)
Store agent's classback.
DataStoreItem * findItem(const std::string &path)
Find single item identified by its path (exact match)
virtual StatusCode connectConversionSvc()
SmartIF< IDataProviderSvc > m_pDataProvider
Keep reference to the data provider service.
AlgDependentItems m_algDependentItems
Items to be saved for specific algorithms.
void clearSelection()
Clear list of selected objects.
Base class from which all concrete algorithm classes should be derived.
void addItem(Items &itms, const std::string &descriptor)
Add item to output streamer list.
const ValueType & value() const
virtual bool hasInput() const
Tell if the instance has been configured with input items or not.
virtual StatusCode writeObjects()
Select the different objects and write them to file.
Gaudi::Property< AlgDependentItemNames > m_algDependentItemList
SmartIF< IDataManagerSvc > m_pDataManager
Keep reference to the data manager service.
virtual void setAddress(IOpaqueAddress *pAddress)=0
Set/Update Opaque storage address.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
StatusCode start() override
Start OutputStream.
bool useUpdateHandler() override
manual trigger for callback for update
Items m_itemList
Vector of items to be saved to this stream.
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Gaudi::Property< std::string > m_storeName
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
constexpr static const auto SUCCESS
TYPE * get() const
Get interface pointer.
#define DECLARE_COMPONENT(type)
Gaudi::Property< bool > m_doPreLoadOpt
StatusCode execute() override
Working entry point.
virtual DataObject * object() const =0
Retrieve object behind the link.
Gaudi::Algorithm * decodeAlgorithm(const std::string &theName)
Decode a single algorithm name.
bool isEventAccepted() const
Test whether this event should be output.
const std::string & path() const
Accessor: Retrieve load path.
constexpr static const auto FAILURE
void decodeAlgorithms(Gaudi::Property< std::vector< std::string >> &theNames, std::vector< Gaudi::Algorithm * > &theAlgs)
Decode specified list of Algorithms.
Gaudi::Property< ItemNames > m_itemNames
Parse attribute strings allowing iteration over the various attributes.
Implementation of property with value of concrete type.
StatusCode collectFromSubTree(DataObject *)
IDataSelector m_objects
Collection of objects being selected.
std::vector< Gaudi::Algorithm * > m_acceptAlgs
Vector of Algorithms that this stream accepts.
Gaudi::Property< std::string > m_persName
Gaudi::Property< std::vector< std::string > > m_acceptNames