|
Gaudi Framework, version v22r4 |
| Home | Generated: Fri Sep 2 2011 |
Definition of class EventSelectorDataStream. More...
#include <EventSelectorDataStream.h>


Public Types | |
| typedef std::vector < StringProperty > | Properties |
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. | |
| StringProperty * | property (const std::string &nam) |
| Allow access to individual properties by name. | |
| const StringProperty * | property (const std::string &nam) const |
| Allow access to individual properties by name (CONST) | |
| const Properties & | properties () |
| Access properties. | |
| const std::string & | name () const |
| Retrieve stream name. | |
| const std::string & | criteria () const |
| Retrieve stream criteria. | |
| const std::string & | dbName () const |
| Retrieve stream dbName. | |
| const std::string & | selectorType () const |
| Retrieve event selector type. | |
| const std::string & | definition () const |
| Retrieve definition string. | |
| IEvtSelector * | selector () 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. | |
| IEvtSelector * | m_pSelector |
| Pointer to valid selector. | |
| ISvcLocator * | m_pSvcLocator |
| Reference to service locator. | |
| Properties * | m_properties |
| Properties vector. | |
| bool | m_initialized |
| Initialization state. | |
Friends | |
| MsgStream & | operator<< (MsgStream &s, const EventSelectorDataStream &obj) |
| Output friend for MsgStream. | |
| std::ostream & | operator<< (std::ostream &s, const EventSelectorDataStream &obj) |
| Output friend for standard I/O. | |
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 | +---------+----------------------------------------------+------------+
Definition at line 45 of file EventSelectorDataStream.h.
Definition at line 51 of file EventSelectorDataStream.h.
| EventSelectorDataStream::~EventSelectorDataStream | ( | ) | [protected, virtual] |
Standard Destructor.
Definition at line 50 of file EventSelectorDataStream.cpp.
{
setSelector(0);
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_pSelector(0), m_pSvcLocator(svcloc) { m_name = nam; m_definition = def; m_initialized = false; m_properties = new Properties(); }
| 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 | ( | void | ) | [virtual] |
Finalize stream and release resources.
Definition at line 220 of file EventSelectorDataStream.cpp.
{
setSelector(0);
if ( m_properties ) {
m_properties->clear();
}
m_initialized = false;
return StatusCode::SUCCESS;
}
| StatusCode EventSelectorDataStream::initialize | ( | void | ) | [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);
SmartIF<IDataManagerSvc> eds(m_pSvcLocator->service("EventDataSvc"));
if( !eds.isValid() ) {
std::cout << "ERROR: Unable to localize interface IDataManagerSvc from service EventDataSvc"
<< std::endl;
return StatusCode::FAILURE;
}
else {
cnt = eds->rootName();
}
m_selectorType = m_criteria = m_dbName= "";
m_properties->erase(m_properties->begin(), m_properties->end());
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:
m_properties->push_back(StringProperty(tag,val));
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 {
m_selectorType = svc;
}
StatusCode status = StatusCode::SUCCESS;
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("Item", item));
m_properties->push_back( StringProperty("Criteria", sel));
m_properties->push_back( StringProperty("DbType", dbtyp));
m_properties->push_back( StringProperty("DB", m_criteria));
if ( !isData && !collsvc.empty() ) {
m_properties->push_back( StringProperty("DbService", collsvc));
}
m_initialized = status.isSuccess();
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] |
| 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.
{
for ( Properties::iterator i = m_properties->begin(); i != m_properties->end(); i++ ) {
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.
{
for ( Properties::const_iterator i = m_properties->begin(); i != m_properties->end(); i++ ) {
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.
{
return m_selectorType;
}
| void EventSelectorDataStream::setSelector | ( | IEvtSelector * | pSelector ) | [virtual] |
Attach event selector object.
Definition at line 56 of file EventSelectorDataStream.cpp.
{
if ( 0 != pSelector ) pSelector->addRef();
if ( 0 != m_pSelector ) m_pSelector->release();
m_pSelector = pSelector;
}
| 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;
}
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.