ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::ShallowAuxInfo Class Referenceabstract

Shallow copy for the auxiliary store of standalone objects. More...

#include <ShallowAuxInfo.h>

Inheritance diagram for xAOD::ShallowAuxInfo:
Collaboration diagram for xAOD::ShallowAuxInfo:

Public Types

typedef SG::auxid_t auxid_t
 The aux ID type definition.
typedef SG::auxid_set_t auxid_set_t
 The aux ID set type definition.
enum  AuxStoreType { AST_ObjectStore = 0 , AST_ContainerStore = 1 }
 Type of the auxiliary store. More...

Public Member Functions

 ShallowAuxInfo ()
 Default constructor.
 ShallowAuxInfo (const DataLink< SG::IConstAuxStore > &parent)
 Constructor with a parent object.
virtual AuxStoreType getStoreType () const
 Return the type of the store object.
const DataLink< SG::IConstAuxStore > & parent () const
 Get the parent store.
void setParent (const DataLink< SG::IConstAuxStore > &link)
 Set the parent store.
bool shallowIO () const
 Check whether only the overriden parameters will be written out or not.
void setShallowIO (bool value)
 Set whether only the overriden parameters should be written out.
virtual bool insertMove (size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore=SG::auxid_set_t())=0
 Move all elements from other to this store.
virtual bool setOption (auxid_t, const AuxDataOption &)
 Set an option for a given auxiliary variable.
virtual IAuxTypeVector * linkedVector (SG::auxid_t)
Functions implementing the SG::IAuxStoreHolder interface
virtual SG::IAuxStoregetStore () override
 Get the currently used internal store object.
virtual const SG::IAuxStoregetStore () const override
virtual void setStore (SG::IAuxStore *store) override
 Set a different internal store object.
Functions implementing the SG::IConstAuxStore interface
virtual const void * getData (auxid_t auxid) const override
 Get a pointer to a given array.
virtual const SG::IAuxTypeVectorgetVector (SG::auxid_t auxid) const override final
 Return vector interface for one aux data item.
virtual const auxid_set_tgetAuxIDs () const override
 Get the types(names) of variables handled by this container.
virtual const auxid_set_tgetDecorIDs () const override
 Get the types(names) of decorations handled by this container.
virtual SG::auxid_set_t getCopyIDs (bool warnUnlocked=false) const override
 Get the set of variables that we should deep copy.
virtual bool isDecoration (auxid_t auxid) const override
 Test if a variable is a decoration.
virtual void * getDecoration (auxid_t auxid, size_t size, size_t capacity) override
 Return the data vector for one aux data decoration item.
virtual void lock () override
 Lock the container.
virtual bool clearDecorations () override
 Clear all decorations.
virtual size_t size () const override
 Get the size of the container.
virtual void lockDecoration (SG::auxid_t auxid) override
 Lock a decoration.
Functions implementing the SG::IAuxStore interface
virtual void * getData (auxid_t auxid, size_t size, size_t capacity) override
 Get a pointer to a given array, creating the array if necessary.
virtual const auxid_set_tgetWritableAuxIDs () const override
 Return a set of writable data identifiers.
virtual bool resize (size_t size) override
 Resize the arrays to a given size.
virtual void reserve (size_t size) override
 Reserve a given size for the arrays.
virtual void shift (size_t pos, ptrdiff_t offs) override
 Shift the contents of the stored arrays.
virtual bool insertMove (size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore) override
 Insert contents of another store via move.
virtual void toTransient (const EventContext &ctx) override
 Perform processing on aux variable objects just after reading to make them usable as transient objects.
Functions implementing the SG::IAuxStoreIO interface
virtual const void * getIOData (auxid_t auxid) const override
 Get a pointer to the data being stored for one aux data item.
virtual const std::type_info * getIOType (auxid_t auxid) const override
 Return the type of the data to be stored for one aux data item.
virtual const auxid_set_tgetDynamicAuxIDs () const override
 Get the types(names) of variables created dynamically.
virtual auxid_set_t getSelectedAuxIDs () const override
 Get the IDs of the selected dynamic Aux variables (for writing).
Functions managing the instance name of the container
const charname () const
 Get the name of the container instance.
void setName (const char *name)
 Set the name of the container instance.

Static Public Attributes

static constexpr bool supportsThinning = false
 Flag that we should not use the xAOD aux store pool converter for this type.

Private Types

typedef AthContainers_detail::recursive_mutex mutex_t
 Mutex for multithread synchronization.
typedef AthContainers_detail::lock_guard< mutex_tguard_t

Private Member Functions

void remakeAuxIDs () const

Private Attributes

AuxSelection m_selection
 Dynamic attributes selection implementation.
SG::IAuxStorem_store
 Internal dynamic auxiliary store object.
SG::IAuxStoreIOm_storeIO
 The IO interface to the internal auxiliary store.
bool m_ownsStore
 Flag deciding if the object owns the dynamic store or not.
bool m_locked
 Flag keeping track of whether this object is locked or not.
DataLink< SG::IConstAuxStore > m_parentLink
 Link to the parent object.
const SG::IAuxStoreIOm_parentIO
 Optional pointer to the IO interface of the parent object.
bool m_shallowIO
 Flag for whether to do "shallow IO" or not.
mutex_t m_mutex
auxid_set_t m_auxids ATLAS_THREAD_SAFE
auxid_set_t m_decorids ATLAS_THREAD_SAFE
bool m_auxidsValid ATLAS_THREAD_SAFE
std::string m_name
 Name of the container in memory. Set externally.

Detailed Description

Shallow copy for the auxiliary store of standalone objects.

The design of this is exactly the same as for the SG::AuxStoreInternal - SG::AuxStoreStandalone pair. All the code is in xAOD::ShallowAuxContainer, this class is just a convenience shorthand for calling xAOD::ShallowAuxContainer(true) in the code.

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
Revision
671678
Date
2015-06-02 14:28:46 +0200 (Tue, 02 Jun 2015)

Definition at line 33 of file ShallowAuxInfo.h.

Member Typedef Documentation

◆ auxid_set_t

The aux ID set type definition.

Definition at line 56 of file ShallowAuxContainer.h.

◆ auxid_t

The aux ID type definition.

Definition at line 54 of file ShallowAuxContainer.h.

◆ guard_t

◆ mutex_t

Mutex for multithread synchronization.

Definition at line 205 of file ShallowAuxContainer.h.

Member Enumeration Documentation

◆ AuxStoreType

Type of the auxiliary store.

In the xAOD EDM we use auxiliary store objects in some cases to describe a single object, and in most cases to describe a container of objects. This enumeration declares which type the object implementing this interface is.

Enumerator
AST_ObjectStore 

The store describes a single object.

AST_ContainerStore 

The store describes a container.

Definition at line 68 of file IAuxStoreHolder.h.

68 {
69 AST_ObjectStore = 0,
71 };
@ AST_ContainerStore
The store describes a container.
@ AST_ObjectStore
The store describes a single object.

Constructor & Destructor Documentation

◆ ShallowAuxInfo() [1/2]

xAOD::ShallowAuxInfo::ShallowAuxInfo ( )

Default constructor.

Definition at line 12 of file ShallowAuxInfo.cxx.

13 : ShallowAuxContainer( true ) {
14
15 }
ShallowAuxContainer(bool standalone=false)
Default constructor.

◆ ShallowAuxInfo() [2/2]

xAOD::ShallowAuxInfo::ShallowAuxInfo ( const DataLink< SG::IConstAuxStore > & parent)

Constructor with a parent object.

Definition at line 17 of file ShallowAuxInfo.cxx.

19 : ShallowAuxContainer( parent, true ) {
20
21 }
const DataLink< SG::IConstAuxStore > & parent() const
Get the parent store.

Member Function Documentation

◆ clearDecorations()

bool xAOD::ShallowAuxContainer::clearDecorations ( )
overridevirtualinherited

Clear all decorations.

Definition at line 390 of file ShallowAuxContainer.cxx.

391 {
392 guard_t guard (m_mutex);
393 bool ret = m_store->clearDecorations();
394 if (ret) {
395 remakeAuxIDs();
396 }
397 return ret;
398 }
SG::IAuxStore * m_store
Internal dynamic auxiliary store object.
AthContainers_detail::lock_guard< mutex_t > guard_t

◆ getAuxIDs()

const ShallowAuxContainer::auxid_set_t & xAOD::ShallowAuxContainer::getAuxIDs ( ) const
overridevirtualinherited

Get the types(names) of variables handled by this container.

Definition at line 232 of file ShallowAuxContainer.cxx.

232 {
233
234 guard_t guard( m_mutex );
235 if (!m_auxidsValid) {
236 remakeAuxIDs();
237 }
238 return m_auxids;
239 }
SG::auxid_set_t m_auxids
Set of auxid's for which we've created a vector.

◆ getCopyIDs()

SG::auxid_set_t xAOD::ShallowAuxContainer::getCopyIDs ( bool warnUnlocked = false) const
overridevirtualinherited

Get the set of variables that we should deep copy.

Definition at line 251 of file ShallowAuxContainer.cxx.

252 {
253 guard_t guard( m_mutex );
255 if( m_parentLink.isValid() ) {
256 ids.insert (m_parentLink->getCopyIDs (warnUnlocked));
257 }
258 ids.insert (m_store->getCopyIDs (warnUnlocked));
259 return ids;
260 }
SG::auxid_set_t auxid_set_t
The aux ID set type definition.
DataLink< SG::IConstAuxStore > m_parentLink
Link to the parent object.

◆ getData() [1/2]

const void * xAOD::ShallowAuxContainer::getData ( auxid_t auxid) const
overridevirtualinherited

Get a pointer to a given array.

Definition at line 192 of file ShallowAuxContainer.cxx.

192 {
193
194 const SG::IAuxTypeVector* v = getVector( auxid );
195 if( v ) {
196 return v->toPtr();
197 }
198 return nullptr;
199 }
virtual const SG::IAuxTypeVector * getVector(SG::auxid_t auxid) const override final
Return vector interface for one aux data item.

◆ getData() [2/2]

void * xAOD::ShallowAuxContainer::getData ( auxid_t auxid,
size_t size,
size_t capacity )
overridevirtualinherited

Get a pointer to a given array, creating the array if necessary.

Implements SG::IAuxStore.

Definition at line 409 of file ShallowAuxContainer.cxx.

410 {
411
412 guard_t guard (m_mutex);
413
414 // Check if we already have this variable by any chance.
415 const void* cptr = m_store->getData( auxid );
416
417 // Create the variable in the dynamic store:
418 void* ptr = m_store->getData( auxid, size, capacity );
419
420 remakeAuxIDs();
421
422 // If in some weird way we already had this variable before, then don't
423 // try to overwrite it with the parent's payload, and finish here already.
424 if( cptr != nullptr ) {
425 return ptr;
426 }
427
428 // If the parent doesn't have this variable, then we're done already:
429 if( ! m_parentLink.isValid() ) {
430 return ptr;
431 }
432 const void* pptr = m_parentLink->getData( auxid );
433 if( ! pptr ) {
434 return ptr;
435 }
436
437 // If the variable does exist in the parent, then copy it over to this
438 // store before returning.
439
440 // Get the registry:
441 SG::AuxTypeRegistry& reg = SG::AuxTypeRegistry::instance();
442
443 // Get the type of this variable:
444 const std::type_info* type = reg.getType( auxid );
445 if( type == nullptr ) {
446 std::ostringstream message;
447 message << "Couldn't find the type of auxiliary ID " << auxid;
448 throw std::runtime_error( message.str() );
449 }
450
451 // And the allocator type for this variable.
452 const std::type_info* allocType = reg.getAllocType( auxid );
453 if( allocType == nullptr ) {
454 std::ostringstream message;
455 message << "Couldn't find the allocator type of auxiliary ID " << auxid;
456 throw std::runtime_error( message.str() );
457 }
458
459 // First let's get the vector factory of this variable:
460 const SG::IAuxTypeVectorFactory* factory =
461 SG::AuxTypeRegistry::instance().getFactory( *type, *allocType );
462 if( factory == nullptr ) {
463 std::ostringstream message;
464 message << "Couldn't find a factory for type " << type->name();
465 throw std::runtime_error( message.str() );
466 }
467
468 // Copy each element of the parent's decoration:
469 factory->copy( auxid,
470 SG::AuxVectorInterface( *this ), 0,
471 SG::AuxVectorInterface( *m_parentLink ), 0, size );
472
473 // Now we're done:
474 return ptr;
475 }
const IAuxTypeVectorFactory * getFactory(const std::type_info &ti, const std::type_info &ti_alloc)
Return the vector factory for a given vector element type.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
virtual void copy(SG::auxid_t auxid, AuxVectorData &dst, size_t dst_index, const AuxVectorData &src, size_t src_index, size_t n) const =0
Copy elements between vectors.
virtual size_t size() const override
Get the size of the container.
SG::auxid_t auxid() const
Return the aux id for this variable.
void * ptr(T *p)
Definition SGImplSvc.cxx:74

◆ getDecoration()

void * xAOD::ShallowAuxContainer::getDecoration ( auxid_t auxid,
size_t size,
size_t capacity )
overridevirtualinherited

Return the data vector for one aux data decoration item.

Definition at line 274 of file ShallowAuxContainer.cxx.

276 {
277
278 guard_t guard( m_mutex );
279
280 // Check if we already have this variable by any chance.
281 const void* cptr = m_store->getData( auxid );
282
283 // If the parent has such a variable, then we need to check one more
284 // thing. If it's a decoration on the parent, then we should be allowed
285 // to override it in this (possibly locked) shallow copy. But let's leave
286 // the logic of this up to the parent.
287 if( m_locked && m_parentLink.isValid() &&
288 ( m_parentLink->getAuxIDs().count( auxid ) > 0 ) )
289 {
290 if (!m_parentLink->isDecoration (auxid)) {
291 throw SG::ExcStoreLocked (auxid);
292 }
293 }
294
295 // If we got this far without any exception, then let the internal store
296 // try to provide the decoration for us:
297 const size_t nids = m_store->getAuxIDs().size();
298 void* result = m_store->getDecoration( auxid, size, capacity );
299 if( result && ( nids != m_store->getAuxIDs().size() ) ) {
300 remakeAuxIDs();
301 }
302
303 // If we already had this variable before, then don't try to overwrite it
304 // with the parent's payload, and finish here already.
305 if( cptr != nullptr ) {
306 return result;
307 }
308
309 // If the parent doesn't have this variable, then we're done.
310 if( ! m_parentLink.isValid() ) {
311 return result;
312 }
313 const void* pptr = m_parentLink->getData( auxid );
314 if( pptr == nullptr ) {
315 return result;
316 }
317
318 // If the variable does exist in the parent, then copy it over to this
319 // store before returning.
320
321 // Get the registry.
322 SG::AuxTypeRegistry& reg = SG::AuxTypeRegistry::instance();
323
324 // Get the type of this variable.
325 const std::type_info* type = reg.getType( auxid );
326 if( type == nullptr ) {
327 std::ostringstream message;
328 message << "Couldn't find the type of auxiliary ID " << auxid;
329 throw std::runtime_error( message.str() );
330 }
331
332 // And the allocator type for this variable.
333 const std::type_info* allocType = reg.getAllocType( auxid );
334 if( allocType == nullptr ) {
335 std::ostringstream message;
336 message << "Couldn't find the allocator type of auxiliary ID " << auxid;
337 throw std::runtime_error( message.str() );
338 }
339
340 // Get the vector factory of this variable.
341 const SG::IAuxTypeVectorFactory* factory =
342 SG::AuxTypeRegistry::instance().getFactory( *type, *allocType );
343 if( factory == nullptr ) {
344 std::ostringstream message;
345 message << "Couldn't find a factory for type " << type->name();
346 throw std::runtime_error( message.str() );
347 }
348
349 // Copy each element of the parent's decoration.
350 factory->copy( auxid,
351 SG::AuxVectorInterface( *this ), 0,
352 SG::AuxVectorInterface( *m_parentLink ), 0, size );
353
354 // Now we're done.
355 return result;
356 }
bool m_locked
Flag keeping track of whether this object is locked or not.

◆ getDecorIDs()

const ShallowAuxContainer::auxid_set_t & xAOD::ShallowAuxContainer::getDecorIDs ( ) const
overridevirtualinherited

Get the types(names) of decorations handled by this container.

Definition at line 242 of file ShallowAuxContainer.cxx.

242 {
243
244 guard_t guard( m_mutex );
245 if (!m_auxidsValid) {
246 remakeAuxIDs();
247 }
248 return m_decorids;
249 }

◆ getDynamicAuxIDs()

const ShallowAuxContainer::auxid_set_t & xAOD::ShallowAuxContainer::getDynamicAuxIDs ( ) const
overridevirtualinherited

Get the types(names) of variables created dynamically.

Implements SG::IAuxStoreIO.

Definition at line 585 of file ShallowAuxContainer.cxx.

585 {
586
587 if( m_shallowIO ) {
588 if( m_storeIO ) {
589 return m_store->getAuxIDs();
590 } else {
591 static const auxid_set_t dummy (0);
592 return dummy;
593 }
594 } else {
595 return getAuxIDs();
596 }
597 }
bool m_shallowIO
Flag for whether to do "shallow IO" or not.
SG::IAuxStoreIO * m_storeIO
The IO interface to the internal auxiliary store.
virtual const auxid_set_t & getAuxIDs() const override
Get the types(names) of variables handled by this container.

◆ getIOData()

const void * xAOD::ShallowAuxContainer::getIOData ( auxid_t auxid) const
overridevirtualinherited

Get a pointer to the data being stored for one aux data item.

Implements SG::IAuxStoreIO.

Definition at line 532 of file ShallowAuxContainer.cxx.

532 {
533
534 guard_t guard (m_mutex);
535 // Do we have it?
536 if( m_storeIO && m_store->getAuxIDs().test (auxid)) {
537 return m_storeIO->getIOData( auxid );
538 }
539
540 // Do we have a parent that has it?
541 const SG::IAuxStoreIO* parentIO = m_parentIO;
542 if( ( parentIO == nullptr ) && m_parentLink.isValid() ) {
543 parentIO =
544 dynamic_cast< const SG::IAuxStoreIO* >( m_parentLink.cptr() );
545 }
546 if( parentIO ) {
547 return parentIO->getIOData( auxid );
548 }
549
550 // If not, then where did this variable come from?!?
551 std::cerr << "ERROR xAOD::ShallowAuxContainer::getIOData Unknown "
552 << "variable ("
554 << ") requested" << std::endl;
555 return nullptr;
556 }
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
const SG::IAuxStoreIO * m_parentIO
Optional pointer to the IO interface of the parent object.

◆ getIOType()

const std::type_info * xAOD::ShallowAuxContainer::getIOType ( auxid_t auxid) const
overridevirtualinherited

Return the type of the data to be stored for one aux data item.

Implements SG::IAuxStoreIO.

Definition at line 558 of file ShallowAuxContainer.cxx.

558 {
559
560 guard_t guard (m_mutex);
561 // Do we have it?
562 if( m_storeIO && m_store->getAuxIDs().test (auxid)) {
563 return m_storeIO->getIOType( auxid );
564 }
565
566 // Do we have a parent that has it?
567 const SG::IAuxStoreIO* parentIO = m_parentIO;
568 if( ( parentIO == nullptr ) && m_parentLink.isValid() ) {
569 parentIO =
570 dynamic_cast< const SG::IAuxStoreIO* >( m_parentLink.cptr() );
571 }
572 if( parentIO ) {
573 return parentIO->getIOType( auxid );
574 }
575
576 // If not, then where did this variable come from?!?
577 std::cerr << "ERROR xAOD::ShallowAuxContainer::getIOType Unknown "
578 << "variable ("
580 << ") requested" << std::endl;
581 return nullptr;
582 }
virtual const std::type_info * getIOType(SG::auxid_t auxid) const =0
Return the type of the data to be stored for one aux data item.

◆ getSelectedAuxIDs()

ShallowAuxContainer::auxid_set_t xAOD::ShallowAuxContainer::getSelectedAuxIDs ( ) const
overridevirtualinherited

Get the IDs of the selected dynamic Aux variables (for writing).

Reimplemented from SG::IAuxStoreIO.

Definition at line 600 of file ShallowAuxContainer.cxx.

600 {
601
602 if( m_shallowIO ) {
603 if( m_storeIO ) {
604 return m_selection.getSelectedAuxIDs( m_store->getAuxIDs() );
605 } else {
606 return auxid_set_t();
607 }
608 } else {
609 return m_selection.getSelectedAuxIDs( getAuxIDs() );
610 }
611 }
AuxSelection m_selection
Dynamic attributes selection implementation.

◆ getStore() [1/2]

const SG::IAuxStore * xAOD::ShallowAuxContainer::getStore ( ) const
overridevirtualinherited

Implements SG::IAuxStoreHolder.

Definition at line 159 of file ShallowAuxContainer.cxx.

160 {
161 return m_store;
162 }

◆ getStore() [2/2]

SG::IAuxStore * xAOD::ShallowAuxContainer::getStore ( )
overridevirtualinherited

Get the currently used internal store object.

Implements SG::IAuxStoreHolder.

Definition at line 154 of file ShallowAuxContainer.cxx.

155 {
156 return m_store;
157 }

◆ getStoreType()

virtual AuxStoreType xAOD::ShallowAuxInfo::getStoreType ( ) const
inlinevirtual

Return the type of the store object.

Reimplemented from xAOD::ShallowAuxContainer.

Definition at line 47 of file ShallowAuxInfo.h.

47{ return AST_ObjectStore; }

◆ getVector()

const SG::IAuxTypeVector * xAOD::ShallowAuxContainer::getVector ( SG::auxid_t auxid) const
finaloverridevirtualinherited

Return vector interface for one aux data item.

Definition at line 201 of file ShallowAuxContainer.cxx.

201 {
202
203 guard_t guard( m_mutex );
204
205 // Check if we have this variable ourselves. I use getData(...)
206 // instead of getAuxIDs(), as a dynamic store may not have connected
207 // to all the variables yet that it has available...
208 size_t nids = m_store->getAuxIDs().size();
209 const SG::IAuxTypeVector* result = m_store->getVector( auxid );
210 if( result != nullptr && result->toPtr() != nullptr ) {
211 if( nids != m_store->getAuxIDs().size() ) {
212 remakeAuxIDs();
213 }
214 return result;
215 }
216
217 // If not, then leave it up to the parent object do deal with this:
218 if( m_parentLink.isValid() ) {
219 nids = m_parentLink->getAuxIDs().size();
220 result = m_parentLink->getVector( auxid );
221 if( result && ( nids != m_parentLink->getAuxIDs().size() ) ) {
222 remakeAuxIDs();
223 }
224 return result;
225 }
226
227 // Apparently the variable wasn't found:
228 return nullptr;
229 }

◆ getWritableAuxIDs()

const ShallowAuxContainer::auxid_set_t & xAOD::ShallowAuxContainer::getWritableAuxIDs ( ) const
overridevirtualinherited

Return a set of writable data identifiers.

Implements SG::IAuxStore.

Definition at line 478 of file ShallowAuxContainer.cxx.

478 {
479
480 // Only the variables in the dynamic store are writable. Maybe not
481 // even all of those...
482 return m_store->getWritableAuxIDs();
483 }

◆ insertMove() [1/2]

virtual bool SG::IAuxStore::insertMove ( size_t pos,
IAuxStore & other,
const SG::auxid_set_t & ignore = SG::auxid_set_t() )
pure virtualinherited

Move all elements from other to this store.

Parameters
posThe starting index of the insertion.
otherStore from which to do the move.
ignoreSet of variables that should not be added to the store.

Let len be the size of other. The store will be increased in size by len elements, with the elements at pos being copied to pos+len. Then, for each auxiliary variable, the entire contents of that variable for other will be moved to this store at index pos. This will be done via move semantics if possible; otherwise, it will be done with a copy. Variables present in this store but not in other will have the corresponding elements default-initialized. Variables in other but not in this store will be added unless they are in ignore.

Returns true if it is known that none of the vectors' memory moved, false otherwise.

◆ insertMove() [2/2]

bool xAOD::ShallowAuxContainer::insertMove ( size_t pos,
IAuxStore & other,
const SG::auxid_set_t & ignore )
overridevirtualinherited

Insert contents of another store via move.

Definition at line 509 of file ShallowAuxContainer.cxx.

511 {
512
513 // Nope, not allowed...
514 throw std::runtime_error( "Trying to call insertMove on a shallow copy "
515 "container" );
516 }

◆ isDecoration()

bool xAOD::ShallowAuxContainer::isDecoration ( auxid_t auxid) const
overridevirtualinherited

Test if a variable is a decoration.

Definition at line 262 of file ShallowAuxContainer.cxx.

263 {
264 guard_t guard( m_mutex );
265 if (m_parentLink.isValid()) {
266 if (m_parentLink->isDecoration (auxid)) {
267 return true;
268 }
269 }
270 return m_store->isDecoration (auxid);
271 }

◆ linkedVector()

virtual IAuxTypeVector * SG::IAuxStore::linkedVector ( SG::auxid_t )
inlinevirtualinherited

Reimplemented in xAOD::AuxContainerBase, xAOD::AuxInfoBase, and xAOD::details::AuxStoreBase.

Definition at line 203 of file IAuxStore.h.

204 { return nullptr; }

◆ lock()

void xAOD::ShallowAuxContainer::lock ( )
overridevirtualinherited

Lock the container.

Definition at line 360 of file ShallowAuxContainer.cxx.

361 {
362 guard_t guard (m_mutex);
363 m_locked = true;
364 m_store->lock();
365 }

◆ lockDecoration()

void xAOD::ShallowAuxContainer::lockDecoration ( SG::auxid_t auxid)
overridevirtualinherited

Lock a decoration.

Definition at line 369 of file ShallowAuxContainer.cxx.

370 {
371 guard_t guard (m_mutex);
372 m_store->lockDecoration (auxid);
373 m_auxidsValid = false;
374 }

◆ name()

const char * xAOD::ShallowAuxContainer::name ( ) const
inherited

Get the name of the container instance.

Definition at line 617 of file ShallowAuxContainer.cxx.

617 {
618
619 return m_name.c_str();
620 }
std::string m_name
Name of the container in memory. Set externally.

◆ parent()

const DataLink< SG::IConstAuxStore > & xAOD::ShallowAuxContainer::parent ( ) const
inherited

Get the parent store.

Definition at line 122 of file ShallowAuxContainer.cxx.

122 {
123
124 return m_parentLink;
125 }

◆ remakeAuxIDs()

void xAOD::ShallowAuxContainer::remakeAuxIDs ( ) const
privateinherited

Definition at line 628 of file ShallowAuxContainer.cxx.

628 {
629 auxid_set_t ids = m_store->getAuxIDs();
630 if( m_parentLink.isValid() ) {
631 ids.insert (m_parentLink->getAuxIDs());
632 }
633
634 auxid_set_t decors = m_store->getDecorIDs();
635 if( m_parentLink.isValid() ) {
636 ids.insert (m_parentLink->getDecorIDs());
637 }
638
639 m_decorids = std::move(decors);
640 std::atomic_thread_fence( std::memory_order_seq_cst );
641 m_auxids = std::move(ids);
642
643 m_auxidsValid = true;
644 }

◆ reserve()

void xAOD::ShallowAuxContainer::reserve ( size_t size)
overridevirtualinherited

Reserve a given size for the arrays.

Implements SG::IAuxStore.

Definition at line 495 of file ShallowAuxContainer.cxx.

495 {
496
497 // Nope, not allowed...
498 throw std::runtime_error( "Trying to call reserve on a shallow copy "
499 "container" );
500 }

◆ resize()

bool xAOD::ShallowAuxContainer::resize ( size_t size)
overridevirtualinherited

Resize the arrays to a given size.

Implements SG::IAuxStore.

Definition at line 485 of file ShallowAuxContainer.cxx.

486 {
487 if (size == this->size()) {
488 return false;
489 }
490 // Nope, not allowed...
491 throw std::runtime_error( "Trying to call resize on a shallow copy "
492 "container" );
493 }

◆ setName()

void xAOD::ShallowAuxContainer::setName ( const char * name)
inherited

Set the name of the container instance.

Definition at line 622 of file ShallowAuxContainer.cxx.

622 {
623
624 m_name = name;
625 return;
626 }
const char * name() const
Get the name of the container instance.

◆ setOption()

virtual bool SG::IAuxStore::setOption ( auxid_t ,
const AuxDataOption &  )
inlinevirtualinherited

Set an option for a given auxiliary variable.

Parameters
auxidThe identifier of the desired aux data item.
optionThe option to set.

The interpretation of the option depends on the particular representation of the variable.

Returns true if the option setting was successful; false otherwise.

Reimplemented in xAOD::AuxContainerBase, and xAOD::AuxInfoBase.

Definition at line 189 of file IAuxStore.h.

190 { return false; }

◆ setParent()

void xAOD::ShallowAuxContainer::setParent ( const DataLink< SG::IConstAuxStore > & link)
inherited

Set the parent store.

Definition at line 127 of file ShallowAuxContainer.cxx.

128 {
129
130 guard_t guard (m_mutex);
132 m_parentIO = dynamic_cast< const SG::IAuxStoreIO* >( m_parentLink.cptr() );
133 m_auxidsValid = false;
134 return;
135 }
pointer & link(pointer p) const
Return a reference to the link for an element.

◆ setShallowIO()

void xAOD::ShallowAuxContainer::setShallowIO ( bool value)
inherited

Set whether only the overriden parameters should be written out.

Definition at line 142 of file ShallowAuxContainer.cxx.

142 {
143
144 guard_t guard (m_mutex);
146 return;
147 }

◆ setStore()

void xAOD::ShallowAuxContainer::setStore ( SG::IAuxStore * store)
overridevirtualinherited

Set a different internal store object.

Implements SG::IAuxStoreHolder.

Definition at line 164 of file ShallowAuxContainer.cxx.

164 {
165
166 // Check if anything needs to be done:
167 guard_t guard (m_mutex);
168 if( store == m_store ) return;
169
170 if( m_ownsStore && m_store ) {
171 delete m_store;
172 m_store = nullptr;
173 }
174
175 // Do the assignment:
176 m_store = store;
177 m_storeIO = dynamic_cast< SG::IAuxStoreIO* >( m_store );
178 m_ownsStore = true;
179 m_auxidsValid = false;
180
181 return;
182 }
bool m_ownsStore
Flag deciding if the object owns the dynamic store or not.
TestStore store
Definition TestStore.cxx:23

◆ shallowIO()

bool xAOD::ShallowAuxContainer::shallowIO ( ) const
inherited

Check whether only the overriden parameters will be written out or not.

Definition at line 137 of file ShallowAuxContainer.cxx.

137 {
138
139 return m_shallowIO;
140 }

◆ shift()

void xAOD::ShallowAuxContainer::shift ( size_t pos,
ptrdiff_t offs )
overridevirtualinherited

Shift the contents of the stored arrays.

Implements SG::IAuxStore.

Definition at line 502 of file ShallowAuxContainer.cxx.

502 {
503
504 // Nope, not allowed...
505 throw std::runtime_error( "Trying to call shift on a shallow copy "
506 "container" );
507 }

◆ size()

size_t xAOD::ShallowAuxContainer::size ( ) const
overridevirtualinherited

Get the size of the container.

Definition at line 376 of file ShallowAuxContainer.cxx.

376 {
377
378 guard_t guard( m_mutex );
379 size_t sz = m_store->size();
380 if( sz > 0 ) {
381 return sz;
382 }
383 if( m_parentLink.isValid() ) {
384 return m_parentLink->size();
385 }
386 return 0;
387 }
static Double_t sz

◆ toTransient()

void xAOD::ShallowAuxContainer::toTransient ( const EventContext & ctx)
overridevirtualinherited

Perform processing on aux variable objects just after reading to make them usable as transient objects.

Implements SG::IAuxStore.

Definition at line 518 of file ShallowAuxContainer.cxx.

518 {
519 m_parentLink.toTransient( ctx );
520 m_store->toTransient( ctx );
521 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/3]

bool m_auxidsValid xAOD::ShallowAuxContainer::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 213 of file ShallowAuxContainer.h.

◆ ATLAS_THREAD_SAFE [2/3]

auxid_set_t m_decorids xAOD::ShallowAuxContainer::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 212 of file ShallowAuxContainer.h.

◆ ATLAS_THREAD_SAFE [3/3]

auxid_set_t m_auxids xAOD::ShallowAuxContainer::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 211 of file ShallowAuxContainer.h.

◆ m_locked

bool xAOD::ShallowAuxContainer::m_locked
privateinherited

Flag keeping track of whether this object is locked or not.

Definition at line 195 of file ShallowAuxContainer.h.

◆ m_mutex

mutex_t xAOD::ShallowAuxContainer::m_mutex
mutableprivateinherited

Definition at line 207 of file ShallowAuxContainer.h.

◆ m_name

std::string xAOD::ShallowAuxContainer::m_name
privateinherited

Name of the container in memory. Set externally.

Definition at line 216 of file ShallowAuxContainer.h.

◆ m_ownsStore

bool xAOD::ShallowAuxContainer::m_ownsStore
privateinherited

Flag deciding if the object owns the dynamic store or not.

Definition at line 193 of file ShallowAuxContainer.h.

◆ m_parentIO

const SG::IAuxStoreIO* xAOD::ShallowAuxContainer::m_parentIO
privateinherited

Optional pointer to the IO interface of the parent object.

Definition at line 200 of file ShallowAuxContainer.h.

◆ m_parentLink

DataLink< SG::IConstAuxStore > xAOD::ShallowAuxContainer::m_parentLink
privateinherited

Link to the parent object.

Definition at line 198 of file ShallowAuxContainer.h.

◆ m_selection

AuxSelection xAOD::ShallowAuxContainer::m_selection
privateinherited

Dynamic attributes selection implementation.

Definition at line 186 of file ShallowAuxContainer.h.

◆ m_shallowIO

bool xAOD::ShallowAuxContainer::m_shallowIO
privateinherited

Flag for whether to do "shallow IO" or not.

Definition at line 202 of file ShallowAuxContainer.h.

◆ m_store

SG::IAuxStore* xAOD::ShallowAuxContainer::m_store
privateinherited

Internal dynamic auxiliary store object.

Definition at line 189 of file ShallowAuxContainer.h.

◆ m_storeIO

SG::IAuxStoreIO* xAOD::ShallowAuxContainer::m_storeIO
privateinherited

The IO interface to the internal auxiliary store.

Definition at line 191 of file ShallowAuxContainer.h.

◆ supportsThinning

bool xAOD::ShallowAuxInfo::supportsThinning = false
staticconstexpr

Flag that we should not use the xAOD aux store pool converter for this type.

Definition at line 39 of file ShallowAuxInfo.h.


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