Gaudi Framework, version v23r7

Home   Generated: Wed Mar 20 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
EventSelectorDataStream Class Reference

Definition of class EventSelectorDataStream. More...

#include <EventSelectorDataStream.h>

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

Public Types

typedef std::vector
< StringProperty
Properties
 
- Public Types inherited from implements1< IInterface >
typedef implements1 base_class
 Typedef to this class.
 
typedef extend_interfaces1
< IInterface
extend_interfaces_base
 Typedef to the base of this class.
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces.
 
- Public Types inherited from extend_interfaces1< IInterface >
typedef IInterface::iid::iids::type ext_iids
 MPL set of interfaces extended by this one.
 
- Public Types inherited from IInterface
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...
 
typedef Gaudi::InterfaceId
< IInterface, 0, 0 > 
iid
 Interface ID.
 
typedef mpl::set1< iidext_iids
 Extra interfaces.
 

Public Member Functions

 EventSelectorDataStream (const std::string &nam, const std::string &def, ISvcLocator *svcloc)
 Standard Constructor.
 
virtual void setSelector (IEvtSelector *pSelector)
 Attach event selector object.
 
virtual StatusCode initialize ()
 Parse input criteria.
 
virtual StatusCode finalize ()
 Finalize stream and release resources.
 
StringPropertyproperty (const std::string &nam)
 Allow access to individual properties by name.
 
const StringPropertyproperty (const std::string &nam) const
 Allow access to individual properties by name (CONST)
 
const Propertiesproperties ()
 Access properties.
 
const std::stringname () const
 Retrieve stream name.
 
const std::stringcriteria () const
 Retrieve stream criteria.
 
const std::stringdbName () const
 Retrieve stream dbName.
 
const std::stringselectorType () const
 Retrieve event selector type.
 
const std::stringdefinition () const
 Retrieve definition string.
 
IEvtSelectorselector () const
 Retrieve event selector object.
 
bool isInitialized () const
 Check initialization status.
 

Protected Member Functions

virtual ~EventSelectorDataStream ()
 Standard Destructor.
 

Protected Attributes

std::string m_name
 Name.
 
std::string m_definition
 Definition string.
 
std::string m_criteria
 Criteria.
 
std::string m_dbName
 String with name of the db as parsed.
 
std::string m_selectorType
 Event selector type.
 
IEvtSelectorm_pSelector
 Pointer to valid selector.
 
ISvcLocatorm_pSvcLocator
 Reference to service locator.
 
Propertiesm_properties
 Properties vector.
 
bool m_initialized
 Initialization state.
 

Friends

MsgStreamoperator<< (MsgStream &s, const EventSelectorDataStream &obj)
 Output friend for MsgStream.
 
std::ostreamoperator<< (std::ostream &s, const EventSelectorDataStream &obj)
 Output friend for standard I/O.
 

Additional Inherited Members

- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface.
 

Detailed Description

Definition of class EventSelectorDataStream.

Small class which eases the management of multiple input streams for the event selector.

History: +------—+-------------------------------------------—+---------—+ | Date | Comment | Who | +------—+-------------------------------------------—+---------—+ | 3/10/00 | Initial version | M.Frank | +------—+-------------------------------------------—+---------—+ | 4/09/09 | Added m_dbName and dbName() | R. Lambert | +------—+-------------------------------------------—+---------—+

Author
Markus Frank
R. Lambert
Version
1.0

Definition at line 45 of file EventSelectorDataStream.h.

Member Typedef Documentation

Definition at line 51 of file EventSelectorDataStream.h.

Constructor & Destructor Documentation

EventSelectorDataStream::~EventSelectorDataStream ( )
protectedvirtual

Standard Destructor.

Definition at line 50 of file EventSelectorDataStream.cpp.

{
delete m_properties;
}
EventSelectorDataStream::EventSelectorDataStream ( const std::string nam,
const std::string def,
ISvcLocator svcloc 
)

Standard Constructor.

Definition at line 39 of file EventSelectorDataStream.cpp.

m_pSvcLocator(svcloc)
{
m_name = nam;
m_definition = def;
m_initialized = false;
}

Member Function Documentation

const std::string& EventSelectorDataStream::criteria ( ) const
inline

Retrieve stream criteria.

Definition at line 95 of file EventSelectorDataStream.h.

{
return m_criteria;
}
const std::string& EventSelectorDataStream::dbName ( ) const
inline

Retrieve stream dbName.

Definition at line 99 of file EventSelectorDataStream.h.

{
return m_dbName;
}
const std::string& EventSelectorDataStream::definition ( ) const
inline

Retrieve definition string.

Definition at line 107 of file EventSelectorDataStream.h.

{
return m_definition;
}
StatusCode EventSelectorDataStream::finalize ( )
virtual

Finalize stream and release resources.

Definition at line 220 of file EventSelectorDataStream.cpp.

StatusCode EventSelectorDataStream::initialize ( )
virtual

Parse input criteria.

Definition at line 83 of file EventSelectorDataStream.cpp.

{
bool isData = true;
std::string auth, dbtyp, collsvc, item, crit, sel, svc, stmt;
std::string cnt = "/Event";
std::string db = "<Unknown>";
Tokenizer tok(true);
if( !eds.isValid() ) {
std::cout << "ERROR: Unable to localize interface IDataManagerSvc from service EventDataSvc"
}
else {
cnt = eds->rootName();
}
tok.analyse(m_definition, " ", "", "", "=", "'", "'");
for ( Tokenizer::Items::iterator i = tok.items().begin(); i != tok.items().end(); i++ ) {
long hash = -1;
const std::string& tag = (*i).tag();
const std::string& val = (*i).value();
switch( ::toupper(tag[0]) ) {
case 'A':
auth = val;
break;
case 'C':
svc = "EvtTupleSvc";
isData = false;
case 'E':
hash = val.find('#');
if ( hash > 0 ) {
cnt = val.substr(0,hash);
item = val.substr(hash+1, val.length()-hash-1);
}
else {
cnt = val;
item = "Address";
}
break;
case 'D':
m_criteria = "FILE " + val;
m_dbName=val;
break;
case 'F':
switch( ::toupper(tag[1]) ) {
case 'I':
m_criteria = "FILE " + val;
m_dbName=val;
break;
case 'U':
stmt = val;
break;
default:
break;
}
break;
case 'J':
m_criteria = "JOBID " + val;
m_dbName=val;
dbtyp = "SICB";
break;
case 'T':
switch( ::toupper(tag[1]) ) {
case 'Y':
dbtyp = val;
break;
default:
break;
}
break;
case 'S':
switch( ::toupper(tag[1]) ) {
case 'E':
sel = val;
break;
case 'V':
svc = val;
collsvc = val;
break;
default:
break;
}
break;
default:
break;
}
}
if ( !isData ) { // Unfortunately options do not come in order...
m_selectorType = "EventCollectionSelector";
svc = "EvtTupleSvc";
}
else if ( dbtyp.substr(0,4) == "POOL" ) {
m_selectorType = "PoolDbEvtSelector";
}
else if ( svc.empty() ) {
m_selectorType = "DbEvtSelector";
}
else {
}
if ( svc.length() == 0 && dbtyp.length() != 0 ) {
SmartIF<IPersistencySvc> ipers(m_pSvcLocator->service("EventPersistencySvc"));
if ( ipers.isValid() ) {
IConversionSvc* icnvSvc = 0;
status = ipers->getService(dbtyp, icnvSvc);
if ( status.isSuccess() ) {
IService* isvc = 0;
status = icnvSvc->queryInterface(IService::interfaceID(), pp_cast<void>(&isvc));
if ( status.isSuccess() ) {
svc = isvc->name();
isvc->release();
}
}
}
}
m_properties->push_back( StringProperty("Function", stmt));
m_properties->push_back( StringProperty("CnvService", svc));
m_properties->push_back( StringProperty("Authentication",auth));
m_properties->push_back( StringProperty("Container", cnt));
m_properties->push_back( StringProperty("Criteria", sel));
m_properties->push_back( StringProperty("DbType", dbtyp));
if ( !isData && !collsvc.empty() ) {
m_properties->push_back( StringProperty("DbService", collsvc));
}
return status;
}
bool EventSelectorDataStream::isInitialized ( ) const
inline

Check initialization status.

Definition at line 115 of file EventSelectorDataStream.h.

{
return m_initialized;
}
const std::string& EventSelectorDataStream::name ( ) const
inline

Retrieve stream name.

Definition at line 91 of file EventSelectorDataStream.h.

{
return m_name;
}
const Properties& EventSelectorDataStream::properties ( )
inline

Access properties.

Definition at line 87 of file EventSelectorDataStream.h.

{
return *m_properties;
}
StringProperty * EventSelectorDataStream::property ( const std::string nam)

Allow access to individual properties by name.

Definition at line 63 of file EventSelectorDataStream.cpp.

{
if ( (*i).name() == nam ) {
return &(*i);
}
}
return 0;
}
const StringProperty * EventSelectorDataStream::property ( const std::string nam) const

Allow access to individual properties by name (CONST)

Definition at line 73 of file EventSelectorDataStream.cpp.

{
if ( (*i).name() == nam ) {
return &(*i);
}
}
return 0;
}
IEvtSelector* EventSelectorDataStream::selector ( ) const
inline

Retrieve event selector object.

Definition at line 111 of file EventSelectorDataStream.h.

{
return m_pSelector;
}
const std::string& EventSelectorDataStream::selectorType ( ) const
inline

Retrieve event selector type.

Definition at line 103 of file EventSelectorDataStream.h.

{
}
void EventSelectorDataStream::setSelector ( IEvtSelector pSelector)
virtual

Attach event selector object.

Definition at line 56 of file EventSelectorDataStream.cpp.

{
if ( 0 != pSelector ) pSelector->addRef();
m_pSelector = pSelector;
}

Friends And Related Function Documentation

MsgStream& operator<< ( MsgStream s,
const EventSelectorDataStream obj 
)
friend

Output friend for MsgStream.

Definition at line 27 of file EventSelectorDataStream.cpp.

{
s << "Stream:" << obj.name() << " Def:" << obj.definition();
return s;
}
std::ostream& operator<< ( std::ostream s,
const EventSelectorDataStream obj 
)
friend

Output friend for standard I/O.

Definition at line 33 of file EventSelectorDataStream.cpp.

{
s << "Stream:" << obj.name() << " Def:" << obj.definition();
return s;
}

Member Data Documentation

std::string EventSelectorDataStream::m_criteria
protected

Criteria.

Definition at line 58 of file EventSelectorDataStream.h.

std::string EventSelectorDataStream::m_dbName
protected

String with name of the db as parsed.

Definition at line 60 of file EventSelectorDataStream.h.

std::string EventSelectorDataStream::m_definition
protected

Definition string.

Definition at line 56 of file EventSelectorDataStream.h.

bool EventSelectorDataStream::m_initialized
protected

Initialization state.

Definition at line 70 of file EventSelectorDataStream.h.

std::string EventSelectorDataStream::m_name
protected

Name.

Definition at line 54 of file EventSelectorDataStream.h.

Properties* EventSelectorDataStream::m_properties
protected

Properties vector.

Definition at line 68 of file EventSelectorDataStream.h.

IEvtSelector* EventSelectorDataStream::m_pSelector
protected

Pointer to valid selector.

Definition at line 64 of file EventSelectorDataStream.h.

ISvcLocator* EventSelectorDataStream::m_pSvcLocator
protected

Reference to service locator.

Definition at line 66 of file EventSelectorDataStream.h.

std::string EventSelectorDataStream::m_selectorType
protected

Event selector type.

Definition at line 62 of file EventSelectorDataStream.h.


The documentation for this class was generated from the following files:

Generated at Wed Mar 20 2013 17:59:44 for Gaudi Framework, version v23r7 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004