ATLAS Offline Software
Loading...
Searching...
No Matches
Athena::IdcThinningHdlr< Container > Class Template Reference

Handle DataProxy holding IdentifiableContainer This class defines a (type-safe) protocol to pack and unpack thinned IdentifiableContainer. More...

#include <IThinningHdlr.h>

Inheritance diagram for Athena::IdcThinningHdlr< Container >:
Collaboration diagram for Athena::IdcThinningHdlr< Container >:

Public Member Functions

 IdcThinningHdlr (const Container &c)
void remove (const std::size_t idx)
 remove an element from the proxied DataVector
void commit ()
 pack the proxied collection This is needed in order to keep element link indices consistent and T/P converters unchanged.
void rollback ()
 unpack the proxied DataVector ie: restore it as it was before any thinning took place
virtual bool isMapping () const
 publish the type of underlying indexing (mapping or sequencing)

Private Types

typedef Container Idc_t
typedef Idc_t::IDENTIFIABLE Identifiable_t
typedef std::pair< std::size_t, Identifiable_t * > Backup_t
typedef std::list< Backup_tBackups_t

Private Attributes

Backups_t m_backup
 Vector holding the pointers to the elements of IdentifiableContainer, before any thinning took place.
Idc_tm_container

Detailed Description

template<typename Container>
class Athena::IdcThinningHdlr< Container >

Handle DataProxy holding IdentifiableContainer This class defines a (type-safe) protocol to pack and unpack thinned IdentifiableContainer.

This is not MT-safe!

Definition at line 180 of file IThinningHdlr.h.

Member Typedef Documentation

◆ Backup_t

template<typename Container>
typedef std::pair<std::size_t, Identifiable_t*> Athena::IdcThinningHdlr< Container >::Backup_t
private

Definition at line 184 of file IThinningHdlr.h.

◆ Backups_t

template<typename Container>
typedef std::list<Backup_t> Athena::IdcThinningHdlr< Container >::Backups_t
private

Definition at line 185 of file IThinningHdlr.h.

◆ Idc_t

template<typename Container>
typedef Container Athena::IdcThinningHdlr< Container >::Idc_t
private

Definition at line 182 of file IThinningHdlr.h.

◆ Identifiable_t

template<typename Container>
typedef Idc_t::IDENTIFIABLE Athena::IdcThinningHdlr< Container >::Identifiable_t
private

Definition at line 183 of file IThinningHdlr.h.

Constructor & Destructor Documentation

◆ IdcThinningHdlr()

template<typename Container>
Athena::IdcThinningHdlr< Container >::IdcThinningHdlr ( const Container & c)
inline

Definition at line 194 of file IThinningHdlr.h.

194 :
196 m_backup (),
197 m_container( const_cast<Idc_t&>(c) )
198 {}
Handle DataProxy holding IdentifiableContainer This class defines a (type-safe) protocol to pack and ...
Backups_t m_backup
Vector holding the pointers to the elements of IdentifiableContainer, before any thinning took place.

Member Function Documentation

◆ commit()

template<typename Container>
void Athena::IdcThinningHdlr< Container >::commit ( )
inlinevirtual

pack the proxied collection This is needed in order to keep element link indices consistent and T/P converters unchanged.

Implements Athena::IThinningHdlr.

Definition at line 206 of file IThinningHdlr.h.

206{/*no-op*/}

◆ isMapping()

template<typename Container>
virtual bool Athena::IdcThinningHdlr< Container >::isMapping ( ) const
inlinevirtual

publish the type of underlying indexing (mapping or sequencing)

Reimplemented from Athena::IThinningHdlr.

Definition at line 219 of file IThinningHdlr.h.

219{return true;}

◆ remove()

template<typename Container>
void Athena::IdcThinningHdlr< Container >::remove ( const std::size_t idx)
inlinevirtual

remove an element from the proxied DataVector

Implements Athena::IThinningHdlr.

Definition at line 200 of file IThinningHdlr.h.

201 {
202 Identifiable_t *c = m_container.removeCollection (idx);
203 m_backup.push_back (std::make_pair(idx, c));
204 }
Idc_t::IDENTIFIABLE Identifiable_t

◆ rollback()

template<typename Container>
void Athena::IdcThinningHdlr< Container >::rollback ( )
inlinevirtual

unpack the proxied DataVector ie: restore it as it was before any thinning took place

Implements Athena::IThinningHdlr.

Definition at line 208 of file IThinningHdlr.h.

209 {
210 typedef typename Backups_t::iterator Iter;
211 Iter end = m_backup.end();
212 for ( Iter itr = m_backup.begin(); itr!=end; ++itr) {
213 m_container.addCollection (itr->second, itr->first).ignore();
214 }
215 }

Member Data Documentation

◆ m_backup

template<typename Container>
Backups_t Athena::IdcThinningHdlr< Container >::m_backup
private

Vector holding the pointers to the elements of IdentifiableContainer, before any thinning took place.

Definition at line 190 of file IThinningHdlr.h.

◆ m_container

template<typename Container>
Idc_t& Athena::IdcThinningHdlr< Container >::m_container
private

Definition at line 191 of file IThinningHdlr.h.


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