34 m_store( new
SG::AuxStoreInternal( standalone ) ),
38 m_auxidsValid (false),
45 :
SG::IAuxStore(),
SG::IAuxStoreIO(),
SG::IAuxStoreHolder(),
71 m_store( new
SG::AuxStoreInternal( standalone ) ),
75 m_auxidsValid (false),
115 m_auxids = rhs.m_auxids;
116 m_auxidsValid= rhs.m_auxidsValid;
133 m_auxidsValid =
false;
179 m_auxidsValid =
false;
208 size_t nids =
m_store->getAuxIDs().size();
210 if( result !=
nullptr && result->toPtr() !=
nullptr ) {
211 if( nids !=
m_store->getAuxIDs().size() ) {
221 if( result && ( nids !=
m_parentLink->getAuxIDs().size() ) ) {
235 if (!m_auxidsValid) {
245 if (!m_auxidsValid) {
258 ids.insert (
m_store->getCopyIDs (warnUnlocked));
270 return m_store->isDecoration (auxid);
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() ) ) {
305 if(
cptr !=
nullptr ) {
314 if( pptr ==
nullptr ) {
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() );
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() );
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() );
350 factory->
copy( auxid,
372 m_store->lockDecoration (auxid);
373 m_auxidsValid =
false;
393 bool ret =
m_store->clearDecorations();
418 void* ptr =
m_store->getData( auxid,
size, capacity );
424 if(
cptr !=
nullptr ) {
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() );
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() );
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() );
469 factory->
copy( auxid,
482 return m_store->getWritableAuxIDs();
491 throw std::runtime_error(
"Trying to call resize on a shallow copy "
498 throw std::runtime_error(
"Trying to call reserve on a shallow copy "
505 throw std::runtime_error(
"Trying to call shift on a shallow copy "
514 throw std::runtime_error(
"Trying to call insertMove on a shallow copy "
536 if( ( parentIO ==
nullptr ) &&
m_parentLink.isValid() ) {
545 std::cerr <<
"ERROR xAOD::ShallowAuxContainer::getIOData Unknown "
548 <<
") requested" << std::endl;
562 if( ( parentIO ==
nullptr ) &&
m_parentLink.isValid() ) {
571 std::cerr <<
"ERROR xAOD::ShallowAuxContainer::getIOType Unknown "
574 <<
") requested" << std::endl;
633 m_decorids = std::move(decors);
634 std::atomic_thread_fence( std::memory_order_seq_cst );
635 m_auxids = std::move(ids);
637 m_auxidsValid =
true;
ElementConstPointer cptr() const
Return a pointer to the referenced element.
An auxiliary data store that holds data internally.
Handle mappings between names and auxid_t.
Make an AuxVectorData object from either a raw vector or an aux store.
Exceptions that can be thrown from AthContainers.
Interface for factory objects that create vectors.
Handle mappings between names and auxid_t.
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
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.
Make an AuxVectorData object from either a raw array or an aux store.
Exception — Attempted to modify auxiliary data in a locked store.
Interface providing I/O for a generic auxiliary store.
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.
virtual const void * getIOData(SG::auxid_t auxid) const =0
Return a pointer to the data to be stored for one aux data item.
Interface for non-const operations on an auxiliary store.
Interface for factory objects that create vectors.
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.
Abstract interface for manipulating vectors of arbitrary types.
A set of aux data identifiers.
Class creating a shallow copy of an existing auxiliary container.
virtual const SG::IAuxTypeVector * getVector(SG::auxid_t auxid) const override final
Return vector interface for one aux data item.
bool m_locked
Flag keeping track of whether this object is locked or not.
virtual void shift(size_t pos, ptrdiff_t offs) override
Shift the contents of the stored arrays.
virtual void setStore(SG::IAuxStore *store) override
Set a different internal store object.
SG::IAuxStore * m_store
Internal dynamic auxiliary store object.
ShallowAuxContainer(bool standalone=false)
Default constructor.
AthContainers_detail::lock_guard< mutex_t > guard_t
bool m_shallowIO
Flag for whether to do "shallow IO" or not.
virtual const auxid_set_t & getWritableAuxIDs() const override
Return a set of writable data identifiers.
virtual const void * getData(auxid_t auxid) const override
Get a pointer to a given array.
void setParent(const DataLink< SG::IConstAuxStore > &link)
Set the parent store.
virtual const auxid_set_t & getDynamicAuxIDs() const override
Get the types(names) of variables created dynamically.
bool m_ownsStore
Flag deciding if the object owns the dynamic store or not.
void setName(const char *name)
Set the name of the container instance.
bool shallowIO() const
Check whether only the overriden parameters will be written out or not.
virtual SG::IAuxStore * getStore() override
Get the currently used internal store object.
SG::IAuxStoreIO * m_storeIO
The IO interface to the internal auxiliary store.
const char * name() const
Get the name of the container instance.
SG::auxid_set_t auxid_set_t
The aux ID set type definition.
virtual const void * getIOData(auxid_t auxid) const override
Get a pointer to the data being stored for one aux data item.
virtual void lock() override
Lock the 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 const auxid_set_t & getDecorIDs() const override
Get the types(names) of decorations handled by this container.
ShallowAuxContainer & operator=(const ShallowAuxContainer &rhs)
Assignment operator.
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
DataLink< SG::IConstAuxStore > m_parentLink
Link to the parent object.
SG::auxid_t auxid_t
The aux ID type definition.
virtual void reserve(size_t size) override
Reserve a given size for the arrays.
virtual size_t size() const override
Get the size of the container.
const SG::IAuxStoreIO * m_parentIO
Optional pointer to the IO interface of the parent object.
~ShallowAuxContainer()
Destructor.
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.
void setShallowIO(bool value)
Set whether only the overriden parameters should be written out.
AuxSelection m_selection
Dynamic attributes selection implementation.
virtual bool clearDecorations() override
Clear all decorations.
virtual auxid_set_t getSelectedAuxIDs() const override
Get the IDs of the selected dynamic Aux variables (for writing).
std::string m_name
Name of the container in memory. Set externally.
virtual bool resize(size_t size) override
Resize the arrays to a given size.
void remakeAuxIDs() const
virtual bool insertMove(size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore) override
Insert contents of another store via move.
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity) override
Return the data vector for one aux data decoration item.
virtual const auxid_set_t & getAuxIDs() const override
Get the types(names) of variables handled by this container.
const DataLink< SG::IConstAuxStore > & parent() const
Get the parent store.
size_t auxid_t
Identifier for a particular aux data item.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.