ATLAS Offline Software
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
JetMapBase< P > Class Template Reference

#include <JetMapBase.h>

Collaboration diagram for JetMapBase< P >:

Classes

class  record_ptr_t
 pointer wrapper, just to make certain the default pointers in maps are NULL More...
 

Public Types

typedef P data_t
 Publish payload data type. More...
 
typedef std::vector< data_trecord_t
 Publish record type. More...
 
typedef size_t key_t
 Publish key type. More...
 
typedef std::map< key_t, record_ptr_tmap_t
 publish store type More...
 

Public Member Functions

 JetMapBase ()
 Constructor
More...
 
 JetMapBase (const JetMapBase &base)=delete
 No copy ctor, assignment. More...
 
JetMapBaseoperator= (const JetMapBase &base)=delete
 
virtual ~JetMapBase ()
 destructor More...
 
virtual bool addRecord (size_t jetIndex) const
 Add a record. More...
 
virtual const record_tgetRecord (size_t jetIndex) const
 get the full record for a given jet More...
 
virtual void assignRecord (size_t jetIndex, record_t *rec) const
 assign a given record to a given jet More...
 
virtual void addData (size_t jetIndex, size_t keyIndex, const data_t &data) const
 Add data. More...
 
virtual bool retrieveData (size_t jetIndex, size_t keyIndex, data_t &data) const
 Retrieve data. More...
 
virtual const data_taccessData (size_t jetIndex, size_t keyIndex) const
 
virtual size_t numberOfMoments (size_t jetIndex) const
 
virtual void clear ()
 
virtual void clear (SG::OwnershipPolicy)
 
SG::OwnershipPolicy ownPolicy ()
 

Protected Member Functions

virtual void removeRecord (size_t jetIndex) const
 remove a record More...
 
virtual void transferRecord (const JetMapBase< P > *fromMap, size_t oldIndex, size_t newIndex) const
 transfer a record from an other map More...
 
map_tmap ()
 
const map_tmap () const
 

Protected Attributes

map_t m_store
 Store last valid record index ‍/ mutable size_t m_lastIndex; not used so remove it for simplicity /! More...
 
map_t::iterator m_end
 
SG::OwnershipPolicy m_ownPolicy
 

Static Protected Attributes

static const data_t m_nullData
 Null data reference. More...
 

Friends

class Jet
 Definition of the current "jet version". More...
 
template<class T >
class JetMomentMapConverterBase
 

Detailed Description

template<class P>
class JetMapBase< P >

Templated base class for map implementations with indexed lookup. The internal data store is organized in records of a payload data type (each record is an entry in the store).

Definition at line 16 of file JetMapBase.h.

Member Typedef Documentation

◆ data_t

template<class P >
typedef P JetMapBase< P >::data_t

Publish payload data type.

Definition at line 21 of file JetMapBase.h.

◆ key_t

template<class P >
typedef size_t JetMapBase< P >::key_t

Publish key type.

Definition at line 50 of file JetMapBase.h.

◆ map_t

template<class P >
typedef std::map<key_t, record_ptr_t> JetMapBase< P >::map_t

publish store type

Definition at line 52 of file JetMapBase.h.

◆ record_t

template<class P >
typedef std::vector<data_t> JetMapBase< P >::record_t

Publish record type.

Definition at line 23 of file JetMapBase.h.

Constructor & Destructor Documentation

◆ JetMapBase() [1/2]

template<class P >
JetMapBase< P >::JetMapBase ( )

Constructor

◆ JetMapBase() [2/2]

template<class P >
JetMapBase< P >::JetMapBase ( const JetMapBase< P > &  base)
delete

No copy ctor, assignment.

◆ ~JetMapBase()

template<class P >
virtual JetMapBase< P >::~JetMapBase ( )
virtual

destructor

Member Function Documentation

◆ accessData()

template<class P >
virtual const data_t& JetMapBase< P >::accessData ( size_t  jetIndex,
size_t  keyIndex 
) const
virtual

◆ addData()

template<class P >
virtual void JetMapBase< P >::addData ( size_t  jetIndex,
size_t  keyIndex,
const data_t data 
) const
virtual

Add data.

This method adds data to an existing record.

Parameters
jetIndexindex of the record in the store
keyIndexindex of the data in the record
datareference to non-mdoifiable data to be stored in record

Note that this method will overwrite any previously stored data at the (jetIndex,keyIndex) position.

◆ addRecord()

template<class P >
virtual bool JetMapBase< P >::addRecord ( size_t  jetIndex) const
virtual

Add a record.

This method adds a record to the store and returns the index of this record to the client. The returned value is false if the record already existed

Parameters
JetIndexreference to modifiable index, will contain the last index in the store.

◆ assignRecord()

template<class P >
virtual void JetMapBase< P >::assignRecord ( size_t  jetIndex,
record_t rec 
) const
virtual

assign a given record to a given jet

The map will 'own' the given record : it will delete it when destructed. If a record already exist at jetIndex, it will be deleted.

Parameters
jetIndexindex of the record in the store
recpointer to the record to store.

◆ clear() [1/2]

template<class P >
virtual void JetMapBase< P >::clear ( )
virtual

◆ clear() [2/2]

template<class P >
virtual void JetMapBase< P >::clear ( SG::OwnershipPolicy  )
inlinevirtual

Definition at line 125 of file JetMapBase.h.

125 {clear();}

◆ getRecord()

template<class P >
virtual const record_t* JetMapBase< P >::getRecord ( size_t  jetIndex) const
virtual

get the full record for a given jet

◆ map() [1/2]

template<class P >
map_t& JetMapBase< P >::map ( )
protected

◆ map() [2/2]

template<class P >
const map_t& JetMapBase< P >::map ( ) const
protected

◆ numberOfMoments()

template<class P >
virtual size_t JetMapBase< P >::numberOfMoments ( size_t  jetIndex) const
virtual

◆ operator=()

template<class P >
JetMapBase& JetMapBase< P >::operator= ( const JetMapBase< P > &  base)
delete

◆ ownPolicy()

template<class P >
SG::OwnershipPolicy JetMapBase< P >::ownPolicy ( )
inline

Definition at line 127 of file JetMapBase.h.

127 {return m_ownPolicy;};

◆ removeRecord()

template<class P >
virtual void JetMapBase< P >::removeRecord ( size_t  jetIndex) const
protectedvirtual

remove a record

Destroy the record associated to an entry.

Parameters
jetIndexidentifier of the record to remove

◆ retrieveData()

template<class P >
virtual bool JetMapBase< P >::retrieveData ( size_t  jetIndex,
size_t  keyIndex,
data_t data 
) const
virtual

Retrieve data.

Retrieves data by index pair and stores result in client supplied variable. Returns false if index pair (jetIndex,keyIndex) refers to non-existing entry, i.e. at least one of (jetIndex,keyIndex) is out of range.

Parameters
jetIndexindex of record in store
keyIndexindex of data in record
datareference to modifiable variable storing retrieved data

Note that in case of an invalid index pair the original value of data is not changed.

◆ transferRecord()

template<class P >
virtual void JetMapBase< P >::transferRecord ( const JetMapBase< P > *  fromMap,
size_t  oldIndex,
size_t  newIndex 
) const
protectedvirtual

transfer a record from an other map

Parameters
fromMappointer to the other map
oldIndexidentifier of the record in the other map
newIndexthe identifier in this map

Friends And Related Function Documentation

◆ Jet

template<class P >
friend class Jet
friend

Definition of the current "jet version".

Definition at line 148 of file JetMapBase.h.

◆ JetMomentMapConverterBase

template<class P >
template<class T >
friend class JetMomentMapConverterBase
friend

Definition at line 150 of file JetMapBase.h.

Member Data Documentation

◆ m_end

template<class P >
map_t::iterator JetMapBase< P >::m_end
protected

Definition at line 164 of file JetMapBase.h.

◆ m_nullData

template<class P >
const data_t JetMapBase< P >::m_nullData
staticprotected

Null data reference.

Definition at line 162 of file JetMapBase.h.

◆ m_ownPolicy

template<class P >
SG::OwnershipPolicy JetMapBase< P >::m_ownPolicy
protected

Definition at line 168 of file JetMapBase.h.

◆ m_store

template<class P >
map_t JetMapBase< P >::m_store
mutableprotected

Store last valid record index ‍/ mutable size_t m_lastIndex; not used so remove it for simplicity /!

Data store

Definition at line 160 of file JetMapBase.h.


The documentation for this class was generated from the following file:
JetMapBase::m_ownPolicy
SG::OwnershipPolicy m_ownPolicy
Definition: JetMapBase.h:168
JetMapBase::clear
virtual void clear()