00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <iostream>
00010 #include "GaudiKernel/SvcFactory.h"
00011 #include "GaudiKernel/SmartIF.h"
00012 #include "GaudiKernel/CnvFactory.h"
00013 #include "GaudiKernel/GenericAddress.h"
00014 #include "GaudiKernel/MsgStream.h"
00015 #include "GaudiKernel/ISvcLocator.h"
00016 #include "GaudiKernel/IDataProviderSvc.h"
00017 #include "GaudiKernel/IDataManagerSvc.h"
00018 #include "GaudiKernel/RegistryEntry.h"
00019 #include "GaudiKernel/IConversionSvc.h"
00020
00021 #include "McEventSelector/McCnvSvc.h"
00022 #include "McEventSelector/McEventCnv.h"
00023 #include "McEventSelector/McAddress.h"
00024 #include "McEventSelector/McEventSelector.h"
00025
00026
00027
00028
00029
00030
00031
00032
00034 McCnvSvc::McCnvSvc(const std::string& name, ISvcLocator* svc)
00035 : ConversionSvc( name, svc, storageType())
00036 {
00037 }
00038
00040 McCnvSvc::~McCnvSvc() {
00041 }
00042
00044 StatusCode McCnvSvc::initialize() {
00045 MsgStream log(msgSvc(), name());
00046 StatusCode status = ConversionSvc::initialize();
00047 return status;
00048 }
00049
00050 StatusCode McCnvSvc::finalize() {
00051 MsgStream log(msgSvc(), name());
00052 log << MSG::DEBUG << "RootCnvSvc::finalize" << endreq;
00053
00054 ConversionSvc::finalize();
00055
00056 return StatusCode::SUCCESS;
00057 }
00058
00059 StatusCode McCnvSvc::queryInterface(const InterfaceID& riid, void** ppvInterface) {
00060
00061 if ( IID_IMcCnvSvc == riid ) {
00062 *ppvInterface = (McCnvSvc*)this;
00063 }
00064 else {
00065
00066 return ConversionSvc::queryInterface(riid, ppvInterface);
00067 }
00068 addRef();
00069 return StatusCode::SUCCESS;
00070 }
00071
00073 StatusCode McCnvSvc::updateServiceState(IOpaqueAddress* pAddress) {
00074 MsgStream log(messageService(), name());
00075 static bool first = true;
00076
00077
00078 if ( 0 != pAddress ) {
00079 GenericAddress* pAddr = dynamic_cast<GenericAddress*>(pAddress);
00080 if ( 0 != pAddr ) {
00081 if ( first ) {
00082 first = false;
00083 }
00084 return StatusCode::SUCCESS;
00085 }
00086 }
00087 return StatusCode::FAILURE;
00088 }
00089
00090 unsigned char McCnvSvc::storageType() {
00091 static unsigned char type=0x10;
00092 return type;
00093 }