|
Gaudi Framework, version v21r8 |
| Home | Generated: 17 Mar 2010 |
#include <GaudiKernel/ConversionSvc.h>


Public Types | |
| typedef std::vector< WorkerEntry > | Workers |
Public Member Functions | |
| virtual StatusCode | initialize () |
| Initialize the service. | |
| virtual StatusCode | finalize () |
| stop the service. | |
| virtual long | repSvcType () const |
| Retrieve the class type of the data store the converter uses. | |
| const CLID & | objType () const |
| Implementation of IConverter: dummy call. | |
| virtual StatusCode | setDataProvider (IDataProviderSvc *pService) |
| Implementation of IConverter: Set Data provider service. | |
| virtual SmartIF < IDataProviderSvc > & | dataProvider () const |
| Implementation of IConverter: Get Data provider service. | |
| virtual StatusCode | setConversionSvc (IConversionSvc *svc) |
| Implementation of IConverter: Set conversion service the converter is connected to. | |
| virtual SmartIF< IConversionSvc > & | conversionSvc () const |
| Implementation of IConverter: Get conversion service the converter is connected to. | |
| virtual StatusCode | setAddressCreator (IAddressCreator *creator) |
| Set address creator facility. | |
| virtual SmartIF < IAddressCreator > & | addressCreator () const |
| Retrieve address creator facility. | |
| virtual StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) |
| Implementation of IConverter: Create the transient representation of an object. | |
| virtual StatusCode | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
| Implementation of IConverter: Resolve the references of the created transient object. | |
| virtual StatusCode | updateObj (IOpaqueAddress *pAddress, DataObject *refpObject) |
| Implementation of IConverter: Update the transient object from the other representation. | |
| virtual StatusCode | updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
| Implementation of IConverter: Update the references of an updated transient object. | |
| virtual StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) |
| Implementation of IConverter: Convert the transient object to the requested representation. | |
| virtual StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
| Implementation of IConverter: Resolve the references of the converted object. | |
| virtual StatusCode | updateRep (IOpaqueAddress *pAddress, DataObject *pObject) |
| Implementation of IConverter: Update the converted representation of a transient object. | |
| virtual StatusCode | updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
| Implementation of IConverter: Update the references of an already converted object. | |
| virtual StatusCode | addConverter (const CLID &clid) |
| Add converter object to conversion service. | |
| virtual StatusCode | addConverter (IConverter *pConverter) |
| Add converter object to conversion service. | |
| virtual StatusCode | removeConverter (const CLID &clid) |
| Remove converter object from conversion service (if present). | |
| virtual IConverter * | converter (const CLID &wanted) |
| Retrieve converter from list. | |
| virtual StatusCode | connectOutput (const std::string &outputFile, const std::string &openMode) |
| Connect the output file to the service with open mode. | |
| virtual StatusCode | connectOutput (const std::string &output) |
| Connect the output file to the service. | |
| virtual StatusCode | commitOutput (const std::string &output, bool do_commit) |
| Commit pending output. | |
| virtual StatusCode | createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) |
| Create a Generic address using explicit arguments to identify a single object. | |
| virtual StatusCode | convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) |
| Convert an address to string form. | |
| virtual StatusCode | createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) |
| Convert an address in string form to object form. | |
| virtual StatusCode | updateServiceState (IOpaqueAddress *pAddress) |
| Update state of the service. | |
| ConversionSvc (const std::string &name, ISvcLocator *svc, long type) | |
| Standard Constructor. | |
Protected Member Functions | |
| virtual | ~ConversionSvc () |
| Standard Destructor. | |
| virtual IConverter * | createConverter (long typ, const CLID &clid, const ICnvFactory *fac) |
| Create new Converter using factory. | |
| virtual StatusCode | configureConverter (long typ, const CLID &clid, IConverter *cnv) |
| Configure the new converter before initialize is called. | |
| virtual StatusCode | initializeConverter (long typ, const CLID &clid, IConverter *cnv) |
| Initialize the new converter. | |
| virtual StatusCode | activateConverter (long typ, const CLID &clid, IConverter *cnv) |
| Activate the new converter after initialization. | |
| virtual void | loadConverter (DataObject *pObject) |
| Load converter or dictionary needed by the converter. | |
| virtual SmartIF < IAddressCreator > & | addressCreator () |
| Retrieve address creation interface. | |
| StatusCode | makeCall (int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject) |
Protected Attributes | |
| SmartIF< IDataProviderSvc > | m_dataSvc |
| Pointer to data provider service. | |
| SmartIF< IAddressCreator > | m_addressCreator |
| Pointer to the address creation service interface. | |
| SmartIF< IConversionSvc > | m_cnvSvc |
| Pointer to the IConversionSvc interface of this. | |
| long | m_type |
| Conversion service type. | |
| Workers * | m_workers |
| List of conversion workers. | |
Private Member Functions | |
| ConversionSvc (const ConversionSvc &) | |
| Fake copy constructor (never implemented). | |
| ConversionSvc & | operator= (const ConversionSvc &) |
| Fake assignment operator (never implemented). | |
Classes | |
| class | CnvTest |
| class | WorkerEntry |
It manages a set of Converters that are specialized for conversions of specific objects.
This supports self learning converters: User hooks include the following (overridable) entries:
configureConverter and activateConverter are user hooks, where the convetrer can be manipulated by the hosting service and knowledge can be supplied, which a "generic" converter cannot aquire itself.
These hooks allow any sub-classed conversion service to override the calls and create converters, which aquire the knowledge about their persistency type and the object type they convert during the initialization.
Only AFTER these three steps the converter must satisfy the storage type of the hosting service and the class type of the required object type.
Definition at line 47 of file ConversionSvc.h.
| typedef std::vector<WorkerEntry> ConversionSvc::Workers |
Definition at line 75 of file ConversionSvc.h.
| ConversionSvc::ConversionSvc | ( | const std::string & | name, | |
| ISvcLocator * | svc, | |||
| long | type | |||
| ) |
Standard Constructor.
Definition at line 407 of file ConversionSvc.cpp.
00408 : base_class(name, svc) 00409 { 00410 m_type = type; 00411 m_dataSvc = 0; 00412 m_cnvSvc = this; 00413 m_workers = new Workers(); 00414 setAddressCreator(this).ignore(); 00415 }
| ConversionSvc::~ConversionSvc | ( | ) | [protected, virtual] |
Standard Destructor.
Definition at line 418 of file ConversionSvc.cpp.
00418 { 00419 // Release all workers. 00420 for ( Workers::iterator i = m_workers->begin(); i != m_workers->end(); i++ ) { 00421 (*i).converter()->release(); 00422 } 00423 m_workers->erase(m_workers->begin(), m_workers->end() ); 00424 delete m_workers; 00425 }
| ConversionSvc::ConversionSvc | ( | const ConversionSvc & | ) | [private] |
Fake copy constructor (never implemented).
| StatusCode ConversionSvc::initialize | ( | ) | [virtual] |
Initialize the service.
Reimplemented from Service.
Reimplemented in PoolDbCnvSvc, and RootHistCnv::PersSvc.
Definition at line 282 of file ConversionSvc.cpp.
00282 { 00283 StatusCode status = Service::initialize(); 00284 return status; 00285 }
| StatusCode ConversionSvc::finalize | ( | void | ) | [virtual] |
stop the service.
Reimplemented from Service.
Reimplemented in PoolDbCnvSvc, and RootHistCnv::PersSvc.
Definition at line 288 of file ConversionSvc.cpp.
00288 { 00289 // Release all workers. 00290 MsgStream log(msgSvc(), name()); 00291 for ( Workers::iterator i = m_workers->begin(); i != m_workers->end(); i++ ) { 00292 if ( (*i).converter()->finalize().isFailure() ) { 00293 log << MSG::ERROR << "finalizing worker" << endmsg; 00294 } 00295 (*i).converter()->release(); 00296 } 00297 m_workers->erase(m_workers->begin(), m_workers->end() ); 00298 // release interfaces 00299 m_addressCreator = 0; 00300 m_dataSvc = 0; 00301 m_cnvSvc = 0; 00302 return Service::finalize(); 00303 }
| long ConversionSvc::repSvcType | ( | ) | const [virtual] |
Retrieve the class type of the data store the converter uses.
Definition at line 358 of file ConversionSvc.cpp.
00358 { 00359 return m_type; 00360 }
| const CLID & ConversionSvc::objType | ( | ) | const |
Implementation of IConverter: dummy call.
Retrieve the class type of objects the converter produces.
Definition at line 353 of file ConversionSvc.cpp.
00353 { 00354 return CLID_NULL; 00355 }
| StatusCode ConversionSvc::setDataProvider | ( | IDataProviderSvc * | pService | ) | [virtual] |
Implementation of IConverter: Set Data provider service.
Define transient data store.
| pService | Pointer to data provider service |
Reimplemented in PoolDbCnvSvc.
Definition at line 167 of file ConversionSvc.cpp.
00167 { 00168 if ( !pDataSvc ) return StatusCode::SUCCESS; //Atlas does not use DataSvc 00169 if ( m_dataSvc ) m_dataSvc->release(); 00170 m_dataSvc = pDataSvc; 00171 m_dataSvc->addRef(); 00172 Workers::iterator stop = m_workers->end(); 00173 Workers::iterator start = m_workers->begin(); 00174 for(Workers::iterator i=start; i != stop; i++ ) { 00175 IConverter* cnv = (*i).converter(); 00176 if ( 0 != cnv ) { 00177 if (cnv->setDataProvider(m_dataSvc).isFailure()) { 00178 MsgStream log(msgSvc(), name()); 00179 log << MSG::ERROR << "setting Data Provider" << endmsg; 00180 } 00181 } 00182 } 00183 return StatusCode::SUCCESS; 00184 }
| SmartIF< IDataProviderSvc > & ConversionSvc::dataProvider | ( | ) | const [virtual] |
Implementation of IConverter: Get Data provider service.
Access the transient store.
Definition at line 187 of file ConversionSvc.cpp.
00187 { 00188 return m_dataSvc; 00189 }
| StatusCode ConversionSvc::setConversionSvc | ( | IConversionSvc * | svc | ) | [virtual] |
Implementation of IConverter: Set conversion service the converter is connected to.
Set conversion service the converter is connected to.
Definition at line 214 of file ConversionSvc.cpp.
00214 { 00215 return StatusCode::FAILURE; 00216 }
| SmartIF< IConversionSvc > & ConversionSvc::conversionSvc | ( | ) | const [virtual] |
Implementation of IConverter: Get conversion service the converter is connected to.
Get conversion service the converter is connected to.
Definition at line 219 of file ConversionSvc.cpp.
00219 { 00220 return m_cnvSvc; 00221 }
| StatusCode ConversionSvc::setAddressCreator | ( | IAddressCreator * | creator | ) | [virtual] |
Set address creator facility.
Definition at line 192 of file ConversionSvc.cpp.
00192 { 00193 m_addressCreator = creator; 00194 Workers::iterator stop = m_workers->end(); 00195 Workers::iterator start = m_workers->begin(); 00196 for(Workers::iterator i=start; i != stop; i++ ) { 00197 IConverter* cnv = (*i).converter(); 00198 if ( 0 != cnv ) { 00199 if (cnv->setAddressCreator(m_addressCreator).isFailure()) { 00200 MsgStream log(msgSvc(), name()); 00201 log << MSG::ERROR << "setting Address Creator" << endmsg; 00202 } 00203 } 00204 } 00205 return StatusCode::SUCCESS; 00206 }
| SmartIF< IAddressCreator > & ConversionSvc::addressCreator | ( | ) | const [virtual] |
Retrieve address creator facility.
Access the transient store.
Definition at line 209 of file ConversionSvc.cpp.
00209 { 00210 return m_addressCreator; 00211 }
| StatusCode ConversionSvc::createObj | ( | IOpaqueAddress * | pAddress, | |
| DataObject *& | refpObject | |||
| ) | [virtual] |
Implementation of IConverter: Create the transient representation of an object.
Create the transient representation of an object.
Definition at line 108 of file ConversionSvc.cpp.
00108 { 00109 return makeCall(CREATE_OBJ, false, true, false, pAddress, refpObj); 00110 }
| StatusCode ConversionSvc::fillObjRefs | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [virtual] |
Implementation of IConverter: Resolve the references of the created transient object.
Resolve the references of the created transient object.
Definition at line 113 of file ConversionSvc.cpp.
00113 { 00114 return makeCall(FILL_OBJ_REFS, false, true, true, pAddress, pObj); 00115 }
| StatusCode ConversionSvc::updateObj | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | refpObject | |||
| ) | [virtual] |
Implementation of IConverter: Update the transient object from the other representation.
Update the transient object from the other representation.
Definition at line 118 of file ConversionSvc.cpp.
00118 { 00119 return makeCall(UPDATE_OBJ, false, true, false, pAddress, pObj); 00120 }
| StatusCode ConversionSvc::updateObjRefs | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [virtual] |
Implementation of IConverter: Update the references of an updated transient object.
Update the references of an updated transient object.
Definition at line 123 of file ConversionSvc.cpp.
00123 { 00124 return makeCall(UPDATE_OBJ_REFS, false, true, true, pAddress, pObj); 00125 }
| StatusCode ConversionSvc::createRep | ( | DataObject * | pObject, | |
| IOpaqueAddress *& | refpAddress | |||
| ) | [virtual] |
Implementation of IConverter: Convert the transient object to the requested representation.
Convert the transient object to the requested representation.
Reimplemented in RootHistCnv::PersSvc.
Definition at line 128 of file ConversionSvc.cpp.
00128 { 00129 return makeCall(CREATE_REP, true, false, false, refpAddress, pObj); 00130 }
| StatusCode ConversionSvc::fillRepRefs | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [virtual] |
Implementation of IConverter: Resolve the references of the converted object.
Resolve the references of the converted object.
Definition at line 133 of file ConversionSvc.cpp.
00133 { 00134 return makeCall(FILL_REP_REFS, true, false, false, pAddress, pObj); 00135 }
| StatusCode ConversionSvc::updateRep | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [virtual] |
Implementation of IConverter: Update the converted representation of a transient object.
Update the converted representation of a transient object.
Definition at line 138 of file ConversionSvc.cpp.
00138 { 00139 return makeCall(UPDATE_REP, true, false, false, pAddress, pObj); 00140 }
| StatusCode ConversionSvc::updateRepRefs | ( | IOpaqueAddress * | pAddress, | |
| DataObject * | pObject | |||
| ) | [virtual] |
Implementation of IConverter: Update the references of an already converted object.
Update the references of an already converted object.
Definition at line 143 of file ConversionSvc.cpp.
00143 { 00144 return makeCall(UPDATE_REP_REFS, true, false, false, pAddress, pObj); 00145 }
| StatusCode ConversionSvc::addConverter | ( | const CLID & | clid | ) | [virtual] |
Add converter object to conversion service.
Definition at line 224 of file ConversionSvc.cpp.
00224 { 00225 // First look for the more specific converter 00226 long typ = repSvcType(); 00227 IConverter* pConverter = createConverter(typ, clid, 0); 00228 if ( 0 != pConverter ) { 00229 StatusCode status = configureConverter( typ, clid, pConverter ); 00230 if ( status.isSuccess() ) { 00231 status = initializeConverter( typ, clid, pConverter ); 00232 if ( status.isSuccess() ) { 00233 status = activateConverter( typ, clid, pConverter ); 00234 if ( status.isSuccess() ) { 00235 long conv_typ = pConverter->repSvcType(); 00236 const CLID& conv_clid = pConverter->objType(); 00237 typ = (typ<0xFF) ? typ : typ&0xFFFFFF00; 00238 conv_typ = (conv_typ<0xFF) ? conv_typ : conv_typ&0xFFFFFF00; 00239 if ( conv_typ == typ && conv_clid == clid ) { 00240 return addConverter(pConverter); 00241 } 00242 } 00243 } 00244 } 00245 pConverter->release(); 00246 } 00247 return NO_CONVERTER; 00248 }
| StatusCode ConversionSvc::addConverter | ( | IConverter * | pConverter | ) | [virtual] |
Add converter object to conversion service.
Definition at line 251 of file ConversionSvc.cpp.
00251 { 00252 if ( 0 != pConverter ) { 00253 const CLID& clid = pConverter->objType(); 00254 removeConverter(clid).ignore(); 00255 m_workers->push_back(WorkerEntry(clid, pConverter)); 00256 pConverter->addRef(); 00257 return StatusCode::SUCCESS; 00258 } 00259 return NO_CONVERTER; 00260 }
| StatusCode ConversionSvc::removeConverter | ( | const CLID & | clid | ) | [virtual] |
Remove converter object from conversion service (if present).
Definition at line 263 of file ConversionSvc.cpp.
00263 { 00264 CnvTest test(clid); 00265 Workers::iterator stop = m_workers->end(); 00266 Workers::iterator start = m_workers->begin(); 00267 for(Workers::iterator i=start; i != stop; i++ ) { 00268 if ( test( *i ) ) { 00269 (*i).converter()->finalize().ignore(); 00270 (*i).converter()->release(); 00271 } 00272 } 00273 Workers::iterator j = std::remove_if(start, stop, test); 00274 if ( j != stop ) { 00275 m_workers->erase(j, stop); 00276 return StatusCode::SUCCESS; 00277 } 00278 return NO_CONVERTER; 00279 }
| IConverter * ConversionSvc::converter | ( | const CLID & | wanted | ) | [virtual] |
Retrieve converter from list.
Definition at line 148 of file ConversionSvc.cpp.
00148 { 00149 IConverter* cnv = 0; 00150 Workers::iterator i = std::find_if(m_workers->begin(),m_workers->end(),CnvTest(clid)); 00151 if ( i != m_workers->end() ) { 00152 cnv = (*i).converter(); 00153 } 00154 if ( 0 == cnv ) { 00155 StatusCode status = addConverter(clid); 00156 if ( status.isSuccess() ) { 00157 i = std::find_if(m_workers->begin(),m_workers->end(),CnvTest(clid)); 00158 if ( i != m_workers->end() ) { 00159 cnv = (*i).converter(); 00160 } 00161 } 00162 } 00163 return cnv; 00164 }
| StatusCode ConversionSvc::connectOutput | ( | const std::string & | outputFile, | |
| const std::string & | openMode | |||
| ) | [virtual] |
Connect the output file to the service with open mode.
Reimplemented in PoolDbCnvSvc.
Definition at line 363 of file ConversionSvc.cpp.
00364 { 00365 return connectOutput(outputFile); 00366 }
| StatusCode ConversionSvc::connectOutput | ( | const std::string & | output | ) | [virtual] |
Connect the output file to the service.
Reimplemented in PoolDbCnvSvc.
Definition at line 369 of file ConversionSvc.cpp.
00369 { 00370 return StatusCode::SUCCESS; 00371 }
| StatusCode ConversionSvc::commitOutput | ( | const std::string & | output, | |
| bool | do_commit | |||
| ) | [virtual] |
Commit pending output.
Reimplemented in PoolDbCnvSvc.
Definition at line 374 of file ConversionSvc.cpp.
00374 { 00375 return StatusCode::SUCCESS; 00376 }
| StatusCode ConversionSvc::createAddress | ( | long | svc_type, | |
| const CLID & | clid, | |||
| const std::string * | par, | |||
| const unsigned long * | ip, | |||
| IOpaqueAddress *& | refpAddress | |||
| ) | [virtual] |
Create a Generic address using explicit arguments to identify a single object.
Reimplemented in PoolDbCnvSvc.
Definition at line 379 of file ConversionSvc.cpp.
00383 { 00384 refpAddress = 0; 00385 return StatusCode::FAILURE; 00386 }
| StatusCode ConversionSvc::convertAddress | ( | const IOpaqueAddress * | pAddress, | |
| std::string & | refAddress | |||
| ) | [virtual] |
Convert an address to string form.
Definition at line 389 of file ConversionSvc.cpp.
00391 { 00392 refAddress = ""; 00393 return StatusCode::FAILURE; 00394 }
| StatusCode ConversionSvc::createAddress | ( | long | svc_type, | |
| const CLID & | clid, | |||
| const std::string & | refAddress, | |||
| IOpaqueAddress *& | refpAddress | |||
| ) | [virtual] |
Convert an address in string form to object form.
Definition at line 397 of file ConversionSvc.cpp.
00401 { 00402 refpAddress = 0; 00403 return StatusCode::FAILURE; 00404 }
| StatusCode ConversionSvc::updateServiceState | ( | IOpaqueAddress * | pAddress | ) | [virtual] |
Update state of the service.
Reimplemented in PoolDbCnvSvc.
Definition at line 103 of file ConversionSvc.cpp.
00103 { 00104 return StatusCode::SUCCESS; 00105 }
| IConverter * ConversionSvc::createConverter | ( | long | typ, | |
| const CLID & | clid, | |||
| const ICnvFactory * | fac | |||
| ) | [protected, virtual] |
Create new Converter using factory.
Reimplemented in PoolDbCnvSvc.
Definition at line 307 of file ConversionSvc.cpp.
00309 { 00310 IConverter* pConverter; 00311 pConverter = PluginService::CreateWithId<IConverter*>(ConverterID(typ,clid),serviceLocator().get()); 00312 if ( 0 == pConverter ) { 00313 typ = (typ<0xFF) ? typ : typ&0xFFFFFF00; 00314 pConverter = PluginService::CreateWithId<IConverter*>(ConverterID(typ,clid),serviceLocator().get()); 00315 } 00316 return pConverter; 00317 }
| StatusCode ConversionSvc::configureConverter | ( | long | typ, | |
| const CLID & | clid, | |||
| IConverter * | cnv | |||
| ) | [protected, virtual] |
Configure the new converter before initialize is called.
Configure the freshly created converter.
Definition at line 320 of file ConversionSvc.cpp.
00322 { 00323 if ( 0 != pConverter ) { 00324 pConverter->setConversionSvc(this).ignore(); 00325 pConverter->setAddressCreator(m_addressCreator).ignore(); 00326 pConverter->setDataProvider(m_dataSvc).ignore(); 00327 return StatusCode::SUCCESS; 00328 } 00329 return NO_CONVERTER; 00330 }
| StatusCode ConversionSvc::initializeConverter | ( | long | typ, | |
| const CLID & | clid, | |||
| IConverter * | cnv | |||
| ) | [protected, virtual] |
Initialize the new converter.
Initialize new converter.
Definition at line 333 of file ConversionSvc.cpp.
00335 { 00336 if ( pConverter ) { 00337 return pConverter->initialize(); 00338 } 00339 return NO_CONVERTER; 00340 }
| StatusCode ConversionSvc::activateConverter | ( | long | typ, | |
| const CLID & | clid, | |||
| IConverter * | cnv | |||
| ) | [protected, virtual] |
Activate the new converter after initialization.
Activate the freshly created converter.
Definition at line 343 of file ConversionSvc.cpp.
00345 { 00346 if ( 0 != pConverter ) { 00347 return StatusCode::SUCCESS; 00348 } 00349 return NO_CONVERTER; 00350 }
| void ConversionSvc::loadConverter | ( | DataObject * | pObject | ) | [protected, virtual] |
Load converter or dictionary needed by the converter.
Reimplemented in PoolDbCnvSvc.
Definition at line 99 of file ConversionSvc.cpp.
| virtual SmartIF<IAddressCreator>& ConversionSvc::addressCreator | ( | ) | [inline, protected, virtual] |
Retrieve address creation interface.
Definition at line 216 of file ConversionSvc.h.
00216 { 00217 return m_addressCreator; 00218 }
| StatusCode ConversionSvc::makeCall | ( | int | typ, | |
| bool | ignore_add, | |||
| bool | ignore_obj, | |||
| bool | update, | |||
| IOpaqueAddress *& | pAddress, | |||
| DataObject *& | pObject | |||
| ) | [protected] |
Definition at line 27 of file ConversionSvc.cpp.
00032 { 00033 if ( 0 != pAddress || ignore_add ) { 00034 if ( 0 != pObject || ignore_obj ) { 00035 const CLID& obj_class = 00036 (0 != pObject && !ignore_obj) ? pObject->clID() 00037 : (0 != pAddress && !ignore_add) 00038 ? pAddress->clID() 00039 : CLID_NULL; 00040 IConverter* cnv = converter(obj_class); 00041 if ( !cnv && pObject ) { 00042 //Give it a try to autoload the class (dictionary) for which the converter is needed 00043 loadConverter( pObject); 00044 cnv = converter(obj_class); 00045 } 00046 00047 StatusCode status(StatusCode::FAILURE,true); 00048 if ( 0 != cnv ) { 00049 switch(typ) { 00050 case CREATE_OBJ: 00051 pObject = 0; 00052 status = cnv->createObj(pAddress, pObject); 00053 break; 00054 case FILL_OBJ_REFS: 00055 status = cnv->fillObjRefs(pAddress, pObject); 00056 break; 00057 case UPDATE_OBJ: 00058 status = cnv->updateObj(pAddress, pObject); 00059 break; 00060 case UPDATE_OBJ_REFS: 00061 status = cnv->updateObjRefs(pAddress, pObject); 00062 break; 00063 case CREATE_REP: 00064 pAddress = 0; 00065 status = cnv->createRep(pObject, pAddress); 00066 break; 00067 case FILL_REP_REFS: 00068 status = cnv->fillRepRefs(pAddress, pObject); 00069 break; 00070 case UPDATE_REP: 00071 status = cnv->updateRep(pAddress, pObject); 00072 break; 00073 case UPDATE_REP_REFS: 00074 status = cnv->updateRepRefs(pAddress, pObject); 00075 break; 00076 default: 00077 status = StatusCode::FAILURE; 00078 break; 00079 } 00080 if ( status.isSuccess() && update ) { 00081 status = updateServiceState(pAddress); 00082 } 00083 return status; 00084 } 00085 status.ignore(); 00086 MsgStream log(msgSvc(), name()); 00087 log << MSG::INFO << "No converter for object "; 00088 if ( pObject != 0 ) { 00089 log << System::typeinfoName(typeid(*pObject)); 00090 } 00091 log << " CLID= " << obj_class << endmsg; 00092 return NO_CONVERTER; 00093 } 00094 return INVALID_OBJECT; 00095 } 00096 return INVALID_ADDRESS; 00097 }
| ConversionSvc& ConversionSvc::operator= | ( | const ConversionSvc & | ) | [private] |
Fake assignment operator (never implemented).
SmartIF<IDataProviderSvc> ConversionSvc::m_dataSvc [mutable, protected] |
SmartIF<IAddressCreator> ConversionSvc::m_addressCreator [mutable, protected] |
SmartIF<IConversionSvc> ConversionSvc::m_cnvSvc [mutable, protected] |
long ConversionSvc::m_type [protected] |
Workers* ConversionSvc::m_workers [protected] |