5#ifndef ATHLINKS_ASSOCIATIONMAP_H
6#define ATHLINKS_ASSOCIATIONMAP_H
8#define ASSOCIATION_CONTEXT
9#define ASSOCIATIONMAP_CONTEXT
29#include "AthLinks/ElementLink.h"
30#include "AthLinks/ElementLinkVector.h"
37template<
class OBJCONT,
class ASSCONT>
45 typedef typename object_container_type::base_value_type
object_type;
54 typedef typename asso_container_type::base_value_type
asso_type;
59 typedef typename std::list<const asso_type*>
asso_list;
63 typedef typename std::map<object_link,asso_store>
store_type;
136 {
return (*objectIter).getObject(); }
155 {
return *assoIter; }
178 {
return this->
getObjects(*assoIter,theObjects); }
196 {
return this->
size(objectPointer); }
202 {
return this->
size(objectIter); }
221 if ( iMap->first.cptr() == objectLink.
cptr() ) {
229 if ( std::find((foundIter->second).begin(),
230 (foundIter->second).end(),
232 (foundIter->second).end() )
233 {
return foundIter; }
245#undef ASSOCIATION_CONTEXT
246#undef ASSOCIATIONMAP_CONTEXT
code only expands with the ASSOCIATIONMAP_CONTEXT
AssociationObjectIterator find(const object_type *objectPointer) const
find a given object in store
const object_type * getObject() const
retrieve the pointer to a given object
bool containsAssociation(const asso_type *assoPointer) const
check if the given object can be matched among the associated objects
size_t getNumberOfAssociations() const
get number of association for current pointed-to object
asso_iterator findAssociation(const asso_type *assoPointer) const
find the iterator for a given object
iterator for association vectors (internal use only)
std::map< object_link, asso_store > store_type
ASSCONT asso_container_type
const asso_type * getAssociation(asso_iterator assoIter) const
associations iterator access
virtual ~AssociationMap()
asso_iterator beginAssociation(const object_type *objectPointer) const
begin iterator for associations
std::list< const object_type * > object_list
asso_store::const_iterator asso_store_iterator
store_type m_associationMap
internal store
static const asso_store s_dum_asso_store
bool containsAssociation(const object_type *objectPointer, const asso_type *assoPointer) const
bool getObjects(const asso_iterator &assoIter, object_list &theObjects) const
get all objects for a given association
const object_type * getObject(const object_iterator &objectIter) const
get association iterators by object iterator
bool containsAssociation(const asso_type *assoPointer) const
store_iterator_type internalFind(const object_link &objectLink, const asso_link &assoLink)
internally used find method
void addAssociation(const object_container_type *objectContainer, const object_type *objectPointer, const asso_container_type *assoContainer, const asso_type *assoPointer)
asso_iterator beginAssociation(const object_iterator &objectIter) const
size_t getNumberOfAssociations(const object_iterator &objectIter) const
bool containsAssociation(const object_iterator &objectIter, const asso_type *assoPointer) const
containment check
AssociationObjectIterator object_iterator
object iterator type
ElementLink< asso_container_type > asso_link
size_t size()
get number of associations
object_iterator endObject() const
end iterator for objects
bool getAssociations(const object_iterator &objIter, asso_list &assocs) const
get all associations for a given object
store_type::iterator store_iterator_type
size_t getNumberOfAssociations(const object_type *objectPointer) const
size_t size(const object_type *objectPointer) const
asso_iterator endAssociation(const object_iterator &objectIter) const
asso_container_type::base_value_type asso_type
bool getAssociations(const object_type *objPointer, asso_list &assocs) const
get all associations for a given object
ElementLinkVector< asso_container_type > asso_store
asso_iterator findAssociation(const object_type *objectPointer, const asso_type *assoPointer) const
size_t getNumberOfObjects() const
retrieve number of objects in store
SG::GenerateIndexingPolicy< asso_container_type >::type::index_type asso_index_type
AssociationVectorIterator asso_iterator
association iterator type
object_container_type::base_value_type object_type
ElementLink< object_container_type > object_link
void addAssociation(const object_container_type *objectContainer, const object_index_type &objectIndex, const asso_container_type *assoContainer, const asso_index_type &assoIndex)
bool getObjects(const asso_type *assoPointer, object_list &theObjects) const
get all objects for a given association
object_iterator findObject(const object_type *theObject) const
finding an object with allocation
bool addToStore(const object_link &objectLink, const asso_link &assoLink)
internally used function to add links to store
asso_iterator endAssociation(const object_type *objectPointer) const
end iterator for associations
bool containsObject(const object_type *theObject) const
testing if object is in store
asso_iterator findAssociation(const object_iterator &objectIter, const asso_type *assoPointer) const
find association
OBJCONT object_container_type
std::list< const asso_type * > asso_list
SG::GenerateIndexingPolicy< object_container_type >::type::index_type object_index_type
size_t size(const object_iterator &objectIter) const
object_iterator beginObject() const
begin iterator for objects
void addAssociation(const object_link &objectLink, const asso_link &assoLink)
ElementLinkVector implementation for standalone ROOT.
ELVIterator< typename RefVector::const_iterator > const_iterator
ElementLink implementation for ROOT usage.
ElementConstPointer cptr() const
Return a pointer to the referenced element.