45 void*
identifier()
const override {
return (
void*)m_pSelector; }
48 void setFileIterator( ListName::const_iterator new_iter ) { m_fileIterator = new_iter; }
63 error() <<
"Error initializing base class Service!" <<
endmsg;
68 error() <<
"Unable to locate IAddressCreator interface of " 69 <<
"EventPersistencySvc" <<
endmsg;
84 if ( svc && !db.
empty() ) {
86 ident +=
"DATAFILE='" +
m_database.value().substr( 5 ) +
"' ";
88 ident +=
"SVC='" +
m_dbSvc +
"' ";
91 ident +=
"OPT='READ' ";
105 status = tup->item( itName, *item );
107 error() <<
"Item " << itName <<
" is not part of the collection:" << top <<
endmsg;
111 error() <<
"Cannot connect to collection:" << top <<
endmsg;
122 if ( !crit.
empty() && seltyp.
length() == 0 ) seltyp =
"NTuple::Selector";
142 bool use_it = ( statement ) ? ( *statement )( tuple ) :
true;
143 if ( use_it ) {
return status; }
158 long* ip = (
long*)pAddr->
ipar();
165 bool use_it = ( statement ) ? ( *statement )( tuple ) :
true;
166 if ( use_it ) {
return status; }
220 auto ctxt = std::make_unique<MyContextType>();
226 refpCtxt = ctxt.release();
235 MyContextType* ctxt = dynamic_cast<MyContextType*>( &refCtxt );
239 for (
int i = 0; i < jump && sc.isSuccess(); ++i ) { sc =
getNextRecord( ctxt->
tuple ); }
250 MyContextType* ctxt = dynamic_cast<MyContextType*>( &refCtxt );
265 const MyContextType* ctxt = dynamic_cast<const MyContextType*>( &refCtxt );
275 error() <<
"Failed to access " << pA->
par()[0] <<
":" << pA->
par()[1] <<
" SvcTyp:" <<
long( pA->
svcType() )
285 MyContextType* ctxt = dynamic_cast<MyContextType*>( refCtxt );
297 MyContextType* ctxt = dynamic_cast<MyContextType*>( &refCtxt );
SmartIF< INTupleSvc > m_tupleSvc
Reference to Tuple service.
virtual const std::string * par() const =0
Retrieve String parameters.
StatusCode initialize() override
Small smart pointer class with automatic reference counting for IInterface.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
virtual StatusCode connectStatement(const std::string &typ, const std::string &crit, INTuple *tuple) const
Connect selection statement to refine data access.
IRegistry * registry() const
Get pointer to Registry.
StatusCode finalize() override
A select statement can either contain.
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ipar, IOpaqueAddress *&refpAddress)=0
Create a Generic address using explicit arguments to identify a single object.
EventCollectionContext(const EventCollectionSelector *pSelector)
Standard constructor.
The Event Selector Interface.
unsigned long addRef() override
Add reference to object.
unsigned long release() override
release reference to object
const std::string & currentInput() const
~EventCollectionContext() override
Standard destructor.
constexpr static const auto SUCCESS
Gaudi::Property< std::string > m_authentication
StatusCode previous(Context &refCtxt) const override
Get previous iteration item from the event loop context.
virtual StatusCode getPreviousRecord(NTuple::Tuple *tuple) const
Read next record of the N-tuple.
virtual StatusCode connectCollection(MyContextType *ctxt) const
Connect collection to selector.
virtual StatusCode getNextRecord(NTuple::Tuple *tuple) const
Read next record of the N-tuple.
Generic Transient Address.
virtual ISelectStatement * selector()=0
Access selector.
virtual long svcType() const =0
Retrieve service type.
GenericAddress * m_pAddressBuffer
Gaudi::Property< std::string > m_cntName
Gaudi::Property< std::string > m_database
StatusCode releaseContext(Context *&refCtxt) const override
Release existing event iteration context.
Gaudi::Property< std::string > m_tupleSvcName
#define DECLARE_COMPONENT(type)
NTuple interface class definition.
StatusCode finalize() override
Service override: Finalize Service.
virtual StatusCode connect(const std::string &logon, std::string &identifier)=0
Connect data source.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
const std::string & name() const override
Retrieve name of the service.
ListName::const_iterator fileIterator()
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
StatusCode last(Context &refCtxt) const override
Access last item in the iteration.
StatusCode next(Context &refCtxt) const override
Get next iteration item from the event loop context.
virtual const CLID & clID() const =0
Retrieve class information from link.
This class is used for returning status codes from appropriate routines.
void setFileIterator(ListName::const_iterator new_iter)
virtual StatusCode connectDataSource(const std::string &db, const std::string &typ) const
Connect collection's data source to selector.
StatusCode resetCriteria(const std::string &cr, Context &c) const override
Will set a new criteria for the selection of the next list of events and will change the state of the...
Gaudi::Property< std::string > m_statement
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Gaudi::Property< std::string > m_dbType
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual StatusCode connectTuple(const std::string &nam, const std::string &itName, NTuple::Tuple *&tup, NTuple::Item< IOpaqueAddress * > *&item) const
Connect to existing N-tuple.
Abstract base class which allows the user to interact with the actual N tuple implementation.
Gaudi::Property< std::string > m_criteria
Gaudi::Property< std::string > m_dbSvc
void setCurrentInput(const std::string &v)
const StatusCode & ignore() const
Ignore/check StatusCode.
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
Definition of class EventCollectionSelector.
virtual StatusCode readRecord(NTuple::Tuple *tuple)=0
Read single record from N tuple.
constexpr static const auto FAILURE
NTuple::Item< IOpaqueAddress * > * item
StatusCode initialize() override
Service override: Initialize service.
IOpaqueAddress * addressBuffer
std::list< std::string > ListName
StatusCode createAddress(const Context &refCtxt, IOpaqueAddress *&refpAddr) const override
Create new Opaque address corresponding to the current record.
Opaque address interface definition.
StatusCode rewind(Context &refCtxt) const override
Rewind the dataset.
SmartIF< IAddressCreator > m_pAddrCreator
virtual StatusCode attachSelector(ISelectStatement *sel)=0
Attach selector.
std::string m_currentInput
ListName::const_iterator m_fileIterator
virtual void setCriteria(const std::string &crit)=0
Set the type.
A DataObject is the base class of any identifiable object on any data store.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
void setCriteria(const std::string &crit)
Gaudi::Property< std::string > m_itemName
StatusCode createContext(Context *&refpCtxt) const override
Create a new event loop context.
void * identifier() const override