ATLAS Offline Software
Loading...
Searching...
No Matches
MVFVxContainerCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5//-----------------------------------------------------------------------------
6//
7// file: MVFVxContainerCnv.cxx
8// author: Kirill Prokofiev <Kirill.Prokofiev@cern.ch>
9//
10//-----------------------------------------------------------------------------
11
12
13#include "MVFVxContainerCnv.h"
14
15
16//-----------------------------------------------------------------------------
17// Constructor
18//-----------------------------------------------------------------------------
19
22 {
23
24 }
25
26//-----------------------------------------------------------------------------
27// Initializer
28//-----------------------------------------------------------------------------
30{
31 MsgStream log(msgSvc());
32
34 if( sc.isFailure() )
35 {
36 log << MSG::FATAL << "Could not initialize MVFVxContainerCnvBase" << endmsg;
37 return sc;
38 }
39
40//-------------------------------------------------------------------------
41// Set up the message stream
42//-------------------------------------------------------------------------
43 // log.setLevel( m_msgSvc->outputLevel() );
44 log << MSG::INFO << "MVFVxContainerCnv::initialize()" << endmsg;
45 return StatusCode::SUCCESS;
46}
47
48
50{
51 MsgStream log(msgSvc(), "MVFVxContainerCnv" );
52 log << MSG::ERROR << "createPersistent() is obsolete" << endmsg;
53 return nullptr;
54}
55
56
58{
59 MsgStream log(msgSvc());
60 static const pool::Guid p1_guid( "D7BAA7AD-1A46-4DA3-9CA7-350A1A3F0656" );
61 static const pool::Guid p0_guid( "6C6999B7-F961-4B72-B6D9-DF71CB2364CC" );
62
63 MVFVxContainer *p_collection = nullptr;
64
65 if( compareClassGuid( p1_guid ) ) {
66 // std::cout << "MVFVxContainerCnv::createTransient()" << std::endl;
67 /*
68 usingTPCnvForReading( m_TPConverter );
69 std::unique_ptr< MVFVxContainer_PERS > p_coll( poolReadObject< MVFVxContainer_PERS >() );
70 */
72 p_collection = m_TPConverter.createTransient( log );
73
74 } else if( compareClassGuid( p0_guid ) ) {
75 // std::cout << "MVFVxContainerCnv::createTransient: use old converter" << std::endl;
76 p_collection = poolReadObject< MVFVxContainer >();
77 } else
78 throw std::runtime_error( "Unsupported persistent version of MVFVxContainer (unknown GUID)" );
79
80 return p_collection;
81}
82
83
84void MVFVxContainerCnv::readObjectFromPool( const std::string& token )
85{
86 static const pool::Guid p1_guid( "D7BAA7AD-1A46-4DA3-9CA7-350A1A3F0656" );
87
88 // set the POOL token which will be used for reading from POOL
89 setToken( token );
90
91 // select the object type based on its GUID
92 if( compareClassGuid( p1_guid ) ) {
93 // read the object using the main TP converter
95 }
96 else
97 throw std::runtime_error( "Unsupported version of MVFVxContainer (unknown GUID)" );
98}
99
100// void MVFVxContainerCnv::updateLog(){
101// DataObject* dObj = getDataObject();
102// if (dObj==0) return; // Can't do much if this fails.
103// const std::string key = (dObj->name());
104//
105// log.m_source="MVFVxContainerCnv: "+key; // A hack - relies on getting access to private data of MsgStream via #define trick. EJWM.
106// }
107
#define endmsg
static Double_t sc
T_AthenaPoolExtendingCnv< MVFVxContainer, MVFVxContainer_PERS > MVFVxContainerCnvBase
Trk::MVFVxContainer_tlp1 MVFVxContainer_PERS
MVFVxContainerCnv(ISvcLocator *svcloc)
virtual MVFVxContainer * createTransient() override
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
virtual MVFVxContainer_PERS * createPersistent(MVFVxContainer *transCont) override
no-op
virtual void readObjectFromPool(const std::string &token) override
Read the persistent object from POOL.
MVFVxContainerCnv_tlp1 m_TPConverter
virtual void setToken(const std::string &token) override