ATLAS Offline Software
Classes | Public Types | Static Public Member Functions | List of all members
xAOD::TDVCollectionFuncs Class Reference

Helper functions for accessing the container data via the proxy. More...

Collaboration diagram for xAOD::TDVCollectionFuncs:

Classes

struct  TEnvBuff
 Proxy environment buffer. More...
 

Public Types

typedef std::vector< char * > Cont_t
 The container type. More...
 
using Env_t = ROOT::TCollectionProxyInfo::Environ< TEnvBuff >
 The Root proxy environment structure. More...
 

Static Public Member Functions

static Cont_tcont (void *env)
 Fetch the container from a proxy environment. More...
 
static void * first (void *env)
 Return the first element of the container. More...
 
static void * next (void *env)
 Return a following element of the container. More...
 
static void * size (void *env)
 Return the size of the container. More...
 
static void * clear (void *env)
 Erase the container. More...
 
static void * create_env ()
 Return a new environment structure. More...
 
static void resize (void *, size_t)
 Not implemented for xAOD. More...
 
static void * construct (void *, size_t)
 Not implemented for xAOD. More...
 
static void destruct (void *, size_t)
 Not implemented for xAOD. More...
 
static void * feed (void *, void *to, size_t size)
 
static void * collect (void *, void *)
 Not implemented for xAOD. More...
 

Detailed Description

Helper functions for accessing the container data via the proxy.

Definition at line 155 of file TDVCollectionProxy.cxx.

Member Typedef Documentation

◆ Cont_t

typedef std::vector< char* > xAOD::TDVCollectionFuncs::Cont_t

The container type.

We alias this with the real vector that lives inside the DataVector.

Definition at line 161 of file TDVCollectionProxy.cxx.

◆ Env_t

using xAOD::TDVCollectionFuncs::Env_t = ROOT::TCollectionProxyInfo::Environ<TEnvBuff>

The Root proxy environment structure.

Definition at line 193 of file TDVCollectionProxy.cxx.

Member Function Documentation

◆ clear()

static void* xAOD::TDVCollectionFuncs::clear ( void *  env)
inlinestatic

Erase the container.

Parameters
envThe proxy environment.

Definition at line 261 of file TDVCollectionProxy.cxx.

261  {
262 
263  cont( env )->clear();
264  return nullptr;
265  }

◆ collect()

static void* xAOD::TDVCollectionFuncs::collect ( void *  ,
void *   
)
inlinestatic

Not implemented for xAOD.

Definition at line 315 of file TDVCollectionProxy.cxx.

315  {
316  ::Fatal( "xAOD::TDVCollectionProxy", "collect not implemented" );
317  return nullptr;
318  }

◆ construct()

static void* xAOD::TDVCollectionFuncs::construct ( void *  ,
size_t   
)
inlinestatic

Not implemented for xAOD.

Definition at line 284 of file TDVCollectionProxy.cxx.

284  {
285  ::Fatal( "xAOD::TDVCollectionProxy", "construct not implemented" );
286  return nullptr;
287  }

◆ cont()

static Cont_t* xAOD::TDVCollectionFuncs::cont ( void *  env)
inlinestatic

Fetch the container from a proxy environment.

Parameters
envThe proxy environment.

Definition at line 198 of file TDVCollectionProxy.cxx.

198  {
199 
200  Env_t& e = *reinterpret_cast< Env_t* >( env );
201  TEnvBuff& buff = e.fIterator;
202  return buff.fCont;
203  }

◆ create_env()

static void* xAOD::TDVCollectionFuncs::create_env ( )
inlinestatic

Return a new environment structure.

Definition at line 268 of file TDVCollectionProxy.cxx.

268  {
269 
270  return new Env_t;
271  }

◆ destruct()

static void xAOD::TDVCollectionFuncs::destruct ( void *  ,
size_t   
)
inlinestatic

Not implemented for xAOD.

Definition at line 290 of file TDVCollectionProxy.cxx.

290  {
291  ::Fatal( "xAOD::TDVCollectionProxy", "destruct not implemented" );
292  }

◆ feed()

static void* xAOD::TDVCollectionFuncs::feed ( void *  ,
void *  to,
size_t  size 
)
inlinestatic

Definition at line 295 of file TDVCollectionProxy.cxx.

296  {
297  DataVector<char> *dv = reinterpret_cast<DataVector<char>*>(to);
298  // find out vector element typeinfo and get RootUtils::Type for it
299  const std::type_info &elem_typeinfo = dv->dvlinfo_v().elt_tinfo();
300  auto ru_type = RootUtils::Type( SG::normalizedTypeinfoName(elem_typeinfo) );
301  // copy vector elements into DataVector
302  if(mn) cout << "PROX: feed, typename=" << ru_type.getTypeName() << " typesize=" << ru_type.getSize() <<endl;
303 
304  //char *src = reinterpret_cast<char*>( from );
305  for(size_t i=0; i<size; i++) {
306  void *obj = ru_type.create();
307  // ru_type.assign(obj, src); //MN: this may crash, so for now we do not copy data (bad only for CaloCluster
308  dv->dvlinfo_v().push(dv,obj);
309  //src += ru_type.getSize();
310  }
311  return nullptr;
312  }

◆ first()

static void* xAOD::TDVCollectionFuncs::first ( void *  env)
inlinestatic

Return the first element of the container.

This resets the internal pointer to 0.

Parameters
envThe proxy environment.
Returns
A pointer to the first element, or 0 if the container is empty.

Definition at line 211 of file TDVCollectionProxy.cxx.

211  {
212  Env_t& e = *reinterpret_cast< Env_t* >( env );
213  Cont_t& c = *cont( env );
214  TEnvBuff& buff = e.fIterator;
215  buff.fIndex = 0;
216  e.fSize = c.size();
217  if( 0 == e.fSize ) {
218  return nullptr;
219  }
220  char* start = c[ 0 ];
221  buff.fEltPtr = start + buff.fOffset;
222  return buff.fEltPtr;
223  }

◆ next()

static void* xAOD::TDVCollectionFuncs::next ( void *  env)
inlinestatic

Return a following element of the container.

The internal pointer will be advanced by the value of e.idx (after which e.idx will be reset to 0). A pointer to the element referenced by this new index will be returned.

Parameters
envThe proxy environment.
Returns
A pointer to the following element, or 0 if we're past the end.

Definition at line 233 of file TDVCollectionProxy.cxx.

233  {
234 
235  Env_t& e = *reinterpret_cast< Env_t* >( env );
236  Cont_t& c = *cont( env );
237  TEnvBuff& buff = e.fIterator;
238  buff.fIndex += e.fIdx;
239  e.fIdx = 0;
240  if( buff.fIndex >= e.fSize ) {
241  return nullptr;
242  }
243  char* ptr = c[ buff.fIndex ];
244  buff.fEltPtr = ptr + buff.fOffset;
245  return buff.fEltPtr;
246  }

◆ resize()

static void xAOD::TDVCollectionFuncs::resize ( void *  ,
size_t   
)
inlinestatic

Not implemented for xAOD.

Definition at line 279 of file TDVCollectionProxy.cxx.

279  {
280  ::Fatal( "xAOD::TDVCollectionProxy", "resize function not specified!" );
281  }

◆ size()

static void* xAOD::TDVCollectionFuncs::size ( void *  env)
inlinestatic

Return the size of the container.

Parameters
envThe proxy environment.

Definition at line 251 of file TDVCollectionProxy.cxx.

251  {
252 
253  Env_t* e = reinterpret_cast< Env_t* >( env );
254  e->fSize = cont( env )->size();
255  return &( e->fSize );
256  }

The documentation for this class was generated from the following file:
get_hdefs.buff
buff
Definition: get_hdefs.py:61
PlotCalibFromCool.dv
dv
Definition: PlotCalibFromCool.py:762
xAOD::TDVCollectionFuncs::cont
static Cont_t * cont(void *env)
Fetch the container from a proxy environment.
Definition: TDVCollectionProxy.cxx:198
SG::normalizedTypeinfoName
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...
Definition: normalizedTypeinfoName.cxx:120
xAOD::TDVCollectionFuncs::Env_t
ROOT::TCollectionProxyInfo::Environ< TEnvBuff > Env_t
The Root proxy environment structure.
Definition: TDVCollectionProxy.cxx:193
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
xAOD::TDVCollectionFuncs::Cont_t
std::vector< char * > Cont_t
The container type.
Definition: TDVCollectionProxy.cxx:161
Type
RootType Type
Definition: TrigTSerializer.h:30
lumiFormat.i
int i
Definition: lumiFormat.py:85
xAOD::e
setPy e
Definition: CompositeParticle_v1.cxx:166
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
mn
const bool mn
Definition: TDVCollectionProxy.cxx:28
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:39
xAOD::TDVCollectionFuncs::size
static void * size(void *env)
Return the size of the container.
Definition: TDVCollectionProxy.cxx:251
python.DataFormatRates.env
env
Definition: DataFormatRates.py:32
python.PyAthena.obj
obj
Definition: PyAthena.py:132
python.compressB64.c
def c
Definition: compressB64.py:93