|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #ifndef TRIGSERIALIZECONVERTER_H
9 #define TRIGSERIALIZECONVERTER_H
11 #include "GaudiKernel/Converter.h"
12 #include "GaudiKernel/ToolHandle.h"
13 #include "GaudiKernel/ServiceHandle.h"
43 namespace SG{
class AuxElement;}
44 namespace SG{
class IAuxStore;}
50 constexpr
static typename std::enable_if<std::is_base_of<SG::AuxElement,typename std::pointer_traits<typename C::value_type>::element_type>
::value,
bool>
::type isxAODVector(
C*){
return true;}
57 static const bool value = isxAODVector<T>(0) || isAuxVector<T>(0);
92 holder = std::make_unique<ViewVector<DV> > (*d);
93 holder->setClearOnPersistent();
104 template <
class DATA>
124 auto d2 = std::make_unique<ViewVector<DV> > (*d);
130 d->clearPersistent();
138 template<
typename DATA >
154 *
m_log <<
MSG::DEBUG <<
"In createObj for : " << clname <<
" normalized to " << normalized <<
endmsg;
158 if(
sc.isFailure() ){
159 *
m_log << MSG::WARNING <<
"m_convHelper->createObj failed for "
163 DATA *nObj = ( DATA* )
ptr;
169 <<
" created nObj: " << nObj <<
endmsg;
179 *
m_log << MSG::WARNING <<
"TrigSerializeConverter::createObj object "
180 << clname <<
" / " << addr->
sgkey()
181 <<
" is already in the store; not overwriting"
186 if(
sc.isFailure() ) {
187 *
m_log << MSG::ERROR <<
"SG::record failed for " << addr->
sgkey()
191 << addr->
sgkey() <<
" class: " << clname <<
endmsg;
194 *
m_log << MSG::WARNING <<
"createObj cast failed" <<
endmsg;
219 std::unique_ptr<DATA> holder;
222 std::vector< uint32_t > ser;
242 return StatusCode::FAILURE;
246 if( !
sc.isSuccess() ) {
264 if (scsg.isFailure())
265 *
m_log << MSG::ERROR <<
"cannot access SG" <<
endmsg;
279 m_convHelper(
"TrigSerializeConvHelper/TrigSerializeConvHelper" ),
280 m_sgHandle(
"StoreGateSvc",
"TrigSerializeConverter" ),
283 m_log =
new MsgStream(
msgSvc(),
"TrigSerializeConverter" );
298 template <
typename DATA>
302 template <
typename DATA>
304 return storageType();
308 #endif // TRIGSERIALIZECONVERTER_H
StatusCode record(T *p2BRegistered, const TKEY &key)
Record an object with a key.
bool contains(const TKEY &key) const
Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS...
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
convert to and from a SG storable
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
StatusCode createObj(IOpaqueAddress *iAddr, DataObject *&pO)
static long int storageType()
DataObject * asStorable(T *pObject)
static const bool typeIsxAOD
~TrigSerializeConverter()
const std::string & sgkey() const
ServiceHandle< StoreGateSvc > m_sgHandle
constexpr static bool isxAODVector(...)
static const CLID & ID()
the CLID of T
constexpr static std::enable_if< std::is_base_of< SG::IAuxStore, C >::value, bool >::type isAuxVector(C *)
The Athena Transient Store API.
static const std::string & typeName()
the demangled type name of T
constexpr static bool isAuxVector(...)
msgSvc
Provide convenience handles for various services.
void add(const std::vector< uint32_t > &a)
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
ToolHandle< ITrigSerializeConvHelper > m_convHelper
::StatusCode StatusCode
StatusCode definition for legacy code.
static const CLID & classID()
Identify view containers to be made persistent.
static long int storageType()
Abstract factory to create the converter.
DATA * finishRead(DATA *d)
Called after an object has been read from BS.
uint32_t CLID
The Class ID type.
virtual long int repSvcType() const
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
IOpaqueAddress for TrigSerializenCnvSvc.
ViewVector< DV > *finishRead NO_SANITIZE_UNDEFINED(ViewVector< DV > *d)
Called after an object has been read from BS.
Helper to disable undefined behavior sanitizer for a function.
StatusCode createRep(DataObject *pObj, IOpaqueAddress *&pAddr)
DATA * prepareForWrite(DATA *d, std::unique_ptr< DATA > &)
Called before serializing an object to BS.
Identify view containers to be made persistent.
TrigSerializeConverter(ISvcLocator *svcloc)
constexpr static std::enable_if< std::is_base_of< SG::AuxElement, typename std::pointer_traits< typename C::value_type >::element_type >::value, bool >::type isxAODVector(C *)