xAOD::TPyStore Class Reference

#include <TPyStore.h>

Inheritance diagram for xAOD::TPyStore:
xAOD::TStore

List of all members.

Public Member Functions

 TPyStore ()
 Default constructor.
::Bool_t contains (const std::string &key, const std::string &type) const
 Function checking if an object with a given key and type is available.
::Bool_t isConst (const std::string &key, const std::string &type) const
 Function checking if an object with a given key and type is constant.
TReturnCode record (void *obj, const std::string &key, const std::string &type)
 Record an object into the store in a typeless way.
void dump () const
 Print the contents of the store using a Python friendly function.

Detailed Description

Python interface to xAOD::TStore

In order to make it possible to record objects that are created in Python, into an xAOD::TStore object (to be able to pass it to some tools that expect the object to be in the event for instance), this class extends the xAOD::TStore object with some non-template functions. Functions that are inconvenient to use from C++, but which allow for much more flexibility in PyROOT.

Author:
Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Revision
659468
Date
2015-04-08 16:31:56 +0200 (Wed, 08 Apr 2015)

Member Function Documentation

Bool_t xAOD::TPyStore::contains ( const std::string &  key,
const std::string &  type 
) const

Function checking if an object with a given key and type is available.

This function can be used in the same manner as TStore::contains<...>(...), but instead of providing a type, one gives it a type name.

Note that only types that have a proper ROOT dictionary can be used. Unlike C++, which allows one to insert any type of object into TStore.

Parameters:
key The key of the object that we're looking for
type The type name of the object we're trying to access
Returns:
kTRUE if the object is acessible, kFALSE otherwise
void xAOD::TPyStore::dump (  )  const

Print the contents of the store using a Python friendly function.

This is just a convenience function, to make it easier to print the contents of such objects in Python. Since the base class's print() function has a special meaning in Python.

Bool_t xAOD::TPyStore::isConst ( const std::string &  key,
const std::string &  type 
) const

Function checking if an object with a given key and type is constant.

This function can be used in the same manner as TStore::isConst<...>(...), but instead of providing a type, one gives it a type name.

Note that only types that have a proper ROOT dictionary can be used. Unlike C++, which allows one to insert any type of object into TStore.

Parameters:
key The key of the object that we're looking for
type The type name of the object we're trying to access
Returns:
kTRUE if the object is acessible, kFALSE otherwise
TReturnCode xAOD::TPyStore::record ( void *  obj,
const std::string &  key,
const std::string &  type 
)

Record an object into the store in a typeless way.

This function can be used in the same manner as TStore::record<...>(...), but instead of providing a type, one gives it a type name and a typeless pointer.

Note that only types that have a proper ROOT dictionary can be used. Unlike C++, which allows one to insert any type of object into TStore.

Also note that this function doesn't take ownership of the recorded object. In Python all the objects created by the interpreter are managed by the interpreter. So this code is not supposed to delete them, otherwise all hell breaks loose.

Parameters:
obj Pointer to the object to be put into the store
key Key of the object in the store
type The type name of the object we are inserting
Returns:
The usual xAOD::TReturnCode types

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 1 Dec 2017 for RootCore Packages by  doxygen 1.6.1