ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
MVFVxContainerCnv Class Reference

#include <MVFVxContainerCnv.h>

Inheritance diagram for MVFVxContainerCnv:
Collaboration diagram for MVFVxContainerCnv:

Public Types

typedef T_AthenaPoolCustomCnv< TRANS, PERSBaseType
 

Public Member Functions

 MVFVxContainerCnv (ISvcLocator *svcloc)
 

Protected Member Functions

virtual StatusCode initialize () override
 
virtual MVFVxContainer_PERScreatePersistent (MVFVxContainer *transCont) override
 
virtual MVFVxContainercreateTransient () override
 
virtual AthenaPoolTopLevelTPCnvBasegetTopLevelTPCnv () override
 Return the top level TP converter (which is always used for writing) More...
 
virtual AthenaPoolCnvTPExtensionclone () override
 
virtual void readObjectFromPool (const std::string &token) override
 Read the persistent object from POOL. More...
 
virtual void readObject (const std::string &token)
 
virtual const TokenwriteObject (const std::string &key, const std::string &output)
 Write the persistent object to POOL. More...
 
virtual BaseTypebaseAthenaPoolCnv ()
 return the original AthenaPool converter this one was cloned from if not cloned this returns self if not registered this returns NULL More...
 
virtual void wasClonedFrom (AthenaConverterTLPExtension *orig_converter)
 remember the original converter this one was cloned from More...
 
virtual bool needsCloning () const
 tells if this converter needs to be cloned (true after the converter has been registered once already) More...
 
virtual void setToken (const std::string &token)
 Set the token (in std::string representation) and classID for the object that will be read next. More...
 
template<class P >
P * poolReadObject ()
 Read object of type P. More...
 
template<class P >
void poolReadObject (TopLevelTPCnvBase &tlp_converter)
 Read object of type P (plus all extending objects) using the indicated top-level TP converter. More...
 
virtual const std::string name () const
 Get the name of this converter (anything that identifies it). More...
 
virtual PERScreatePersistent (TRANS *)
 no-op More...
 

Protected Attributes

BaseTypem_originalExtendingCnv
 pointer to the original Gaudi converter - only this one is registered in the framework and has to be used for all I/O operations More...
 

Private Attributes

MVFVxContainerCnv_tlp1 m_TPConverter
 

Friends

class CnvFactory< MVFVxContainerCnv >
 

Detailed Description

Definition at line 33 of file MVFVxContainerCnv.h.

Member Typedef Documentation

◆ BaseType

Definition at line 29 of file T_AthenaPoolExtendingCnv.h.

Constructor & Destructor Documentation

◆ MVFVxContainerCnv()

MVFVxContainerCnv::MVFVxContainerCnv ( ISvcLocator *  svcloc)

Definition at line 20 of file MVFVxContainerCnv.cxx.

20  :
21  MVFVxContainerCnvBase(svcloc)
22  {
23 
24  }

Member Function Documentation

◆ baseAthenaPoolCnv()

virtual BaseType* T_AthenaPoolExtendingCnv::baseAthenaPoolCnv ( )
inlineprotectedvirtualinherited

return the original AthenaPool converter this one was cloned from if not cloned this returns self if not registered this returns NULL

Definition at line 58 of file T_AthenaPoolExtendingCnv.h.

58 { return m_originalExtendingCnv; }

◆ clone()

virtual AthenaPoolCnvTPExtension* MVFVxContainerCnv::clone ( )
inlineoverrideprotectedvirtual

Definition at line 53 of file MVFVxContainerCnv.h.

53 { return new MVFVxContainerCnv(0); }

◆ createPersistent() [1/2]

MVFVxContainer_PERS * MVFVxContainerCnv::createPersistent ( MVFVxContainer transCont)
overrideprotectedvirtual

Definition at line 49 of file MVFVxContainerCnv.cxx.

50 {
51  MsgStream log(msgSvc(), "MVFVxContainerCnv" );
52  log << MSG::ERROR << "createPersistent() is obsolete" << endmsg;
53  return nullptr;
54 }

◆ createPersistent() [2/2]

virtual PERS* T_AthenaPoolExtendingCnv::createPersistent ( TRANS *  )
inlineprotectedvirtualinherited

no-op

Definition at line 91 of file T_AthenaPoolExtendingCnv.h.

91 { return 0; }

◆ createTransient()

MVFVxContainer * MVFVxContainerCnv::createTransient ( )
overrideprotectedvirtual

Reimplemented from T_AthenaPoolExtendingCnv.

Definition at line 57 of file MVFVxContainerCnv.cxx.

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  */
71  poolReadObject< MVFVxContainer_PERS >( m_TPConverter );
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 }

◆ getTopLevelTPCnv()

virtual AthenaPoolTopLevelTPCnvBase* MVFVxContainerCnv::getTopLevelTPCnv ( )
inlineoverrideprotectedvirtual

Return the top level TP converter (which is always used for writing)

Implements T_AthenaPoolExtendingCnv.

Definition at line 51 of file MVFVxContainerCnv.h.

51 { return &m_TPConverter; }

◆ initialize()

StatusCode MVFVxContainerCnv::initialize ( )
overrideprotectedvirtual

Definition at line 29 of file MVFVxContainerCnv.cxx.

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 }

◆ name()

virtual const std::string T_AthenaPoolExtendingCnv::name ( ) const
protectedvirtualinherited

Get the name of this converter (anything that identifies it).

Used for logging

Returns
Name of this converter

◆ needsCloning()

virtual bool T_AthenaPoolExtendingCnv::needsCloning ( ) const
inlineprotectedvirtualinherited

tells if this converter needs to be cloned (true after the converter has been registered once already)

Definition at line 65 of file T_AthenaPoolExtendingCnv.h.

65 { return m_originalExtendingCnv != 0; }

◆ poolReadObject() [1/2]

template<class P >
P* T_AthenaPoolExtendingCnv::poolReadObject ( )
protectedinherited

Read object of type P.

This is an exception-throwing version of poolToObject() plus reading of all extending objects. Version 1 - (see createTransient() above)

Returns
object read from POOL (by pointer) deprecated - use poolReadObject(TLPCnv)

◆ poolReadObject() [2/2]

template<class P >
void T_AthenaPoolExtendingCnv::poolReadObject ( TopLevelTPCnvBase tlp_converter)
protectedinherited

Read object of type P (plus all extending objects) using the indicated top-level TP converter.

Version 2 - (see createTransient() above) NOTE: the TLP converter will delete the persistent object after createTransient()

Parameters
tlp_converter[IN] top-level TP converter to be used when reading

◆ readObject()

virtual void T_AthenaPoolExtendingCnv::readObject ( const std::string &  token)
inlineprotectedvirtualinherited

Definition at line 49 of file T_AthenaPoolExtendingCnv.h.

49 { this->readObjectFromPool(token); }

◆ readObjectFromPool()

void MVFVxContainerCnv::readObjectFromPool ( const std::string &  token)
overrideprotectedvirtual

Read the persistent object from POOL.

Parameters
token[IN] token of the object to read

Implements T_AthenaPoolExtendingCnv.

Definition at line 84 of file MVFVxContainerCnv.cxx.

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
94  poolReadObject< MVFVxContainer_PERS >( m_TPConverter );
95  }
96  else
97  throw std::runtime_error( "Unsupported version of MVFVxContainer (unknown GUID)" );
98 }

◆ setToken()

virtual void T_AthenaPoolExtendingCnv::setToken ( const std::string &  token)
protectedvirtualinherited

Set the token (in std::string representation) and classID for the object that will be read next.

Required by compareClassGuid() and poolReadObject(). Only extending converter needs to call this method explicitely

Parameters
token[IN] token for the object to be read

◆ wasClonedFrom()

virtual void T_AthenaPoolExtendingCnv::wasClonedFrom ( AthenaConverterTLPExtension orig_converter)
protectedvirtualinherited

remember the original converter this one was cloned from

◆ writeObject()

virtual const Token* T_AthenaPoolExtendingCnv::writeObject ( const std::string &  key,
const std::string &  output 
)
protectedvirtualinherited

Write the persistent object to POOL.

Parameters
key[IN] StoreGate key (string) - placement hint to generate POOL container name

Friends And Related Function Documentation

◆ CnvFactory< MVFVxContainerCnv >

friend class CnvFactory< MVFVxContainerCnv >
friend

Definition at line 31 of file MVFVxContainerCnv.h.

Member Data Documentation

◆ m_originalExtendingCnv

BaseType* T_AthenaPoolExtendingCnv::m_originalExtendingCnv
protectedinherited

pointer to the original Gaudi converter - only this one is registered in the framework and has to be used for all I/O operations

Definition at line 95 of file T_AthenaPoolExtendingCnv.h.

◆ m_TPConverter

MVFVxContainerCnv_tlp1 MVFVxContainerCnv::m_TPConverter
private

Definition at line 58 of file MVFVxContainerCnv.h.


The documentation for this class was generated from the following files:
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
T_AthenaPoolExtendingCnv::readObjectFromPool
virtual void readObjectFromPool(const std::string &token)=0
Read the persistent object from POOL.
MVFVxContainerCnv::m_TPConverter
MVFVxContainerCnv_tlp1 m_TPConverter
Definition: MVFVxContainerCnv.h:58
MVFVxContainer
Definition: MVFVxContainer.h:31
initialize
void initialize()
Definition: run_EoverP.cxx:894
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
TopLevelTPConverter::createTransient
TRANS * createTransient(MsgStream &log)
Create transient representation of the persistent object known to this converter.
Definition: TopLevelTPConverter.h:62
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
T_AthenaPoolExtendingCnv::setToken
virtual void setToken(const std::string &token)
Set the token (in std::string representation) and classID for the object that will be read next.
MVFVxContainerCnv::MVFVxContainerCnv
MVFVxContainerCnv(ISvcLocator *svcloc)
Definition: MVFVxContainerCnv.cxx:20
T_AthenaPoolExtendingCnv::m_originalExtendingCnv
BaseType * m_originalExtendingCnv
pointer to the original Gaudi converter - only this one is registered in the framework and has to be ...
Definition: T_AthenaPoolExtendingCnv.h:95
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MVFVxContainerCnvBase
T_AthenaPoolExtendingCnv< MVFVxContainer, MVFVxContainer_PERS > MVFVxContainerCnvBase
Definition: MVFVxContainerCnv.h:31