ATLAS Offline Software
T_AthenaPoolViewVectorCnv.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
16 #ifndef ATHENAPOOLCNVSVC_T_ATHENAPOOLVIEWVECTORCNV_H
17 #define ATHENAPOOLCNVSVC_T_ATHENAPOOLVIEWVECTORCNV_H
18 
19 
22 #include "AthenaPoolCnvSvc/debug.h"
23 #include "StorageSvc/DbReflex.h"
27 #include "AthLinks/ElementLink.h"
30 #include "CxxUtils/StrFormat.h"
31 #include <vector>
32 #include <cstdlib>
33 
34 
48 template <class DV>
50  : public T_AthenaPoolCustomCnv<ViewVector<DV>, ViewVector<DV> >
51 {
52 public:
55  typedef trans_t pers_t;
56 
58  typedef std::vector<ElementLink<DV> > pers2_t;
59 
62 
63 
68  T_AthenaPoolViewVectorCnv (ISvcLocator* svcloc);
69 
70 
74  virtual StatusCode initialize() override;
75 
76 
83  virtual pers_t* createPersistent( trans_t* trans ) override;
84 
85 
92  virtual trans_t* createTransient() override;
93 
94 
95 private:
102  std::vector<pool::Guid> initGuids (const std::type_info& ti) const;
103 
105  std::vector<pool::Guid> m_guids;
106 
108  std::vector<pool::Guid> m_guids2;
109 };
110 
111 
113 
114 
115 #endif // not ATHENAPOOLCNVSVC_T_ATHENAPOOLVIEWVECTORCNV_H
T_AthenaPoolViewVectorCnv::initGuids
std::vector< pool::Guid > initGuids(const std::type_info &ti) const
Return the set of GUIDs for persistent type ti.
T_AthenaPoolViewVectorCnv::trans_t
ViewVector< DV > trans_t
The transient and persistent types.
Definition: T_AthenaPoolViewVectorCnv.h:54
DbReflex.h
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
T_AthenaPoolViewVectorCnv::Base
T_AthenaPoolCustomCnv< trans_t, pers_t > Base
Base class.
Definition: T_AthenaPoolViewVectorCnv.h:61
T_AthenaPoolViewVectorCnv
Athena pool converter for a ViewVector class.
Definition: T_AthenaPoolViewVectorCnv.h:51
T_AthenaPoolViewVectorCnv::createTransient
virtual trans_t * createTransient() override
Read the persistent object and convert it to transient.
StrFormat.h
Provide helper functions to create formatted strings.
T_AthenaPoolViewVectorCnv::pers2_t
std::vector< ElementLink< DV > > pers2_t
Alternate persistent type; raw vector of EL.
Definition: T_AthenaPoolViewVectorCnv.h:58
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ViewVector
Identify view containers to be made persistent.
Definition: ViewVector.h:67
T_AthenaPoolCustomCnv.h
his file contains the class definition for the templated T_AthenaPoolCustomCnv class.
T_AthenaPoolViewVectorCnv::initialize
virtual StatusCode initialize() override
Standard Gaudi initialize method.
errorcheck.h
Helpers for checking error return status codes and reporting errors.
dataVectorAsELV.h
Helper to make a vector<EL> from a DataVector.
T_AthenaPoolViewVectorCnv::m_guids
std::vector< pool::Guid > m_guids
List of guids for ViewVector classes.
Definition: T_AthenaPoolViewVectorCnv.h:105
debug.h
A couple hooks for debugging.
T_AthenaPoolViewVectorCnv::T_AthenaPoolViewVectorCnv
T_AthenaPoolViewVectorCnv(ISvcLocator *svcloc)
Constructor.
T_AthenaPoolViewVectorCnv.icc
T_AthenaPoolViewVectorCnv::createPersistent
virtual pers_t * createPersistent(trans_t *trans) override
Convert a transient object to persistent form.
exceptions.h
Exceptions that can be thrown from AthenaPoolCnvSvc.
T_AthenaPoolViewVectorCnv::m_guids2
std::vector< pool::Guid > m_guids2
List of guids for std::vector<ElementLink<DV> > classes.
Definition: T_AthenaPoolViewVectorCnv.h:108
ViewVector.h
Identify view containers to be made persistent.
T_AthenaPoolViewVectorCnv::pers_t
trans_t pers_t
Definition: T_AthenaPoolViewVectorCnv.h:55