ATLAS Offline Software
Loading...
Searching...
No Matches
TDVCollectionProxy.cxx File Reference
#include <cassert>
#include <TError.h>
#include <TClassEdit.h>
#include <TClass.h>
#include <TBaseClass.h>
#include <TCollectionProxyInfo.h>
#include <TSystem.h>
#include <TList.h>
#include "AthContainers/DataVector.h"
#include "CxxUtils/no_sanitize_undefined.h"
#include "CxxUtils/checker_macros.h"
#include "RootUtils/Type.h"
#include "xAODCore/tools/TDVCollectionProxy.h"
#include <iostream>

Go to the source code of this file.

Classes

class  TDVCollectionFuncs
 Helper functions for accessing the container data via the proxy. More...
struct  TDVCollectionFuncs::TEnvBuff
 Proxy environment buffer. More...

Namespaces

namespace  xAOD
 ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.

Functions

int xAOD::safeGetBaseOffset (TClass *cls, TClass *base)
 Find base class offset using Reflex.
TClass * xAOD::classFromDVClass (TClass *dvclass)
 Find the contained class in a DataVector.
TClass * xAOD::findDVBase (TClass *dvclass)
 Find the unique base DataVector class.
void TDVCollectionProxy::PushProxy NO_SANITIZE_UNDEFINED (void *objstart)
 Start working with a new collection.

Variables

const bool mn = getenv("MN_DEBUG")

Function Documentation

◆ NO_SANITIZE_UNDEFINED()

void TDVCollectionProxy::PushProxy NO_SANITIZE_UNDEFINED ( void * objstart)

Start working with a new collection.

Parameters
objstartThe address of the collection.

Definition at line 395 of file TDVCollectionProxy.cxx.

395 {
396
397 // Do the base class stuff.
398 // This will create an environment buffer if needed.
399 ::TGenCollectionProxy::PushProxy( objstart );
400
401 // Save the calculated element offset in the environment buffer.
403 reinterpret_cast< TDVCollectionFuncs::Env_t* >( fEnv )->fIterator;
404
405 // Get the offset needed for the pointer operations:
406 buff.fOffset = fOffset;
407
408 // Save the address of the underlying vector of the DataVector.
409 // First, adjust the address to the base DataVector.
410 char* dvstart = reinterpret_cast< char* >( objstart ) + fContoff;
411 // Cast to DV.
412 // This gets a ubsan warning about casting between types.
413 // However, this is deliberate, so suppress ubsan warnings
414 // for this function.
416 reinterpret_cast< DataVector< char >* >( dvstart );
417 // Find the underlying vector.
418 const std::vector< char* >& vec = dv->stdcont();
419 // And store its address.
420 std::vector<char*>* vptr ATLAS_THREAD_SAFE =
421 const_cast< std::vector< char* >* >( &vec );
422 buff.fCont = vptr;
423
424 return;
425 }
std::vector< size_t > vec
#define ATLAS_THREAD_SAFE
Derived DataVector<T>.
Definition DataVector.h:795
ROOT::TCollectionProxyInfo::Environ< TEnvBuff > Env_t
The Root proxy environment structure.
Proxy environment buffer.

Variable Documentation

◆ mn

const bool mn = getenv("MN_DEBUG")

Definition at line 28 of file TDVCollectionProxy.cxx.