|
ATLAS Offline Software
|
Go to the documentation of this file.
24 static const TClass*
const dvClass =
26 static const TClass*
const aeClass =
33 if(
type && (
type->GetCollectionType() == ROOT::kNotSTL ||
type->GetCollectionType() == ROOT::kSTLlist) ) {
34 if(
type->InheritsFrom( dvClass ) ) {
37 if(
type->InheritsFrom( aeClass ) ) {
45 void* safe_const_cast(
const void*
object) {
55 : m_object( 0 ),
m_type( 0 ), m_typeInfo( 0 ), m_owner( kFALSE ),
56 m_typeKind( OTHER ), m_const( kFALSE ) {
62 m_typeInfo(
m_type ?
m_type->GetTypeInfo() : 0 ), m_owner( owner ),
63 m_typeKind( getTypeKind(
type ) ), m_const( kFALSE ) {
67 ::Warning(
"xAOD::THolder::THolder",
"Received an emulated dictionary "
68 "for type: %s",
m_type->GetName() );
79 m_typeKind( OTHER ), m_const( kFALSE ) {
107 m_typeInfo(
parent.m_typeInfo ), m_owner(
parent.m_owner ),
108 m_typeKind(
parent.m_typeKind ), m_const(
parent.m_const ) {
128 m_typeInfo(
parent.m_typeInfo ), m_owner(
parent.m_owner ),
129 m_typeKind(
parent.m_typeKind ), m_const(
parent.m_const ) {
153 if( &rhs ==
this )
return *
this;
190 if( &rhs ==
this )
return *
this;
209 rhs.m_owner = kFALSE;
264 ::Warning(
"xAOD::THolder::setOwner",
265 "Deleting object %p no longer held by any owner",
306 const std::string heldType =
308 const std::string reqType =
310 ::Warning(
"xAOD::THolder::getAs",
311 "Trying to retrieve %s object with a %s pointer",
312 heldType.c_str(), reqType.c_str() );
323 if( ! userClass.first ) {
324 userClass.second = ::TClass::GetClass( tid );
329 if( ! userClass.second ) {
331 ::Error(
"xAOD::THolder::getAs",
332 XAOD_MESSAGE(
"Couldn't access the dictionary for user "
345 const Int_t
offset =
cl->GetBaseClassOffset( userClass.second );
348 ::Warning(
"xAOD::THolder::getAs",
349 "User class \"%s\" is not a valid base "
375 ::Warning(
"xAOD::THolder::getAs",
376 "Trying to retrieve const \"%s\" via non-const pointer \"%s\"",
446 if(
m_type->IsLoaded() ) {
461 ::Error(
"xAOD::THolder::deleteObject",
465 ::Error(
"xAOD::THolder::deleteObject",
@ OTHER
Some non-specified type.
::Bool_t isConst() const
Check if the object is const.
THolder & operator=(const THolder &rhs)
Assignment operator.
@ AUXELEMENT
A type inheriting from SG::AuxElement.
::Bool_t m_owner
A flag for whether the object owns what it points to.
void setConst()
Mark the object as const.
void setOwner(::Bool_t state=kTRUE)
Set whether the holder should own its object.
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...
Base class for elements of a container that can have aux data.
@ DATAVECTOR
A DataVector container.
virtual void * getAs(const std::type_info &tid, ::Bool_t silent=kFALSE) const
Return the object as a specific pointer.
This class takes care of holding EDM objects in memory.
TypeKind
Type of the object held by this one.
void ** getPtr()
Return a typeless pointer to the held object's pointer.
const void * get() const
Return a typeless const pointer to the held object.
::Bool_t isOwner() const
Check whether the holder owns its object.
void * getImpl(const std::type_info &tid, ::Bool_t silent=kFALSE) const
Internal function to get an object.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
void deleteObject()
Internal function used to delete the managed object from memory.
void addClass(const std::type_info &ti, ::TClass *cl)
Add the dictionary for a given type.
Manage index tracking and synchronization of auxiliary data.
Manage index tracking and synchronization of auxiliary data.
const ::TClass * getClass() const
std::pair< bool, ::TClass * > getClass(const std::type_info &ti) const
Get the dictionary for a given type info.
Base class for the templated destructor types.
TypeKind m_typeKind
Type of the object held.
::Bool_t m_const
Is the held object const?
virtual void set(void *obj)
Replace the managed object.
void * m_object
Typeless pointer to the object in memory.
static TDestructorRegistry & instance()
Function accessing the singleton instance of this type.
::TClass * m_type
Concrete type of the object being held on to.
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
static THolderCache & instance()
Singleton accessor.
int incRef(void *ptr)
Increment the reference count of an object in memory.
THolder()
Default constructor.
void renew()
Renew the object in memory.
def silent(func)
Redirect stdout/err to /dev/null Useful wrapper to get rid of ROOT verbosity...
const std::type_info * getTypeInfo() const
virtual const void * getAsConst(const std::type_info &tid, ::Bool_t silent=kFALSE) const
Return the object as a specific, constant pointer.
#define ATLAS_THREAD_SAFE
const std::type_info * m_typeInfo
Concrete type of the object, if it doesn't have a dictionary.
virtual ~THolder()
The destructor cleans out the memory used by the managed object.
Define macros for attributes used to control the static checker.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
const TVirtualDestructor * get(const std::type_info &ti) const
Get the destructor for a given type.
Base class for elements of a container that can have aux data.