ATLAS Offline Software
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
xAOD::TVirtualEvent Class Referenceabstract

Base interface for getting objects out of the input file. More...

#include <TVirtualEvent.h>

Inheritance diagram for xAOD::TVirtualEvent:
Collaboration diagram for xAOD::TVirtualEvent:

Public Types

using sgkey_t = SG::sgkey_t
 

Public Member Functions

virtual ~TVirtualEvent ()=default
 Virtual destructor to make vtable happy. More...
 
template<typename T >
bool retrieve (const T *&obj, sgkey_t key=DEFAULT_KEY, bool silent=false)
 Function retrieving an object from the event (constant version) More...
 
template<typename T >
bool retrieve (const T *&obj, const std::string &key, bool silent=false)
 Function retrieving an object from the event (constant version) More...
 
template<typename T >
void keys (std::vector< std::string > &vkeys, bool metadata=false) const
 provide list of all keys associated with provided type. More...
 
virtual sgkey_t getHash (const std::string &key) const =0
 Function returning the hash describing an object's name/key. More...
 
virtual sgkey_t getKey (const void *obj) const =0
 Function returning the hash describing a known object. More...
 
virtual const std::string & getName (const void *obj) const =0
 Function returning the key describing a known object. More...
 
virtual const std::string & getName (sgkey_t hash) const =0
 Function returning the key describing a known object. More...
 

Static Public Attributes

static constexpr sgkey_t DEFAULT_KEY = ~static_cast<sgkey_t>(0)
 Key for retrieving the "default" object of a given type. More...
 
static constexpr sgkey_t KEY_MASK = DEFAULT_KEY >> 2
 Mask for the keys, used mostly internally. More...
 

Protected Member Functions

virtual void * getOutputObject (sgkey_t key, const std::type_info &ti)=0
 Function for retrieving an output object in a non-template way. More...
 
virtual const void * getInputObject (sgkey_t key, const std::type_info &ti, bool silent=false)=0
 Function for retrieving an input object in a non-template way. More...
 
virtual void getNames (const std::string &targetClassName, std::vector< std::string > &vkeys, bool metadata) const =0
 Function to retrieve list of keys describing a type name. More...
 

Detailed Description

Base interface for getting objects out of the input file.

In order for the smart pointers not to depend on the full xAOD::TEvent class, this interface collects all the functionality that is needed by the smart pointers to access the input objects.

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 32 of file TVirtualEvent.h.

Member Typedef Documentation

◆ sgkey_t

Definition at line 35 of file TVirtualEvent.h.

Constructor & Destructor Documentation

◆ ~TVirtualEvent()

virtual xAOD::TVirtualEvent::~TVirtualEvent ( )
virtualdefault

Virtual destructor to make vtable happy.

Member Function Documentation

◆ getHash()

virtual sgkey_t xAOD::TVirtualEvent::getHash ( const std::string &  key) const
pure virtual

Function returning the hash describing an object's name/key.

Implemented in xAOD::TEvent.

◆ getInputObject()

virtual const void* xAOD::TVirtualEvent::getInputObject ( sgkey_t  key,
const std::type_info &  ti,
bool  silent = false 
)
protectedpure virtual

Function for retrieving an input object in a non-template way.

Implemented in xAOD::TEvent.

◆ getKey()

virtual sgkey_t xAOD::TVirtualEvent::getKey ( const void *  obj) const
pure virtual

Function returning the hash describing a known object.

Implemented in xAOD::TEvent.

◆ getName() [1/2]

virtual const std::string& xAOD::TVirtualEvent::getName ( const void *  obj) const
pure virtual

Function returning the key describing a known object.

Implemented in xAOD::TEvent.

◆ getName() [2/2]

virtual const std::string& xAOD::TVirtualEvent::getName ( sgkey_t  hash) const
pure virtual

Function returning the key describing a known object.

Implemented in xAOD::TEvent.

◆ getNames()

virtual void xAOD::TVirtualEvent::getNames ( const std::string &  targetClassName,
std::vector< std::string > &  vkeys,
bool  metadata 
) const
protectedpure virtual

Function to retrieve list of keys describing a type name.

Implemented in xAOD::TEvent.

◆ getOutputObject()

virtual void* xAOD::TVirtualEvent::getOutputObject ( sgkey_t  key,
const std::type_info &  ti 
)
protectedpure virtual

Function for retrieving an output object in a non-template way.

Implemented in xAOD::TEvent.

◆ keys()

template<typename T >
void xAOD::TVirtualEvent::keys ( std::vector< std::string > &  vkeys,
bool  metadata = false 
) const

provide list of all keys associated with provided type.

usage: event->keys( vec_to_fill, metadata )

Parameters
vkeyswill be filled with the list of keys (may be empty)
metadata(default false) look in metadata content if true

◆ retrieve() [1/2]

template<typename T >
bool xAOD::TVirtualEvent::retrieve ( const T *&  obj,
const std::string &  key,
bool  silent = false 
)

Function retrieving an object from the event (constant version)

◆ retrieve() [2/2]

template<typename T >
bool xAOD::TVirtualEvent::retrieve ( const T *&  obj,
sgkey_t  key = DEFAULT_KEY,
bool  silent = false 
)

Function retrieving an object from the event (constant version)

Member Data Documentation

◆ DEFAULT_KEY

constexpr sgkey_t xAOD::TVirtualEvent::DEFAULT_KEY = ~static_cast<sgkey_t>(0)
staticconstexpr

Key for retrieving the "default" object of a given type.

Definition at line 41 of file TVirtualEvent.h.

◆ KEY_MASK

constexpr sgkey_t xAOD::TVirtualEvent::KEY_MASK = DEFAULT_KEY >> 2
staticconstexpr

Mask for the keys, used mostly internally.

Definition at line 43 of file TVirtualEvent.h.


The documentation for this class was generated from the following file: