ATLAS Offline Software
Loading...
Searching...
No Matches
ElementLinkCnv_p2.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef DATAMODELATHENAPOOL_ELEMENTLINKCNV_P2_H
6#define DATAMODELATHENAPOOL_ELEMENTLINKCNV_P2_H
7
13
15#include "ElementLink_p2.h"
16namespace SG {
17 class ThinningCache;
18}
19
50
52
53template <class LINK_TYPE>
55 : public T_AthenaPoolTPCnvBase< LINK_TYPE, typename GeneratePersELinkType_p2<LINK_TYPE >::type > {
56public:
57 typedef LINK_TYPE Link_t;
59
60 struct State
61 {
62 typedef std::map<std::string, unsigned int> IndexMap;
63
66 State (const ElementLinkContNames_p2& lookupTable);
67
76 std::string m_lastNameAdded;
79 const std::string* m_lastNameFound;
81 unsigned int m_lastNameIndex = 0;
82
83 void reset (ElementLinkContNames_p2& lookupTable);
84 void reset (const ElementLinkContNames_p2& lookupTable);
85
86 private:
87 const std::string* defaultLastName () const;
88 };
89
90
94 ElementLinkCnv_p2(bool isPersistible);
95
96
97 void transToPers (State& state,
98 const Link_t& trans,
99 PersLink_t& pers,
100 const SG::ThinningCache* cache,
101 MsgStream& log) const;
102
103 void transToPers (State& state,
104 const Link_t& trans,
105 PersLink_t& pers,
106 MsgStream& log) const;
107
108 void persToTrans (State& state,
109 const PersLink_t& pers,
110 Link_t& trans,
111 MsgStream& log) const;
112
113
115 void resetForCnv(const ElementLinkContNames_p2& lookupTable);
116
117 virtual void persToTrans(const PersLink_t* pers, Link_t* trans, MsgStream& log) ;
118 virtual void transToPers(const Link_t* trans, PersLink_t* pers, MsgStream& log) ;
119
120 void persToTrans(const PersLink_t& pers, Link_t& trans, MsgStream& log) ;
121 void transToPers(const Link_t& trans, PersLink_t& pers, MsgStream& log) ;
122
123
124private:
125
127 unsigned int getNameIndex (State& state, const std::string& name) const;
129 void getContName (State& state,
130 unsigned int nameIndex,
131 std::string const *& name,
132 MsgStream& log) const;
133
134 State m_state;
135
138};
139
140
141#ifndef __REFLEX__
142#include "ElementLinkCnv_p2.icc"
143#endif // not __REFLEX__
144
145#endif
TPConverterBase< TRANS, PERS > T_AthenaPoolTPCnvBase
void resetForCnv(ElementLinkContNames_p2 &lookupTable)
virtual void transToPers(const Link_t *trans, PersLink_t *pers, MsgStream &log)
virtual void persToTrans(const PersLink_t *pers, Link_t *trans, MsgStream &log)
void transToPers(const Link_t &trans, PersLink_t &pers, MsgStream &log)
void transToPers(State &state, const Link_t &trans, PersLink_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
ElementLinkCnv_p2(bool isPersistible)
If client sets state of EL to persistible (i.e.
void getContName(State &state, unsigned int nameIndex, std::string const *&name, MsgStream &log) const
Get the container name from lookup table.
void resetForCnv(const ElementLinkContNames_p2 &lookupTable)
void persToTrans(const PersLink_t &pers, Link_t &trans, MsgStream &log)
unsigned int getNameIndex(State &state, const std::string &name) const
Add name to lookup table and return index.
void transToPers(State &state, const Link_t &trans, PersLink_t &pers, MsgStream &log) const
void persToTrans(State &state, const PersLink_t &pers, Link_t &trans, MsgStream &log) const
Cache thinning decisions for converters.
Forward declaration.
const std::string * defaultLastName() const
State(const ElementLinkContNames_p2 &lookupTable)
const ElementLinkContNames_p2 * m_clookupTable
ElementLinkContNames_p2 * m_lookupTable
Lookup table with list of container names and starting element link index for each container name cha...
std::string m_lastNameAdded
Last container name added - for persToTrans must be string by value.
void reset(ElementLinkContNames_p2 &lookupTable)
void reset(const ElementLinkContNames_p2 &lookupTable)
IndexMap m_nameIndexMap
Map to find index of container name in lookup table.
const std::string * m_lastNameFound
Last container name found - for transToPers use string ptr to avoid string copy.
unsigned int m_lastNameIndex
Last name inded.
std::map< std::string, unsigned int > IndexMap
State(ElementLinkContNames_p2 &lookupTable)
ElementLink_p2< typename GenerateELinkIndexType_p2< typename LINK::index_type >::type > type