ATLAS Offline Software
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
DMTest::CTrigAuxContainer_v1 Class Referenceabstract

#include <CTrigAuxContainer_v1.h>

Inheritance diagram for DMTest::CTrigAuxContainer_v1:
Collaboration diagram for DMTest::CTrigAuxContainer_v1:

Public Types

typedef SG::auxid_t auxid_t
 The aux ID type definition from IConstAuxStore. More...
 
typedef SG::auxid_set_t auxid_set_t
 The aux ID set type definition from IConstAuxStore. More...
 
template<class T , class ALLOC = std::allocator<T>>
using AuxVariable_t = std::vector< T, ALLOC >
 Declare how to wrap variables for this sort of base. More...
 

Public Member Functions

 CTrigAuxContainer_v1 ()
 
void setName (const char *)
 
virtual const void * getData (SG::auxid_t auxid) const=0
 Pick up the const version from the base class. More...
 
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. More...
 
void reset ()
 Function resetting the internal (cached) state of the object. More...
 
template<typename T >
auxid_t getAuxID (const std::string &name, std::vector< T > &, SG::AuxVarFlags flags=SG::AuxVarFlags::None)
 Get the auxiliary ID for one of the persistent variables. More...
 
template<typename T >
void regAuxVar (auxid_t auxid, const std::string &name, std::vector< T > &vec)
 Register one of the user defined persistent variables internally. More...
 
virtual bool setOption (auxid_t, const AuxDataOption &)
 Set an option for a given auxiliary variable. More...
 
virtual IAuxTypeVector * linkedVector (SG::auxid_t)
 
virtual const IAuxTypeVector * linkedVector (SG::auxid_t) const
 Return interface for a linked variable. More...
 
virtual const IAuxTypeVector * linkedVector (SG::auxid_t) const
 Return interface for a linked variable. More...
 

Static Public Attributes

static constexpr bool supportsThinning = true
 Mark that this type supports thinning operations. More...
 

Private Member Functions

 AUXVAR_DECL (int, anInt)
 
 AUXVAR_DECL (float, aFloat)
 
size_t size_noLock () const
 Internal method: return size without taking out the lock. More...
 
template<typename T >
SG::IAuxTypeVectorgetVector1 (auxid_t auxid, std::map< std::string, std::vector< T > > &pers, size_t size, size_t capacity, bool quiet, bool forDecor) const
 Function retrieving a simple dynamic variable. More...
 
SG::IAuxTypeVectorgetVector1 (auxid_t auxid, size_t size, size_t capacity, bool quiet, bool forDecor) const
 

Private Attributes

std::string m_name
 Name of the container in memory. Set externally. More...
 

Transient variables used to implement the IAuxStore interface

typedef AthContainers_detail::mutex mutex_t
 Mutex for multithread synchronization. More...
 
typedef AthContainers_detail::lock_guard< mutex_tguard_t
 
auxid_set_t m_auxids ATLAS_THREAD_SAFE
 Internal list of auxiliary variables. More...
 
std::vector< SG::IAuxTypeVector * > m_dynamicVecs ATLAS_THREAD_SAFE
 Internal list of dynamic managed variables. More...
 
std::vector< SG::IAuxTypeVector * > m_staticVecs
 Internal list of static managed variables. More...
 
bool m_locked
 Has the container been locked? More...
 
SG::auxid_set_t m_decorations
 Record which variables are decorations. More...
 
mutex_t m_mutex
 

Detailed Description

Definition at line 25 of file CTrigAuxContainer_v1.h.

Member Typedef Documentation

◆ auxid_set_t

The aux ID set type definition from IConstAuxStore.

Definition at line 50 of file ByteStreamAuxContainer_v1.h.

◆ auxid_t

The aux ID type definition from IConstAuxStore.

Definition at line 48 of file ByteStreamAuxContainer_v1.h.

◆ AuxVariable_t

template<class T , class ALLOC = std::allocator<T>>
using xAOD::ByteStreamAuxContainer_v1::AuxVariable_t = std::vector<T, ALLOC>
inherited

Declare how to wrap variables for this sort of base.

Definition at line 136 of file ByteStreamAuxContainer_v1.h.

◆ guard_t

typedef AthContainers_detail::lock_guard<mutex_t> xAOD::ByteStreamAuxContainer_v1::guard_t
privateinherited

Definition at line 195 of file ByteStreamAuxContainer_v1.h.

◆ mutex_t

typedef AthContainers_detail::mutex xAOD::ByteStreamAuxContainer_v1::mutex_t
privateinherited

Mutex for multithread synchronization.

Definition at line 194 of file ByteStreamAuxContainer_v1.h.

Constructor & Destructor Documentation

◆ CTrigAuxContainer_v1()

DMTest::CTrigAuxContainer_v1::CTrigAuxContainer_v1 ( )

Definition at line 18 of file CTrigAuxContainer_v1.cxx.

20 {
21 }

Member Function Documentation

◆ AUXVAR_DECL() [1/2]

DMTest::CTrigAuxContainer_v1::AUXVAR_DECL ( float  ,
aFloat   
)
private

◆ AUXVAR_DECL() [2/2]

DMTest::CTrigAuxContainer_v1::AUXVAR_DECL ( int  ,
anInt   
)
private

◆ clearDecorations()

bool xAOD::ByteStreamAuxContainer_v1::clearDecorations ( )
overridevirtualinherited

Clear all decorations.

Implements SG::IConstAuxStore.

Definition at line 195 of file ByteStreamAuxContainer_v1.cxx.

196  {
197  guard_t guard (m_mutex);
198 
200 
201  bool anycleared = false;
202  for (auxid_t auxid : m_decorations) {
203  if (m_dynamicVecs[auxid]) {
204  delete m_dynamicVecs[auxid];
205  m_dynamicVecs[auxid] = nullptr;
206  m_auxids.erase( auxid );
207  anycleared = true;
208 
209  const std::string name = r.getName( auxid );
210  const std::type_info* ti = r.getType( auxid );
211  if (ti == &typeid(int))
212  m_int.erase (name);
213  else if (ti == &typeid(float))
214  m_float.erase (name);
215  else if (ti == &typeid(std::vector<int>))
216  m_vecInt.erase (name);
217  else if (ti == &typeid(std::vector<float>))
218  m_vecFloat.erase (name);
219  }
220  }
222 
223  return anycleared;
224  }

◆ getAuxID()

template<typename T >
auxid_t xAOD::ByteStreamAuxContainer_v1::getAuxID ( const std::string &  name,
std::vector< T > &  ,
SG::AuxVarFlags  flags = SG::AuxVarFlags::None 
)
inherited

Get the auxiliary ID for one of the persistent variables.

◆ getAuxIDs()

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

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

Implements SG::IConstAuxStore.

Definition at line 118 of file ByteStreamAuxContainer_v1.cxx.

118  {
119 
120  // Return the full list of IDs:
121  return getWritableAuxIDs();
122  }

◆ getData() [1/3]

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

Get a pointer to a given array.

Implements SG::IConstAuxStore.

Definition at line 86 of file ByteStreamAuxContainer_v1.cxx.

86  {
87 
88  const SG::IAuxTypeVector* v = getVector( auxid );
89  if( v ) {
90  return v->toPtr();
91  }
92  return nullptr;
93  }

◆ getData() [2/3]

void * xAOD::ByteStreamAuxContainer_v1::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 260 of file ByteStreamAuxContainer_v1.cxx.

261  {
262 
263  guard_t guard (m_mutex);
264 
265  // Check if we have such a static variable:
266  if( ( auxid < m_staticVecs.size() ) && ( m_staticVecs[ auxid ] ) ) {
267  // Set it to the right size:
268  m_staticVecs[ auxid ]->reserve( capacity );
269  m_staticVecs[ auxid ]->resize( size );
270  // We're done already:
271  return m_staticVecs[ auxid ]->toPtr();
272  }
273  // Check if we already know about this dynamic variable:
274  else if( ( auxid < m_dynamicVecs.size() ) &&
275  ( m_dynamicVecs[ auxid ] ) ) {
276  // Set it to the right size:
277  m_dynamicVecs[ auxid ]->reserve( capacity );
278  m_dynamicVecs[ auxid ]->resize( size );
279  // We're done already:
280  return m_dynamicVecs[ auxid ]->toPtr();
281  }
282 
283  SG::IAuxTypeVector* v = getVector1 (auxid, size, capacity, false, false);
284  if( v ) {
285  return v->toPtr();
286  }
287  return nullptr;
288  }

◆ getData() [3/3]

virtual const void* SG::IConstAuxStore::getData
inherited

Pick up the const version from the base class.

◆ getDecoration()

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

Get a pointer to a given array, as a decoration.

Implements SG::IConstAuxStore.

Definition at line 132 of file ByteStreamAuxContainer_v1.cxx.

135  {
136  guard_t guard (m_mutex);
137 
138  // Does this variable already exist?
139  void* ret = nullptr;
140  if( ( auxid < m_staticVecs.size() ) && ( m_staticVecs[ auxid ] ) ) {
141  ret = m_staticVecs[ auxid ]->toPtr();
142  }
143  // If it's a dynamic one:
144  else if( ( auxid < m_dynamicVecs.size() ) &&
145  ( m_dynamicVecs[ auxid ] ) ) {
146  ret = m_dynamicVecs[ auxid ]->toPtr();
147  }
148 
149  if (!ret) {
150  SG::IAuxTypeVector* v = getVector1 (auxid, 0, 0, true, true);
151  if( v ) {
152  ret = v->toPtr();
153  }
154  }
155 
156  if (ret) {
157  // Raise exception if locked and not a decoration.
158  if (m_locked) {
159  if ( ! m_decorations.test (auxid) ) {
160  throw SG::ExcStoreLocked (auxid);
161  }
162  }
163  return ret;
164  }
165 
166  // Make a new variable.
167  // If locked, mark as a decoration.
168  if (m_locked) {
169  m_decorations.insert (auxid);
170  std::atomic_thread_fence (std::memory_order_seq_cst);
171  }
172  SG::IAuxTypeVector* v = getVector1 (auxid, size, capacity, false, true);
173  if( v ) {
174  ret = v->toPtr();
175  }
176 
177  return ret;
178  }

◆ getDecorIDs()

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

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

Implements SG::IConstAuxStore.

Definition at line 125 of file ByteStreamAuxContainer_v1.cxx.

125  {
126 
127  // Return the full list of IDs:
128  return m_decorations;
129  }

◆ getVector()

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

Return vector interface for one aux data item.

Implements SG::IConstAuxStore.

Definition at line 95 of file ByteStreamAuxContainer_v1.cxx.

95  {
96 
97  guard_t guard (m_mutex);
98 
99  // If it's a static auxiliary property:
100  if( ( auxid < m_staticVecs.size() ) && ( m_staticVecs[ auxid ] ) ) {
101  // We're done already:
102  return m_staticVecs[ auxid ];
103  }
104  // If it's a dynamic one:
105  else if( ( auxid < m_dynamicVecs.size() ) &&
106  ( m_dynamicVecs[ auxid ] ) ) {
107  // We're done already:
108  return m_dynamicVecs[ auxid ];
109  }
110 
111  // Try to retrieve the dynamic variable:
112  // quiet on because this method may be called from isAccessible
113  // and that shouldn't generate any output.
114  return getVector1 (auxid, 0, 0, true, false);
115  }

◆ getVector1() [1/2]

SG::IAuxTypeVector * xAOD::ByteStreamAuxContainer_v1::getVector1 ( auxid_t  auxid,
size_t  size,
size_t  capacity,
bool  quiet,
bool  forDecor 
) const
privateinherited

Definition at line 537 of file ByteStreamAuxContainer_v1.cxx.

540  {
541 
542  // Private method --- should hold lock before calling this.
543 
544  if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
545  typeid( int ) ) {
546 
547  return getVector1( auxid, m_int, size, capacity, quiet, forDecor );
548  }
549  else if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
550  typeid( float ) ) {
551 
552  return getVector1( auxid, m_float, size, capacity, quiet, forDecor );
553  }
554  else if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
555  typeid( std::vector< int > ) ) {
556 
557  return getVector1( auxid, m_vecInt, size, capacity, quiet, forDecor );
558  }
559  else if( *( SG::AuxTypeRegistry::instance().getType( auxid ) ) ==
560  typeid( std::vector< float > ) ) {
561 
562  return getVector1( auxid, m_vecFloat, size, capacity, quiet, forDecor );
563  }
564 
565  // The object can't handle this variable type...
566  std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1::getData "
567  << "Unknown variable type ("
568  << SG::AuxTypeRegistry::instance().getType( auxid )->name()
569  << ") requested" << std::endl;
570 
571  return nullptr;
572  }

◆ getVector1() [2/2]

template<typename T >
SG::IAuxTypeVector * xAOD::ByteStreamAuxContainer_v1::getVector1 ( auxid_t  auxid,
std::map< std::string, std::vector< T > > &  pers,
size_t  size,
size_t  capacity,
bool  quiet,
bool  forDecor 
) const
privateinherited

Function retrieving a simple dynamic variable.

Look for variable auxid in pers.

If capacity > 0, a new variable will be created if necessary.

If not found, create it if capacity != 0.

Definition at line 465 of file ByteStreamAuxContainer_v1.cxx.

470  {
471 
472  // Private method --- should hold lock before calling this.
473 
474  // Look up the name of the variable:
476  const std::string name = r.getName( auxid );
477 
478  // Try to find the variable:
479  typename std::map< std::string, std::vector< T > >::iterator itr =
480  pers.find( name );
481  if( itr == pers.end() ) {
482  // Variable isn't there. Fail if capacity==0.
483  if (capacity == 0) {
484  if (!quiet) {
485  std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1::getData (const) "
486  << "Variable with unknown name (" << name << ") requested"
487  << std::endl;
488  }
489  return nullptr;
490  }
491 
492  if (m_locked && !forDecor)
493  throw SG::ExcStoreLocked ("getData");
494 
495  if (r.isLinked(auxid)) {
496  std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1 doesn't implement linked variables"
497  << std::endl;
498  return nullptr;
499  }
500 
501  // Create the variable.
502  itr = pers.insert (std::make_pair (name, std::vector<T>())).first;
503  }
504 
505  // Get hold of the variable.
506  std::vector< T >& var = itr->second;
507 
508  // Make sure that the internal vector is big enough:
509  if( m_dynamicVecs.size() <= auxid ) {
510  m_dynamicVecs.resize( auxid + 1 );
511  }
512 
513  // Just an internal check...
514  if( m_dynamicVecs[ auxid ] ) {
515  std::cerr << "ERROR xAOD::ByteStreamAuxContainer_v1::getData "
516  << "Internal inconsistency detected!" << std::endl;
517  return m_dynamicVecs[ auxid ];
518  }
519 
520  // Register the variable:
521  m_dynamicVecs[ auxid ] = new AuxPersVector< T >( auxid, var, false, nullptr );
522 
523  if (capacity > 0) {
524  // Set it to the right size:
525  m_dynamicVecs[ auxid ]->reserve( capacity );
526  m_dynamicVecs[ auxid ]->resize( size );
527  }
528 
529  // Remember that we are now handling this variable:
530  m_auxids.insert( auxid );
531 
532  // Return the pointer to the array:
533  return m_dynamicVecs[ auxid ];
534  }

◆ getWritableAuxIDs()

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

Return a set of writable data identifiers.

Implements SG::IAuxStore.

Definition at line 291 of file ByteStreamAuxContainer_v1.cxx.

291  {
292 
293  return m_auxids;
294  }

◆ insertMove() [1/2]

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

Insert contents of another store via move.

Definition at line 363 of file ByteStreamAuxContainer_v1.cxx.

365  {
366 
367  guard_t guard( m_mutex );
368 
369  // This operation is not allowed on a locked container:
370  if( m_locked ) {
371  throw SG::ExcStoreLocked( "insertMove" );
372  }
373 
374  bool nomove = true;
375  size_t other_size = other.size();
376 
377  SG::auxid_set_t ignore = ignore_in;
378 
379  // Do the operation on the static variables:
380  for (SG::auxid_t id : m_auxids) {
381  SG::IAuxTypeVector* v_dst = nullptr;
382  if (id < m_dynamicVecs.size())
383  v_dst = m_dynamicVecs[id];
384  if (!v_dst && id < m_staticVecs.size())
385  v_dst = m_staticVecs[id];
386  if (v_dst) {
387  ignore.insert (id);
388  if (other.getData (id)) {
389  void* src_ptr = other.getData (id, other_size, other_size);
390  if (src_ptr) {
391  if (!v_dst->insertMove (pos, src_ptr, 0, other_size,
392  other))
393  nomove = false;
394  }
395  }
396  else {
397  const void* orig = v_dst->toPtr();
398  v_dst->shift (pos, other_size);
399  if (orig != v_dst->toPtr())
400  nomove = false;
401  }
402  }
403  }
404 
405  // Add any new variables not present in the original container.
406  for (SG::auxid_t id : other.getAuxIDs()) {
407  if (!m_auxids.test(id) &&
408  !ignore.test(id))
409  {
410  if (other.getData (id)) {
411  void* src_ptr = other.getData (id, other_size, other_size);
412  if (src_ptr) {
413  size_t sz = size_noLock();
414  getVector1 (id, sz, sz, true, false);
415  m_dynamicVecs[id]->resize (sz - other_size);
416  m_dynamicVecs[id]->insertMove (pos, src_ptr, 0, other_size,
417  other);
418  nomove = false;
419  }
420  }
421  }
422  }
423 
424  return nomove;
425  }

◆ insertMove() [2/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.

Implemented in SG::AuxStoreInternal.

◆ isDecoration()

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

Test if a variable is a decoration.

Implements SG::IConstAuxStore.

Definition at line 182 of file ByteStreamAuxContainer_v1.cxx.

183  {
184  guard_t guard (m_mutex);
185  return m_locked && m_decorations.test (auxid);
186  }

◆ linkedVector() [1/3]

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

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

Definition at line 187 of file IAuxStore.h.

188  { return nullptr; }

◆ linkedVector() [2/3]

virtual const IAuxTypeVector* SG::IConstAuxStore::linkedVector
inlineinherited

Return interface for a linked variable.

Parameters
auxidThe ID of the parent variable.

If auxid has a linked variable, then return the IAuxTypeVector describing it. Otherwise, return nullptr. May return nullptr unconditionally if this store does not support linked variables.

Definition at line 189 of file IConstAuxStore.h.

190  { return nullptr; }

◆ linkedVector() [3/3]

virtual const IAuxTypeVector* SG::IConstAuxStore::linkedVector ( SG::auxid_t  ) const
inlinevirtualinherited

Return interface for a linked variable.

Parameters
auxidThe ID of the parent variable.

If auxid has a linked variable, then return the IAuxTypeVector describing it. Otherwise, return nullptr. May return nullptr unconditionally if this store does not support linked variables.

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

Definition at line 189 of file IConstAuxStore.h.

190  { return nullptr; }

◆ lock()

void xAOD::ByteStreamAuxContainer_v1::lock ( )
overridevirtualinherited

Lock the container.

Implements ILockable.

Definition at line 189 of file ByteStreamAuxContainer_v1.cxx.

190  {
191  guard_t guard (m_mutex);
192  m_locked = true;
193  }

◆ lockDecoration()

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

Lock a decoration.

Implements SG::IConstAuxStore.

Definition at line 228 of file ByteStreamAuxContainer_v1.cxx.

229  {
230  guard_t guard (m_mutex);
231  m_decorations.reset (auxid);
232  }

◆ name()

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

Get the name of the container instance.

Definition at line 450 of file ByteStreamAuxContainer_v1.cxx.

450  {
451 
452  return m_name.c_str();
453  }

◆ regAuxVar()

template<typename T >
void xAOD::ByteStreamAuxContainer_v1::regAuxVar ( auxid_t  auxid,
const std::string &  name,
std::vector< T > &  vec 
)
inherited

Register one of the user defined persistent variables internally.

◆ reserve()

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

Reserve a given size for the arrays.

Implements SG::IAuxStore.

Definition at line 321 of file ByteStreamAuxContainer_v1.cxx.

321  {
322 
323  guard_t guard (m_mutex);
324 
325  if (m_locked)
326  throw SG::ExcStoreLocked ("reserve");
327 
328  std::vector< SG::IAuxTypeVector* >::iterator itr = m_dynamicVecs.begin();
330  for( ; itr != end; ++itr ) {
331  if( *itr ) ( *itr )->reserve( size );
332  }
333  itr = m_staticVecs.begin();
334  end = m_staticVecs.end();
335  for( ; itr != end; ++itr ) {
336  if( *itr ) ( *itr )->reserve( size );
337  }
338 
339  return;
340  }

◆ reset()

void xAOD::ByteStreamAuxContainer_v1::reset ( )
inherited

Function resetting the internal (cached) state of the object.

Definition at line 428 of file ByteStreamAuxContainer_v1.cxx.

428  {
429 
430  guard_t guard (m_mutex);
431 
432  for (SG::IAuxTypeVector* p : m_dynamicVecs)
433  delete p;
434  m_dynamicVecs.clear();
435 
437 #define ADD_IDS(VAR, TYP) \
438  do { typedef std::map< std::string, std::vector< TYP > > CONT; \
439  for (CONT::value_type& p : VAR) \
440  m_auxids.insert (r.getAuxID< TYP > (p.first, "", SG::AuxVarFlags::SkipNameCheck)); } while(0)
441  ADD_IDS(m_int, int);
442  ADD_IDS(m_float, float);
443  ADD_IDS(m_vecInt, std::vector<int>);
444  ADD_IDS(m_vecFloat, std::vector<float>);
445 #undef ADD_IDS
446 
447  return;
448  }

◆ resize()

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

Resize the arrays to a given size.

Implements SG::IAuxStore.

Definition at line 296 of file ByteStreamAuxContainer_v1.cxx.

296  {
297 
298  guard_t guard (m_mutex);
299 
300  if (m_locked)
301  throw SG::ExcStoreLocked ("resize");
302 
303  bool nomoves = true;
304  for (SG::IAuxTypeVector* v : m_dynamicVecs) {
305  if(v) {
306  if (!v->resize( size ))
307  nomoves = false;
308  }
309  }
310 
312  if(v) {
313  if (!v->resize( size ))
314  nomoves = false;
315  }
316  }
317 
318  return nomoves;
319  }

◆ setName()

void DMTest::CTrigAuxContainer_v1::setName ( const char *  )
inline

Definition at line 31 of file CTrigAuxContainer_v1.h.

31 {}

◆ 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, xAOD::AuxInfoBase, and SG::AuxStoreInternal.

Definition at line 173 of file IAuxStore.h.

174  { return false; }

◆ shift()

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

Shift the contents of the stored arrays.

Implements SG::IAuxStore.

Definition at line 342 of file ByteStreamAuxContainer_v1.cxx.

342  {
343 
344  guard_t guard (m_mutex);
345 
346  if (m_locked)
347  throw SG::ExcStoreLocked ("shift");
348 
349  std::vector< SG::IAuxTypeVector* >::iterator itr = m_dynamicVecs.begin();
351  for( ; itr != end; ++itr ) {
352  if( *itr ) ( *itr )->shift( pos, offs );
353  }
354  itr = m_staticVecs.begin();
355  end = m_staticVecs.end();
356  for( ; itr != end; ++itr ) {
357  if( *itr ) ( *itr )->shift( pos, offs );
358  }
359 
360  return;
361  }

◆ size()

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

Get the size of the container.

Implements SG::IConstAuxStore.

Definition at line 253 of file ByteStreamAuxContainer_v1.cxx.

254  {
255  guard_t guard (m_mutex);
256  return size_noLock();
257  }

◆ size_noLock()

size_t xAOD::ByteStreamAuxContainer_v1::size_noLock ( ) const
privateinherited

Internal method: return size without taking out the lock.

Definition at line 235 of file ByteStreamAuxContainer_v1.cxx.

236  {
237  for (SG::auxid_t i : m_auxids) {
238  if (i < m_staticVecs.size() && m_staticVecs[i]) {
239  size_t sz = m_staticVecs[i]->size();
240  if (sz > 0)
241  return sz;
242  }
243  if (i < m_dynamicVecs.size() && m_dynamicVecs[i]) {
244  size_t sz = m_dynamicVecs[i]->size();
245  if (sz > 0)
246  return sz;
247  }
248  }
249 
250  return 0;
251  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/6]

std::map< std::string, std::vector< int > > m_int xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Variable holding integer auxiliary variables.

Definition at line 169 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [2/6]

std::map< std::string, std::vector< float > > m_float xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Variable holding float auxiliary variables.

Definition at line 171 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [3/6]

std::map< std::string, std::vector< std::vector< int > > > m_vecInt xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Variable holding vector of integer auxiliary variables.

Definition at line 173 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [4/6]

std::map< std::string, std::vector< std::vector< float > > > m_vecFloat xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Variable holding vector of float auxiliary variables.

Definition at line 175 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [5/6]

auxid_set_t m_auxids xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Internal list of auxiliary variables.

Definition at line 183 of file ByteStreamAuxContainer_v1.h.

◆ ATLAS_THREAD_SAFE [6/6]

std::vector< SG::IAuxTypeVector* > m_dynamicVecs xAOD::ByteStreamAuxContainer_v1::ATLAS_THREAD_SAFE
mutableprivateinherited

Internal list of dynamic managed variables.

Definition at line 187 of file ByteStreamAuxContainer_v1.h.

◆ m_decorations

SG::auxid_set_t xAOD::ByteStreamAuxContainer_v1::m_decorations
privateinherited

Record which variables are decorations.

Definition at line 191 of file ByteStreamAuxContainer_v1.h.

◆ m_locked

bool xAOD::ByteStreamAuxContainer_v1::m_locked
privateinherited

Has the container been locked?

Definition at line 189 of file ByteStreamAuxContainer_v1.h.

◆ m_mutex

mutex_t xAOD::ByteStreamAuxContainer_v1::m_mutex
mutableprivateinherited

Definition at line 196 of file ByteStreamAuxContainer_v1.h.

◆ m_name

std::string xAOD::ByteStreamAuxContainer_v1::m_name
privateinherited

Name of the container in memory. Set externally.

Definition at line 201 of file ByteStreamAuxContainer_v1.h.

◆ m_staticVecs

std::vector< SG::IAuxTypeVector* > xAOD::ByteStreamAuxContainer_v1::m_staticVecs
privateinherited

Internal list of static managed variables.

Definition at line 185 of file ByteStreamAuxContainer_v1.h.

◆ supportsThinning

constexpr bool SG::IAuxStore::supportsThinning = true
staticconstexprinherited

Mark that this type supports thinning operations.

See AthContainers/supportsThinning.h and AthenaPoolCnvSvc/T_AthenaPoolCnv.h. Helps guide which pool converter template will be used. If false, the default pool converter will be used rather than the aux store-specific one. Ordinary xAOD type should not touch this, but may be overridden in a derived class to handle certain special cases.

Definition at line 199 of file IAuxStore.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SG::IAuxTypeVector::shift
virtual bool shift(size_t pos, ptrdiff_t offs)=0
Shift the elements of the vector.
beamspotman.r
def r
Definition: beamspotman.py:674
beamspotnt.var
var
Definition: bin/beamspotnt.py:1393
fitman.sz
sz
Definition: fitman.py:527
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:639
quiet
bool quiet
Definition: TrigGlobEffCorrValidation.cxx:190
SG::ExcStoreLocked
Exception — Attempted to modify auxiliary data in a locked store.
Definition: Control/AthContainers/AthContainers/exceptions.h:183
xAOD::ByteStreamAuxContainer_v1::getVector
virtual const SG::IAuxTypeVector * getVector(auxid_t auxid) const override final
Return vector interface for one aux data item.
Definition: ByteStreamAuxContainer_v1.cxx:95
xAOD::other
@ other
Definition: TrackingPrimitives.h:510
SG::IAuxTypeVector::insertMove
virtual bool insertMove(size_t pos, void *src, size_t src_pos, size_t src_n, IAuxStore &srcStore)=0
Insert elements into the vector via move semantics.
xAOD::ByteStreamAuxContainer_v1::m_staticVecs
std::vector< SG::IAuxTypeVector * > m_staticVecs
Internal list of static managed variables.
Definition: ByteStreamAuxContainer_v1.h:185
CxxUtils::ConcurrentBitset::clear
ConcurrentBitset & clear()
Clear all bits in the set.
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
SG::AuxTypeRegistry
Handle mappings between names and auxid_t.
Definition: AuxTypeRegistry.h:61
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:58
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::AuxTypeRegistry::getType
const std::type_info * getType(SG::auxid_t auxid) const
Return the type of an aux data item.
Definition: AuxTypeRegistry.cxx:908
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
xAOD::ByteStreamAuxContainer_v1::auxid_t
SG::auxid_t auxid_t
The aux ID type definition from IConstAuxStore.
Definition: ByteStreamAuxContainer_v1.h:48
lumiFormat.i
int i
Definition: lumiFormat.py:85
CxxUtils::ConcurrentBitset::insert
ConcurrentBitset & insert(bit_t bit, bit_t new_nbits=0)
Set a bit to 1.
CxxUtils::ConcurrentBitset::reset
ConcurrentBitset & reset(bit_t bit)
Turn off one bit.
xAOD::ByteStreamAuxContainer_v1::m_locked
bool m_locked
Has the container been locked?
Definition: ByteStreamAuxContainer_v1.h:189
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
xAOD::ByteStreamAuxContainer_v1::getWritableAuxIDs
virtual const auxid_set_t & getWritableAuxIDs() const override
Return a set of writable data identifiers.
Definition: ByteStreamAuxContainer_v1.cxx:291
xAOD::ByteStreamAuxContainer_v1::guard_t
AthContainers_detail::lock_guard< mutex_t > guard_t
Definition: ByteStreamAuxContainer_v1.h:195
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
xAOD::ByteStreamAuxContainer_v1::m_mutex
mutex_t m_mutex
Definition: ByteStreamAuxContainer_v1.h:196
xAOD::ByteStreamAuxContainer_v1::name
const char * name() const
Get the name of the container instance.
Definition: ByteStreamAuxContainer_v1.cxx:450
xAOD::ByteStreamAuxContainer_v1::size
virtual size_t size() const override
Get the size of the container.
Definition: ByteStreamAuxContainer_v1.cxx:253
python.PyAthena.v
v
Definition: PyAthena.py:154
SG::IAuxTypeVector
Abstract interface for manipulating vectors of arbitrary types.
Definition: IAuxTypeVector.h:42
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
xAOD::ByteStreamAuxContainer_v1::m_decorations
SG::auxid_set_t m_decorations
Record which variables are decorations.
Definition: ByteStreamAuxContainer_v1.h:191
xAOD::ByteStreamAuxContainer_v1::size_noLock
size_t size_noLock() const
Internal method: return size without taking out the lock.
Definition: ByteStreamAuxContainer_v1.cxx:235
xAOD::ByteStreamAuxContainer_v1
Base class for dynamic auxiliary stores saved into ByteStream.
Definition: ByteStreamAuxContainer_v1.h:44
Ringer::getType
T getType(const char *cStr)
Return Ringer enumeration of type T identifying string type:
ADD_IDS
#define ADD_IDS(VAR, TYP)
SG::IAuxTypeVector::toPtr
virtual void * toPtr()=0
Return a pointer to the start of the vector's data.
CxxUtils::ConcurrentBitset::test
bool test(bit_t bit) const
Test to see if a bit is set.
xAOD::ByteStreamAuxContainer_v1::getVector1
SG::IAuxTypeVector * getVector1(auxid_t auxid, std::map< std::string, std::vector< T > > &pers, size_t size, size_t capacity, bool quiet, bool forDecor) const
Function retrieving a simple dynamic variable.
Definition: ByteStreamAuxContainer_v1.cxx:465
xAOD::ByteStreamAuxContainer_v1::m_name
std::string m_name
Name of the container in memory. Set externally.
Definition: ByteStreamAuxContainer_v1.h:201